1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00

Properly support Argon2id in crypto_pwhash()

This commit is contained in:
Frank Denis 2017-09-26 17:12:42 +02:00
parent 491f785274
commit d338ae9512

View File

@ -132,10 +132,12 @@ crypto_pwhash(unsigned char * const out, unsigned long long outlen,
unsigned long long opslimit, size_t memlimit, int alg)
{
switch (alg) {
case crypto_pwhash_ALG_ARGON2ID13:
case crypto_pwhash_ALG_ARGON2I13:
return crypto_pwhash_argon2i(out, outlen, passwd, passwdlen, salt,
opslimit, memlimit, alg);
case crypto_pwhash_ALG_ARGON2ID13:
return crypto_pwhash_argon2id(out, outlen, passwd, passwdlen, salt,
opslimit, memlimit, alg);
default:
errno = EINVAL;
return -1;