Skip to content

Commit

Permalink
scrypt_nosse: Remove the 64-bit version of blkxor()
Browse files Browse the repository at this point in the history
It broke strict aliasing.

Also remove ARCH_BITS that is not required any longer.

Fixes #1301
  • Loading branch information
jedisct1 committed Aug 31, 2023
1 parent 9e42094 commit 6256e09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
#include <stddef.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_STRSETTINGBYTES 57
#define crypto_pwhash_scryptsalsa208sha256_STRSALTBYTES 32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/*
Expand Down

0 comments on commit 6256e09

Please sign in to comment.