Skip to content

Commit

Permalink
Remove unnecessary hasher_* variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kilic committed Nov 23, 2021
1 parent 8b7a7b8 commit 61a4cd0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/transcript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,8 @@ impl<R: Read, C: CurveAffine> Transcript<C, Challenge255<C>>
let mut state_hi = self.state.clone();
state_lo.update(&[KECCAK256_PREFIX_CHALLENGE_LO]);
state_hi.update(&[KECCAK256_PREFIX_CHALLENGE_HI]);
let hasher_lo = state_lo.clone();
let hasher_hi = state_hi.clone();
let result_lo: [u8; 32] = hasher_lo.finalize().as_slice().try_into().unwrap();
let result_hi: [u8; 32] = hasher_hi.finalize().as_slice().try_into().unwrap();
let result_lo: [u8; 32] = state_lo.finalize().as_slice().try_into().unwrap();
let result_hi: [u8; 32] = state_hi.finalize().as_slice().try_into().unwrap();

let mut t = result_lo.to_vec();
t.extend_from_slice(&result_hi[..]);
Expand Down Expand Up @@ -383,10 +381,8 @@ impl<W: Write, C: CurveAffine> Transcript<C, Challenge255<C>>
let mut state_hi = self.state.clone();
state_lo.update(&[KECCAK256_PREFIX_CHALLENGE_LO]);
state_hi.update(&[KECCAK256_PREFIX_CHALLENGE_HI]);
let hasher_lo = state_lo.clone();
let hasher_hi = state_hi.clone();
let result_lo: [u8; 32] = hasher_lo.finalize().as_slice().try_into().unwrap();
let result_hi: [u8; 32] = hasher_hi.finalize().as_slice().try_into().unwrap();
let result_lo: [u8; 32] = state_lo.finalize().as_slice().try_into().unwrap();
let result_hi: [u8; 32] = state_hi.finalize().as_slice().try_into().unwrap();

let mut t = result_lo.to_vec();
t.extend_from_slice(&result_hi[..]);
Expand Down

0 comments on commit 61a4cd0

Please sign in to comment.