From ba415e1f4dddf2be830838ddc37ea1af2b855c12 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 21 Jan 2016 08:35:53 +0100 Subject: [PATCH] Argon2: use existing constants more consistently By @technion via the reference implementation --- src/libsodium/crypto_pwhash/argon2/argon2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsodium/crypto_pwhash/argon2/argon2.c b/src/libsodium/crypto_pwhash/argon2/argon2.c index 80e1d996..b28cd3af 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2.c @@ -91,15 +91,15 @@ int argon2_hash(const uint32_t t_cost, const uint32_t m_cost, int result; uint8_t *out; - if (pwdlen > UINT32_MAX) { + if (pwdlen > ARGON2_MAX_PWD_LENGTH) { return ARGON2_PWD_TOO_LONG; } - if (hashlen > UINT32_MAX) { + if (hashlen > ARGON2_MAX_OUTLEN) { return ARGON2_OUTPUT_TOO_LONG; } - if (saltlen > UINT32_MAX) { + if (saltlen > ARGON2_MAX_SALT_LENGTH) { return ARGON2_SALT_TOO_LONG; }