Skip to content

Commit

Permalink
use reset
Browse files Browse the repository at this point in the history
  • Loading branch information
¨Jeff committed Sep 8, 2023
1 parent 2d2e6c8 commit db9947a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ff/src/fields/field_hashers/expander/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,15 @@ impl<H: FixedOutputReset + Default + Clone> Expander for ExpanderXmd<H> {
hasher.update(&lib_str);
hasher.update(&[0u8]);
dst_prime.update(& mut hasher);
let b0 = hasher.finalize_fixed();
let b0 = hasher.finalize_fixed_reset();

let mut hasher = H::default();
hasher.update(&b0);
hasher.update(&[1u8]);
dst_prime.update(& mut hasher);
let mut bi = hasher.finalize_fixed();
let mut bi = hasher.finalize_fixed_reset();

let mut uniform_bytes: Vec<u8> = Vec::with_capacity(n);
uniform_bytes.extend_from_slice(&bi);
let mut hasher = H::default();
for i in 2..=ell {
// update the hasher with xor of b_0 and b_i elements
for (l, r) in b0.iter().zip(bi.iter()) {
Expand Down

0 comments on commit db9947a

Please sign in to comment.