BitBoxSwiss / bitbox02-firmware

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

backup/checksum: make size of BackupMode explicit #943

Closed benma closed 2 years ago

benma commented 2 years ago

In C, the size of an enum is undefined. In my manual checks, sizeof(BackupMode) is 4 bytes on my host machine and 1 byte on the BitBox02.

We explicitly set the size of the field for clarity to 1 byte (compatible with all backups created on the BitBox02s).