From b07dfc5da3f81d5189aacae014388e7e9d9dfb00 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 23 Sep 2014 15:18:06 -0700 Subject: [PATCH] The test for pwhash is too slow for some systems. Stop checking alterations for every single character. --- test/default/pwhash.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/default/pwhash.c b/test/default/pwhash.c index 92806164..6b1d7b30 100644 --- a/test/default/pwhash.c +++ b/test/default/pwhash.c @@ -272,15 +272,12 @@ int main(void) strlen(passwd)) != 0) { printf("pwhash_str_verify failure\n"); } - for (i = 14U; i < sizeof str_out; i++) { - str_out[i]++; - if (crypto_pwhash_scryptsalsa208sha256_str_verify( - str_out, passwd, strlen(passwd)) == 0) { - printf("pwhash_str_verify(2) failure\n"); - } - str_out[i]--; + str_out[14]++; + if (crypto_pwhash_scryptsalsa208sha256_str_verify( + str_out, passwd, strlen(passwd)) == 0) { + printf("pwhash_str_verify(2) failure\n"); } - printf("OK\n"); + str_out[14]--; assert(crypto_pwhash_scryptsalsa208sha256_saltbytes() > 0U); assert(crypto_pwhash_scryptsalsa208sha256_strbytes() > 1U); @@ -291,5 +288,7 @@ int main(void) assert(crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive() > 0U); assert(crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive() > 0U); + printf("OK\n"); + return 0; }