From 1f1d3f70b9d3c3b00d11b467d6081da1f96d2600 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 25 Mar 2016 15:45:50 +0100 Subject: [PATCH] More Argon2 tests --- test/default/pwhash.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/default/pwhash.c b/test/default/pwhash.c index e244bb72..2e04f8df 100644 --- a/test/default/pwhash.c +++ b/test/default/pwhash.c @@ -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()));