Avoid useless comparison

This commit is contained in:
Frank Denis
2017-03-02 14:38:20 +01:00
parent faf40a1946
commit 0ae4fa63bf
2 changed files with 3 additions and 1 deletions
@@ -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);
+2
View File
@@ -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);
}