diff --git a/aead/src/dyn_aead.rs b/aead/src/dyn_aead.rs index 8deb3b9f..4813710b 100644 --- a/aead/src/dyn_aead.rs +++ b/aead/src/dyn_aead.rs @@ -1,6 +1,6 @@ use inout::{InOutBuf, InOutBufReserved}; -use crate::{Aead, Error, Payload, Result}; +use crate::{Aead, Error, Result}; #[cfg(feature = "alloc")] use alloc::vec::Vec; @@ -141,14 +141,14 @@ impl DynAead for T { #[cfg(feature = "alloc")] fn encrypt_to_vec(&self, nonce: &[u8], aad: &[u8], msg: &[u8]) -> Result> { let nonce = nonce.try_into().map_err(|_| Error)?; - let payload = Payload { aad, msg }; + let payload = crate::Payload { aad, msg }; Aead::encrypt_to_vec(self, nonce, payload) } #[cfg(feature = "alloc")] fn decrypt_to_vec(&self, nonce: &[u8], aad: &[u8], msg: &[u8]) -> Result> { let nonce = nonce.try_into().map_err(|_| Error)?; - let payload = Payload { aad, msg }; + let payload = crate::Payload { aad, msg }; Aead::decrypt_to_vec(self, nonce, payload) } } diff --git a/aead/src/lib.rs b/aead/src/lib.rs index 09788d88..ffb41dd5 100644 --- a/aead/src/lib.rs +++ b/aead/src/lib.rs @@ -339,6 +339,7 @@ pub trait Aead { /// AES-GCM-SIV, ChaCha20Poly1305). [`Aead`] implementations which do not /// use a postfix tag will need to override this to correctly parse the /// ciphertext message. + #[cfg(feature = "alloc")] #[inline] fn decrypt_to_vec<'msg, 'aad>( &self,