|
|
|
@ -572,9 +572,9 @@ static void stretch_pin(const uint8_t *pin, size_t pin_len,
|
|
|
|
|
ui_progress(PIN_PBKDF2_MS / 10);
|
|
|
|
|
}
|
|
|
|
|
#ifdef STM32U5
|
|
|
|
|
uint8_t stretched_pin_tmp[OPTIGA_PIN_SECRET_SIZE] = {0};
|
|
|
|
|
uint8_t stretched_pin_tmp[SHA256_DIGEST_LENGTH] = {0};
|
|
|
|
|
pbkdf2_hmac_sha256_Final(&ctx, stretched_pin_tmp);
|
|
|
|
|
ensure(secure_aes_ecb_encrypt_hw(stretched_pin_tmp, OPTIGA_PIN_SECRET_SIZE,
|
|
|
|
|
ensure(secure_aes_ecb_encrypt_hw(stretched_pin_tmp, SHA256_DIGEST_LENGTH,
|
|
|
|
|
stretched_pin, SECURE_AES_KEY_XORK),
|
|
|
|
|
"secure_aes pin stretch failed");
|
|
|
|
|
memzero(stretched_pin_tmp, sizeof(stretched_pin_tmp));
|
|
|
|
|