Skip to content

Commit

Permalink
Attempt to prevent buffer overflow in ML-KEM tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneider-bensch committed Jan 7, 2025
1 parent b86414f commit b895bda
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions libcrux-sha3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,27 +319,23 @@ pub mod portable {
/// Shake256 XOF in absorb state
impl Xof<136> for Shake256Xof {
/// Shake256 new state
#[inline(always)]
fn new() -> Self {
Self {
state: KeccakXofState::<1, 136, u64>::new(),
}
}

/// Shake256 absorb
#[inline(always)]
fn absorb(&mut self, input: &[u8]) {
self.state.absorb([input]);
}

/// Shake256 absorb final
#[inline(always)]
fn absorb_final(&mut self, input: &[u8]) {
self.state.absorb_final::<0x1fu8>([input]);
}

/// Shake256 squeeze
#[inline(always)]
fn squeeze(&mut self, out: &mut [u8]) {
self.state.squeeze([out]);
}
Expand Down

0 comments on commit b895bda

Please sign in to comment.