Skip to content

Commit

Permalink
Fix compilation errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Nov 18, 2024
1 parent 945e802 commit 36e01a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aead/src/dyn_aead.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -141,14 +141,14 @@ impl<T: Aead> DynAead for T {
#[cfg(feature = "alloc")]
fn encrypt_to_vec(&self, nonce: &[u8], aad: &[u8], msg: &[u8]) -> Result<Vec<u8>> {
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<Vec<u8>> {
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)
}
}
Expand Down
1 change: 1 addition & 0 deletions aead/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 36e01a5

Please sign in to comment.