From 36e01a58a2a471d350b56cc501a03c6ea9278fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Mon, 18 Nov 2024 05:24:48 +0300 Subject: [PATCH] Fix compilation errors and warnings --- aead/src/dyn_aead.rs | 6 +++--- aead/src/lib.rs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) 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,