BitBoxSwiss / bitbox02-firmware

Firmware code of the BitBox02 hardware wallet
https://bitbox.swiss/bitbox02
Apache License 2.0
217 stars 81 forks source link

keystore: use consistent types for seed length #1033

Closed benma closed 1 year ago

benma commented 1 year ago

Before this commit, we used size_t, uint32_t and uint8_t for seed sizes, which can only be 16, 24 or 32 bytes long.

uint8_t is only needed when storing the encrypted seed length to flash memory (see memory_set_encrypted_seed_and_hmac()) and when reading it back. We only keep uint8_t there and use size_t everywhere else for seed lenghts.