From 1d5bb90cb0a1b457570019845fed207faed67a99 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 20:34:58 +0200 Subject: Adding upstream version 115.10.0esr. Signed-off-by: Daniel Baumann --- third_party/rust/ahash/src/aes_hash.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'third_party/rust/ahash/src/aes_hash.rs') diff --git a/third_party/rust/ahash/src/aes_hash.rs b/third_party/rust/ahash/src/aes_hash.rs index 1c98582cee..7e619b520b 100644 --- a/third_party/rust/ahash/src/aes_hash.rs +++ b/third_party/rust/ahash/src/aes_hash.rs @@ -170,10 +170,10 @@ impl Hasher for AHasher { let tail = data.read_last_u128x4(); let mut current: [u128; 4] = [self.key; 4]; current[0] = aesenc(current[0], tail[0]); - current[1] = aesenc(current[1], tail[1]); + current[1] = aesdec(current[1], tail[1]); current[2] = aesenc(current[2], tail[2]); - current[3] = aesenc(current[3], tail[3]); - let mut sum: [u128; 2] = [self.key, self.key]; + current[3] = aesdec(current[3], tail[3]); + let mut sum: [u128; 2] = [self.key, !self.key]; sum[0] = add_by_64s(sum[0].convert(), tail[0].convert()).convert(); sum[1] = add_by_64s(sum[1].convert(), tail[1].convert()).convert(); sum[0] = shuffle_and_add(sum[0], tail[2]); @@ -190,8 +190,9 @@ impl Hasher for AHasher { sum[1] = shuffle_and_add(sum[1], blocks[3]); data = rest; } - self.hash_in_2(aesenc(current[0], current[1]), aesenc(current[2], current[3])); - self.hash_in(add_by_64s(sum[0].convert(), sum[1].convert()).convert()); + self.hash_in_2(current[0], current[1]); + self.hash_in_2(current[2], current[3]); + self.hash_in_2(sum[0], sum[1]); } else { //len 33-64 let (head, _) = data.read_u128x2(); @@ -215,7 +216,7 @@ impl Hasher for AHasher { fn finish(&self) -> u64 { let combined = aesdec(self.sum, self.enc); let result: [u64; 2] = aesenc(aesenc(combined, self.key), combined).convert(); - result[0] + result[1] } } -- cgit v1.2.3