mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
The test for pwhash is too slow for some systems.
Stop checking alterations for every single character.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user