Skip to content

Commit

Permalink
Fix padding AEAD impl to use the new offset of 3*key_size
Browse files Browse the repository at this point in the history
  • Loading branch information
rlee287 committed Oct 23, 2023
1 parent 157f343 commit e845ebc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aead/src/committing_aead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ mod padded_aead {
buffer: &mut [u8],
) -> crate::Result<crate::Tag<Self>> {
let offset_amount = Aead::CiphertextOverhead::to_usize()
+2*Aead::KeySize::to_usize();
+3*Aead::KeySize::to_usize();
buffer.copy_within(..buffer.len()-offset_amount, offset_amount);
buffer[..offset_amount].fill(0x00);

Expand Down Expand Up @@ -156,7 +156,7 @@ mod padded_aead {
});

let offset_amount = Aead::CiphertextOverhead::to_usize()
+2*Aead::KeySize::to_usize();
+3*Aead::KeySize::to_usize();
// Do the loop because the slice ct_eq requires constructing
// [0; offset_amount], which requires an allocation
let mut pad_is_ok = Choice::from(1);
Expand Down

0 comments on commit e845ebc

Please sign in to comment.