Skip to content

Commit

Permalink
Pass secret as a slice to final_merge
Browse files Browse the repository at this point in the history
This will allow us to call it with different arguments for the 128-bit
hash.
  • Loading branch information
shepmaster committed Nov 1, 2024
1 parent 53cab0d commit b0da4a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/xxhash3/large.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ where
debug_assert!(!last_block.is_empty());
self.last_round(&mut acc, last_block, last_stripe, secret);

self.final_merge(&mut acc, len.into_u64().wrapping_mul(PRIME64_1), secret)
let low = len.into_u64().wrapping_mul(PRIME64_1);
self.final_merge(&acc, low, secret.final_secret())
}

#[inline]
Expand Down Expand Up @@ -246,8 +247,7 @@ where
}

#[inline]
fn final_merge(&self, acc: &mut [u64; 8], init_value: u64, secret: &Secret) -> u64 {
let secret = secret.final_secret();
fn final_merge(&self, acc: &[u64; 8], init_value: u64, secret: &[u8; 64]) -> u64 {
let (secrets, _) = secret.bp_as_chunks();
let mut result = init_value;
for i in 0..4 {
Expand Down

0 comments on commit b0da4a3

Please sign in to comment.