mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 14:28:07 +00:00
call progress callback at the beginning of pbkdf2 calculation
This commit is contained in:
parent
9a8e982153
commit
fbc0df736a
6
pbkdf2.c
6
pbkdf2.c
@ -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…
Reference in New Issue
Block a user