mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-24 12:36:01 -07:00
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
This commit is contained in:
parent
9e42094343
commit
6256e097c9
@ -34,12 +34,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#if SIZE_MAX > 0xffffffffULL
|
|
||||||
#define ARCH_BITS 64
|
|
||||||
#else
|
|
||||||
#define ARCH_BITS 32
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define crypto_pwhash_scryptsalsa208sha256_STRPREFIXBYTES 14
|
#define crypto_pwhash_scryptsalsa208sha256_STRPREFIXBYTES 14
|
||||||
#define crypto_pwhash_scryptsalsa208sha256_STRSETTINGBYTES 57
|
#define crypto_pwhash_scryptsalsa208sha256_STRSETTINGBYTES 57
|
||||||
#define crypto_pwhash_scryptsalsa208sha256_STRSALTBYTES 32
|
#define crypto_pwhash_scryptsalsa208sha256_STRSALTBYTES 32
|
||||||
|
@ -49,17 +49,9 @@ blkxor(uint32_t *dest, const uint32_t *src, size_t len)
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
#if ARCH_BITS == 32
|
|
||||||
for (i = 0; i < len * 16; i++) {
|
for (i = 0; i < len * 16; i++) {
|
||||||
dest[i] ^= src[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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user