From 38f9f5281e63d2ff8b7514a98355c80b690608bf Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 19 Oct 2021 18:25:05 +0200 Subject: [PATCH] AstroBWT: fixed rare incorrect hashes --- src/crypto/astrobwt/AstroBWT.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/crypto/astrobwt/AstroBWT.cpp b/src/crypto/astrobwt/AstroBWT.cpp index b16f8f8a..5cf8ea5c 100644 --- a/src/crypto/astrobwt/AstroBWT.cpp +++ b/src/crypto/astrobwt/AstroBWT.cpp @@ -108,6 +108,9 @@ static inline bool smaller(const uint8_t* v, uint64_t a, uint64_t b) const uint64_t data_a = bswap_64(*reinterpret_cast(v + a + 5)); const uint64_t data_b = bswap_64(*reinterpret_cast(v + b + 5)); + if (data_a == data_b) { + return (a < b); + } return (data_a < data_b); }