call progress callback at the beginning of pbkdf2 calculation

pull/25/head
Pavol Rusnak 9 years ago
parent 9a8e982153
commit fbc0df736a
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -42,6 +42,9 @@ void pbkdf2_hmac_sha256(const uint8_t *pass, int passlen, uint8_t *salt, int sal
salt[saltlen + 3] = i & 0xFF;
hmac_sha256(pass, passlen, salt, saltlen + 4, g);
memcpy(f, g, HMACLEN);
if (progress_callback) {
progress_callback(0, iterations);
}
for (j = 1; j < iterations; j++) {
hmac_sha256(pass, passlen, g, HMACLEN, g);
for (k = 0; k < HMACLEN; k++) {
@ -77,6 +80,9 @@ void pbkdf2_hmac_sha512(const uint8_t *pass, int passlen, uint8_t *salt, int sal
salt[saltlen + 3] = i & 0xFF;
hmac_sha512(pass, passlen, salt, saltlen + 4, g);
memcpy(f, g, HMACLEN);
if (progress_callback) {
progress_callback(0, iterations);
}
for (j = 1; j < iterations; j++) {
hmac_sha512(pass, passlen, g, HMACLEN, g);
for (k = 0; k < HMACLEN; k++) {

Loading…
Cancel
Save