Update to 1.6.3 (#2081798)

epel9
Aleksei Bavshin 3 years ago
parent bf4854ec5d
commit d11abef69d
No known key found for this signature in database
GPG Key ID: 4F071603387A382A

@ -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}

@ -1 +1 @@
SHA512 (twox-hash-1.6.2.crate) = 8171cf6970f18143cf2bd186014fe5a72d3ec5b2cd1e718b45dbc94e5cb6bea1b2485a6f6332d52411ffb85d746266c408b3b3dbd6c7c18a98cc0dc953cc21b1
SHA512 (twox-hash-1.6.3.crate) = f7ce63e6e5ca79ce9330caf40b32578a5d2088c5d8ed371604268760d6e212d447d9e3a95378378a283024155bccdaea47597902c488a94c5d5f79770baec8fc

@ -1,26 +0,0 @@
From f085fe2e12321dcb5ecbb145ffde5c9c6fccd4aa Mon Sep 17 00:00:00 2001
From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
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);

@ -1,78 +0,0 @@
From 2fac078713ad979b8a56fcb5ccf5725d474c4325 Mon Sep 17 00:00:00 2001
From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
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::<u64>::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::<u32>::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::<u32>::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);
Loading…
Cancel
Save