mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-12-10 22:35:36 -05:00
fw: Rename partition digest to checksum
- Rename functions, defines, et c to indicate that it's a checksum over the partition, not necessarily a cryptographic hash digest even though we use a version of BLAKE2s. - Add comments describing where the checksum is stored and what it is used for. Co-authored-by: Mikael Ågren <mikael@tillitis.se>
This commit is contained in:
parent
106a7a5613
commit
66ea8df1d9
2 changed files with 16 additions and 12 deletions
|
|
@ -46,7 +46,7 @@
|
|||
#define SIZE_STORAGE_AREA 0x20000UL // 128KiB
|
||||
#define N_STORAGE_AREA 4
|
||||
|
||||
#define PART_DIGEST_SIZE 16
|
||||
#define PART_CHECKSUM_SIZE 16
|
||||
|
||||
enum part_status {
|
||||
PART_SLOT0_INVALID = 1,
|
||||
|
|
@ -70,6 +70,8 @@ enum part_status {
|
|||
/* - 1 byte status. */
|
||||
/* - 16 bytes random nonce. */
|
||||
/* - 16 bytes authentication tag. */
|
||||
/**/
|
||||
/*- Checksum over the above */
|
||||
|
||||
struct auth_metadata {
|
||||
uint8_t nonce[16];
|
||||
|
|
@ -99,7 +101,7 @@ struct partition_table {
|
|||
|
||||
struct partition_table_storage {
|
||||
struct partition_table table;
|
||||
uint8_t check_digest[PART_DIGEST_SIZE];
|
||||
uint8_t checksum[PART_CHECKSUM_SIZE]; // Helps detect flash problems
|
||||
} __attribute__((packed));
|
||||
|
||||
enum part_status part_get_status(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue