I'm trying to update include_crypt crate which is very old and all of the libraries have update it was going crate until I solve the last error and a bunch of errors happened suddenly here is the code:
pub enum EncryptionType {
Xor(&'static str),
Aes(&'static str, &'static str),
}
pub struct EncryptedFile {
buffer: &'static [u8],
enc_type: EncryptionType,
}
#[proc_macro]
pub fn encrypt_xor(input: TokenStream) -> TokenStream {
match xor::impl_encrypt_xor(input) {
Ok(ts) => ts,
Err(err) => err.to_compile_error().into(),
}
}
#[doc(hidden)]
pub(crate) fn impl_encrypt_xor(input: TokenStream) -> syn::Result<TokenStream> {
let args: FileArgs = syn::parse(input)?;
let mut file = read_file(&args.file_path)?;
xor(file.as_mut_slice(), &args.key);
let bytes = syn::LitByteStr::new(&file, proc_macro2::Span::call_site());
let key = args.key.as_str();
Ok(quote::quote!((include_crypt::obfstr::obfstr!(#key), #bytes)).into())
}