From d11abef69dd19ef9ec6bb0ec9a78ca78b4aa8981 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 4 May 2022 11:37:53 -0700 Subject: [PATCH] Update to 1.6.3 (#2081798) --- rust-twox-hash.spec | 5 +- sources | 2 +- ...hash-1.6.2-Fix-XXH3-generic-fallback.patch | 26 ------- ...h-1.6.2-Support-big-endian-platforms.patch | 78 ------------------- 4 files changed, 2 insertions(+), 109 deletions(-) delete mode 100644 twox-hash-1.6.2-Fix-XXH3-generic-fallback.patch delete mode 100644 twox-hash-1.6.2-Support-big-endian-platforms.patch diff --git a/rust-twox-hash.spec b/rust-twox-hash.spec index f7b524e..fb0ff70 100644 --- a/rust-twox-hash.spec +++ b/rust-twox-hash.spec @@ -4,7 +4,7 @@ %global crate twox-hash Name: rust-%{crate} -Version: 1.6.2 +Version: 1.6.3 Release: %autorelease Summary: Rust implementation of the XXHash and XXH3 algorithms @@ -12,9 +12,6 @@ Summary: Rust implementation of the XXHash and XXH3 algorithms License: MIT URL: https://crates.io/crates/twox-hash Source: %{crates_source} -# Address test failures on non-x86 platforms -Patch0: https://github.com/shepmaster/twox-hash/pull/86.patch#/twox-hash-1.6.2-Support-big-endian-platforms.patch -Patch1: https://github.com/shepmaster/twox-hash/pull/87.patch#/twox-hash-1.6.2-Fix-XXH3-generic-fallback.patch ExclusiveArch: %{rust_arches} diff --git a/sources b/sources index 49ccf14..cf234ef 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (twox-hash-1.6.2.crate) = 8171cf6970f18143cf2bd186014fe5a72d3ec5b2cd1e718b45dbc94e5cb6bea1b2485a6f6332d52411ffb85d746266c408b3b3dbd6c7c18a98cc0dc953cc21b1 +SHA512 (twox-hash-1.6.3.crate) = f7ce63e6e5ca79ce9330caf40b32578a5d2088c5d8ed371604268760d6e212d447d9e3a95378378a283024155bccdaea47597902c488a94c5d5f79770baec8fc diff --git a/twox-hash-1.6.2-Fix-XXH3-generic-fallback.patch b/twox-hash-1.6.2-Fix-XXH3-generic-fallback.patch deleted file mode 100644 index 0251569..0000000 --- a/twox-hash-1.6.2-Fix-XXH3-generic-fallback.patch +++ /dev/null @@ -1,26 +0,0 @@ -From f085fe2e12321dcb5ecbb145ffde5c9c6fccd4aa Mon Sep 17 00:00:00 2001 -From: Ulrich Weigand -Date: Fri, 4 Mar 2022 15:06:31 +0100 -Subject: [PATCH] Fix XXH3 generic fallback - -The generic fallback code used on non-Intel platforms seems to -have a bug that makes the computed hashes different from the -SSE and AVX code pathes (and the test cases). This patch makes -the generic path also pass the tests. ---- - src/xxh3.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/xxh3.rs b/src/xxh3.rs -index b793a521a..0ffc54189 100644 ---- a/src/xxh3.rs -+++ b/src/xxh3.rs -@@ -754,7 +754,7 @@ mod generic { - let data_key1 = key1 ^ in1; - let data_key2 = key2 ^ in2; - acc[i] = acc[i].wrapping_add(mul32_to64(data_key1, data_key1 >> 32)); -- acc[i + 1] = acc[i].wrapping_add(mul32_to64(data_key2, data_key2 >> 32)); -+ acc[i + 1] = acc[i + 1].wrapping_add(mul32_to64(data_key2, data_key2 >> 32)); - - if acc_width == AccWidth::Acc128Bits { - acc[i] = acc[i].wrapping_add(in2); diff --git a/twox-hash-1.6.2-Support-big-endian-platforms.patch b/twox-hash-1.6.2-Support-big-endian-platforms.patch deleted file mode 100644 index 8bf4138..0000000 --- a/twox-hash-1.6.2-Support-big-endian-platforms.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 2fac078713ad979b8a56fcb5ccf5725d474c4325 Mon Sep 17 00:00:00 2001 -From: Ulrich Weigand -Date: Fri, 4 Mar 2022 15:01:20 +0100 -Subject: [PATCH] Support big-endian platforms - -When using the UnalignedBuffer mechanism to operate on -multiple input bytes at once, the resulting u32 or u64 -needs to be byte-swapped on big-endian platforms. ---- - src/sixty_four.rs | 12 ++++++------ - src/thirty_two.rs | 10 +++++----- - 2 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/src/sixty_four.rs b/src/sixty_four.rs -index 9bd351c15..c15158693 100644 ---- a/src/sixty_four.rs -+++ b/src/sixty_four.rs -@@ -65,10 +65,10 @@ impl XxCore { - let mut v4 = self.v4; - - for [n1, n2, n3, n4] in values { -- v1 = ingest_one_number(v1, n1); -- v2 = ingest_one_number(v2, n2); -- v3 = ingest_one_number(v3, n3); -- v4 = ingest_one_number(v4, n4); -+ v1 = ingest_one_number(v1, n1.to_le()); -+ v2 = ingest_one_number(v2, n2.to_le()); -+ v3 = ingest_one_number(v3, n3.to_le()); -+ v4 = ingest_one_number(v4, n4.to_le()); - } - - self.v1 = v1; -@@ -221,7 +221,7 @@ impl XxHash64 { - - let mut buffered_u64s = UnalignedBuffer::::new(self.buffer.data()); - for buffered_u64 in &mut buffered_u64s { -- let mut k1 = buffered_u64.wrapping_mul(PRIME_2); -+ let mut k1 = buffered_u64.to_le().wrapping_mul(PRIME_2); - k1 = k1.rotate_left(31); - k1 = k1.wrapping_mul(PRIME_1); - hash ^= k1; -@@ -232,7 +232,7 @@ impl XxHash64 { - - let mut buffered_u32s = UnalignedBuffer::::new(buffered_u64s.remaining()); - for buffered_u32 in &mut buffered_u32s { -- let k1 = u64::from(buffered_u32).wrapping_mul(PRIME_1); -+ let k1 = u64::from(buffered_u32.to_le()).wrapping_mul(PRIME_1); - hash ^= k1; - hash = hash.rotate_left(23); - hash = hash.wrapping_mul(PRIME_2); -diff --git a/src/thirty_two.rs b/src/thirty_two.rs -index 86b2b1957..cfa44cdbc 100644 ---- a/src/thirty_two.rs -+++ b/src/thirty_two.rs -@@ -70,10 +70,10 @@ impl XxCore { - let mut v4 = self.v4; - - for [n1, n2, n3, n4] in values { -- v1 = ingest_one_number(v1, n1); -- v2 = ingest_one_number(v2, n2); -- v3 = ingest_one_number(v3, n3); -- v4 = ingest_one_number(v4, n4); -+ v1 = ingest_one_number(v1, n1.to_le()); -+ v2 = ingest_one_number(v2, n2.to_le()); -+ v3 = ingest_one_number(v3, n3.to_le()); -+ v4 = ingest_one_number(v4, n4.to_le()); - } - - self.v1 = v1; -@@ -211,7 +211,7 @@ impl XxHash32 { - - let mut buffered_u32s = UnalignedBuffer::::new(self.buffer.data()); - for buffered_u32 in &mut buffered_u32s { -- let k1 = buffered_u32.wrapping_mul(PRIME_3); -+ let k1 = buffered_u32.to_le().wrapping_mul(PRIME_3); - hash = hash.wrapping_add(k1); - hash = hash.rotate_left(17); - hash = hash.wrapping_mul(PRIME_4);