From 6256e097c9dea214b6dbbcc8429ebf84a096c86e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 31 Aug 2023 23:23:30 +0200 Subject: [PATCH] scrypt_nosse: Remove the 64-bit version of blkxor() It broke strict aliasing. Also remove ARCH_BITS that is not required any longer. Fixes #1301 --- .../crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h | 6 ------ .../nosse/pwhash_scryptsalsa208sha256_nosse.c | 8 -------- 2 files changed, 14 deletions(-) diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h index eee7b8b1..1224c0f1 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h @@ -34,12 +34,6 @@ #include #include -#if SIZE_MAX > 0xffffffffULL -#define ARCH_BITS 64 -#else -#define ARCH_BITS 32 -#endif - #define crypto_pwhash_scryptsalsa208sha256_STRPREFIXBYTES 14 #define crypto_pwhash_scryptsalsa208sha256_STRSETTINGBYTES 57 #define crypto_pwhash_scryptsalsa208sha256_STRSALTBYTES 32 diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c index 79483c37..9ecaf52f 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c @@ -49,17 +49,9 @@ blkxor(uint32_t *dest, const uint32_t *src, size_t len) { size_t i; -#if ARCH_BITS == 32 for (i = 0; i < len * 16; i++) { dest[i] ^= src[i]; } -#else - uint64_t *dest_ = (uint64_t *) (void *) dest; - const uint64_t *src_ = (const uint64_t *) (const void *) src; - for (i = 0; i < len * 8; i++) { - dest_[i] ^= src_[i]; - } -#endif } /*