scrypt fixes

This commit is contained in:
Frank Denis 2014-04-04 14:04:11 -07:00 committed by evoskuil
parent 4be77b901e
commit 653494bea8
2 changed files with 2 additions and 3 deletions

View File

@ -204,7 +204,6 @@ smix(uint8_t * B, size_t r, uint64_t N, uint32_t * V, uint32_t * XY)
blkxor(Y, &V[j * (32 * r)], 128 * r);
blockmix_salsa8(Y, X, Z, r);
}
/* 10: B' <-- X */
for (k = 0; k < 32 * r; k++)
le32enc(&B[4 * k], X[k]);
@ -265,7 +264,7 @@ escrypt_kdf_nosse(escrypt_local_t * local,
errno = ENOMEM;
return -1;
}
XY_size = (size_t)256 * r;
XY_size = (size_t)256 * r + 64;
need += XY_size;
if (need < XY_size) {
errno = ENOMEM;

View File

@ -348,7 +348,7 @@ escrypt_kdf_sse(escrypt_local_t * local,
errno = ENOMEM;
return -1;
}
XY_size = (size_t)256 * r;
XY_size = (size_t)256 * r + 64;
need += XY_size;
if (need < XY_size) {
errno = ENOMEM;