More Argon2 tests

This commit is contained in:
Frank Denis 2016-03-25 15:45:50 +01:00
parent fb865c9a5c
commit 1f1d3f70b9

View File

@ -306,6 +306,16 @@ int main(void)
"passwore", strlen("passwore")) != -1) {
printf("pwhash_str_verify(invalid(7)) failure\n");
}
if (crypto_pwhash_str_verify("$Argon2i$v=19$m=4096,t=3,p=2$b2RpZHVlamRpc29kaXNrdw"
"$TNnWIwlu1061JHrnCqIAmjs3huSxYIU+0jWipu7Kc9M",
"password", strlen("password")) != -1) {
printf("pwhash_str_verify(invalid(8)) failure\n");
}
if (crypto_pwhash_str_verify("$argon2i$v=1$m=4096,t=3,p=2$b2RpZHVlamRpc29kaXNrdw"
"$TNnWIwlu1061JHrnCqIAmjs3huSxYIU+0jWipu7Kc9M",
"password", strlen("password")) != -1) {
printf("pwhash_str_verify(invalid(9)) failure\n");
}
assert(crypto_pwhash_saltbytes() > 0U);
assert(crypto_pwhash_strbytes() > 1U);
assert(crypto_pwhash_strbytes() > strlen(crypto_pwhash_strprefix()));