Skip to content

Commit

Permalink
Remove inherent method in favor of DST
Browse files Browse the repository at this point in the history
  • Loading branch information
¨Jeff committed Apr 18, 2023
1 parent 361b2fa commit 545ac36
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions ff/src/fields/field_hashers/expander/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,6 @@ pub(super) struct ExpanderXof<H: ExtendableOutput + Clone + Default> {
pub(super) k: usize,
}

impl<H: ExtendableOutput + Clone + Default> ExpanderXof<H> {
fn update_dst_prime(&self, h: &mut H) {
if self.dst.len() > MAX_DST_LENGTH {
let mut long = H::default();
long.update(&LONG_DST_PREFIX.clone());
long.update(&self.dst);

let mut new_dst = [0u8; MAX_DST_LENGTH];
let new_dst = &mut new_dst[0..((2 * self.k + 7) >> 3)];
long.finalize_xof_into(new_dst);
h.update(new_dst);
h.update(&[new_dst.len() as u8]);
} else {
h.update(&self.dst);
h.update(&[self.dst.len() as u8]);
}
}
}

impl<H: ExtendableOutput + Clone + Default> Expander for ExpanderXof<H> {
fn expand(&self, msg: &[u8], n: usize) -> Vec<u8> {
let mut xofer = self.xofer.clone();
Expand All @@ -92,7 +73,6 @@ impl<H: ExtendableOutput + Clone + Default> Expander for ExpanderXof<H> {
xofer.update(&lib_str);

DST::new_xof::<H>(self.dst.as_ref(), self.k).update(&mut xofer);
// self.update_dst_prime(&mut xofer);
xofer.finalize_boxed(n).to_vec()
}
}
Expand Down

0 comments on commit 545ac36

Please sign in to comment.