1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

Remove expected length from the pwhash_str_verify()/needs_rehash()

This commit is contained in:
Frank Denis 2021-11-11 14:15:24 +01:00
parent 89a62f0fa8
commit 443617d750
8 changed files with 18 additions and 18 deletions

View File

@ -214,8 +214,8 @@ crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES],
}
int
crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES],
const char *const passwd,
crypto_pwhash_argon2i_str_verify(const char * str,
const char * const passwd,
unsigned long long passwdlen)
{
int verify_ret;
@ -280,14 +280,14 @@ _needs_rehash(const char *str, unsigned long long opslimit, size_t memlimit,
}
int
crypto_pwhash_argon2i_str_needs_rehash(const char str[crypto_pwhash_argon2i_STRBYTES],
crypto_pwhash_argon2i_str_needs_rehash(const char * str,
unsigned long long opslimit, size_t memlimit)
{
return _needs_rehash(str, opslimit, memlimit, Argon2_i);
}
int
crypto_pwhash_argon2id_str_needs_rehash(const char str[crypto_pwhash_argon2id_STRBYTES],
crypto_pwhash_argon2id_str_needs_rehash(const char * str,
unsigned long long opslimit, size_t memlimit)
{
return _needs_rehash(str, opslimit, memlimit, Argon2_id);

View File

@ -210,8 +210,8 @@ crypto_pwhash_argon2id_str(char out[crypto_pwhash_argon2id_STRBYTES],
}
int
crypto_pwhash_argon2id_str_verify(const char str[crypto_pwhash_argon2id_STRBYTES],
const char *const passwd,
crypto_pwhash_argon2id_str_verify(const char * str,
const char * const passwd,
unsigned long long passwdlen)
{
int verify_ret;

View File

@ -172,7 +172,7 @@ crypto_pwhash_str_alg(char out[crypto_pwhash_STRBYTES],
}
int
crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES],
crypto_pwhash_str_verify(const char * str,
const char * const passwd,
unsigned long long passwdlen)
{
@ -190,7 +190,7 @@ crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES],
}
int
crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES],
crypto_pwhash_str_needs_rehash(const char * str,
unsigned long long opslimit, size_t memlimit)
{
if (strncmp(str, crypto_pwhash_argon2id_STRPREFIX,

View File

@ -243,7 +243,7 @@ crypto_pwhash_scryptsalsa208sha256_str(
int
crypto_pwhash_scryptsalsa208sha256_str_verify(
const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
const char *str,
const char *const passwd, unsigned long long passwdlen)
{
char wanted[crypto_pwhash_scryptsalsa208sha256_STRBYTES];
@ -273,7 +273,7 @@ crypto_pwhash_scryptsalsa208sha256_str_verify(
int
crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(
const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
const char * str,
unsigned long long opslimit, size_t memlimit)
{
uint32_t N_log2, N_log2_;

View File

@ -125,13 +125,13 @@ int crypto_pwhash_str_alg(char out[crypto_pwhash_STRBYTES],
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES],
int crypto_pwhash_str_verify(const char *str,
const char * const passwd,
unsigned long long passwdlen)
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES],
int crypto_pwhash_str_needs_rehash(const char *str,
unsigned long long opslimit, size_t memlimit)
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));

View File

@ -105,13 +105,13 @@ int crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES],
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES],
int crypto_pwhash_argon2i_str_verify(const char * str,
const char * const passwd,
unsigned long long passwdlen)
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_pwhash_argon2i_str_needs_rehash(const char str[crypto_pwhash_argon2i_STRBYTES],
int crypto_pwhash_argon2i_str_needs_rehash(const char * str,
unsigned long long opslimit, size_t memlimit)
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));

View File

@ -105,13 +105,13 @@ int crypto_pwhash_argon2id_str(char out[crypto_pwhash_argon2id_STRBYTES],
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_pwhash_argon2id_str_verify(const char str[crypto_pwhash_argon2id_STRBYTES],
int crypto_pwhash_argon2id_str_verify(const char * str,
const char * const passwd,
unsigned long long passwdlen)
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_pwhash_argon2id_str_needs_rehash(const char str[crypto_pwhash_argon2id_STRBYTES],
int crypto_pwhash_argon2id_str_needs_rehash(const char * str,
unsigned long long opslimit, size_t memlimit)
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));

View File

@ -95,7 +95,7 @@ int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
int crypto_pwhash_scryptsalsa208sha256_str_verify(const char * str,
const char * const passwd,
unsigned long long passwdlen)
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
@ -108,7 +108,7 @@ int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * passwd, size_t passwdl
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(const char * str,
unsigned long long opslimit,
size_t memlimit)
__attribute__ ((warn_unused_result)) __attribute__ ((nonnull));