Skip to content

Commit

Permalink
aead: fix Tag return values
Browse files Browse the repository at this point in the history
They were using `*::NonceSize` instead of `*::TagSize`.
  • Loading branch information
tarcieri committed May 31, 2020
1 parent f1ae0b0 commit 48f6d59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aead/src/lib.rs
Expand Up @@ -237,7 +237,7 @@ pub trait AeadInPlace {
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
) -> Result<Tag<Self::NonceSize>, Error>;
) -> Result<Tag<Self::TagSize>, Error>;

/// Decrypt the message in-place, returning an error in the event the
/// provided authentication tag does not match the given ciphertext.
Expand Down Expand Up @@ -305,7 +305,7 @@ pub trait AeadMutInPlace {
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
) -> Result<Tag<Self::NonceSize>, Error>;
) -> Result<Tag<Self::TagSize>, Error>;

/// Decrypt the message in-place, returning an error in the event the
/// provided authentication tag does not match the given ciphertext.
Expand Down Expand Up @@ -412,7 +412,7 @@ impl<Alg: AeadInPlace> AeadMutInPlace for Alg {
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
) -> Result<Tag<Self::NonceSize>, Error> {
) -> Result<Tag<Self::TagSize>, Error> {
<Self as AeadInPlace>::encrypt_in_place_detached(self, nonce, associated_data, buffer)
}

Expand Down

0 comments on commit 48f6d59

Please sign in to comment.