mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Avoid useless comparison
This commit is contained in:
@@ -54,7 +54,7 @@ size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max(void);
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX ((SIZE_MAX >= 68719476736U) ? : 68719476736U : SIZE_MAX)
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX ((SIZE_MAX >= 68719476736U) ? 68719476736U : SIZE_MAX)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max(void);
|
||||
|
||||
|
||||
@@ -169,9 +169,11 @@ randombytes_buf_deterministic(void * const buf, const size_t size,
|
||||
static const unsigned char zero[crypto_stream_chacha20_ietf_NONCEBYTES] = { 0 };
|
||||
|
||||
COMPILER_ASSERT(randombytes_SEEDBYTES == crypto_stream_chacha20_ietf_KEYBYTES);
|
||||
#if SIZE_MAX > 0x4000000000ULL
|
||||
if (size > 0x4000000000ULL) {
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
crypto_stream_chacha20_ietf((unsigned char *) buf, (unsigned long long) size,
|
||||
zero, seed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user