Skip to content

Commit

Permalink
Update poseidon2.nr
Browse files Browse the repository at this point in the history
  • Loading branch information
nventuro authored Nov 8, 2024
1 parent aa37cd5 commit ae281e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions noir_stdlib/src/hash/poseidon2.nr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Poseidon2 {
}
}

pub(crate) fn new(iv: Field) -> Poseidon2 {
pub fn new(iv: Field) -> Poseidon2 {
let mut result =
Poseidon2 { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };
result.state[RATE] = iv;
Expand All @@ -39,7 +39,7 @@ impl Poseidon2 {
self.state = crate::hash::poseidon2_permutation(self.state, 4);
}

fn absorb(&mut self, input: Field) {
pub fn absorb(&mut self, input: Field) {
assert(!self.squeeze_mode);
if self.cache_size == RATE {
// If we're absorbing, and the cache is full, apply the sponge permutation to compress the cache
Expand All @@ -53,7 +53,7 @@ impl Poseidon2 {
}
}

fn squeeze(&mut self) -> Field {
pub fn squeeze(&mut self) -> Field {
assert(!self.squeeze_mode);
// If we're in absorb mode, apply sponge permutation to compress the cache.
self.perform_duplex();
Expand Down

0 comments on commit ae281e2

Please sign in to comment.