1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

More tests for scrypt

This commit is contained in:
Frank Denis 2017-07-29 22:01:13 +02:00
parent a3f90d6020
commit ff8bb6705a
3 changed files with 20 additions and 3 deletions

View File

@ -195,7 +195,7 @@ escrypt_gensalt_r(uint32_t N_log2, uint32_t r, uint32_t p, const uint8_t *src,
return NULL; /* LCOV_EXCL_LINE */ return NULL; /* LCOV_EXCL_LINE */
} }
if (N_log2 > 63 || ((uint64_t) r * (uint64_t) p >= (1U << 30))) { if (N_log2 > 63 || ((uint64_t) r * (uint64_t) p >= (1U << 30))) {
return NULL; return NULL; /* LCOV_EXCL_LINE */
} }
dst = buf; dst = buf;
*dst++ = '$'; *dst++ = '$';

View File

@ -260,8 +260,19 @@ tv3(void)
{ "Y0!?iQa9M%5ekffW(`", "$7$" }, { "Y0!?iQa9M%5ekffW(`", "$7$" },
{ "Y0!?iQa9M%5ekffW(`", "" }, { "Y0!?iQa9M%5ekffW(`", "" },
{ "Y0!?iQa9M%5ekffW(`", { "Y0!?iQa9M%5ekffW(`",
"$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$" },
"" }, { "test",
"$7$.6..../.....lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
{ "test",
"$7$z6..../.....lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
{ "test",
"$7$8zzzzz/.....lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
{ "test",
"$7$8zzzzzzzzzz.lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
{ "test",
"$7$8.....zzzzz.lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
{ "test",
"$7$86..../..../lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." }
}; };
char * out; char * out;
char * passwd; char * passwd;

View File

@ -29,4 +29,10 @@ pwhash_str failure: [24]
pwhash_str failure: [25] pwhash_str failure: [25]
pwhash_str failure: [26] pwhash_str failure: [26]
pwhash_str failure: [27] pwhash_str failure: [27]
pwhash_str failure: [28]
pwhash_str failure: [29]
pwhash_str failure: [30]
pwhash_str failure: [31]
pwhash_str failure: [32]
pwhash_str failure: [33]
OK OK