aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2022-01-20 14:24:13 +0900
committerNIIBE Yutaka <[email protected]>2022-01-20 14:24:13 +0900
commit867435cf8847fb80e922eb818fbcfac131863b8c (patch)
tree308a4a18abe8a73c88b68568c664a76de16bce74
parent535a4d345872aa2cd2ab3a5f9c4411d0a0313328 (diff)
downloadlibgcrypt-867435cf8847fb80e922eb818fbcfac131863b8c.tar.gz
libgcrypt-867435cf8847fb80e922eb818fbcfac131863b8c.tar.bz2
libgcrypt-867435cf8847fb80e922eb818fbcfac131863b8c.zip
scrypt: Fix the last step of SCRYPT.
* cipher/scrypt.c (_gcry_kdf_scrypt): Single call to PBKDF2. -- Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--cipher/scrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cipher/scrypt.c b/cipher/scrypt.c
index 13fd1cf0..5502bdcc 100644
--- a/cipher/scrypt.c
+++ b/cipher/scrypt.c
@@ -309,7 +309,7 @@ _gcry_kdf_scrypt (const unsigned char *passwd, size_t passwdlen,
for (i = 0; !ec && i < p; i++)
scrypt_ro_mix (r, &B[i * r128], N, tmp1, tmp2);
- for (i = 0; !ec && i < p; i++)
+ if (!ec)
ec = _gcry_kdf_pkdf2 (passwd, passwdlen, GCRY_MD_SHA256, B, p * r128,
1 /* iterations */, dkLen, DK);