CryptoAuthLib
Microchip CryptoAuthentication Library
secure_boot.h
Go to the documentation of this file.
1 
29 #ifndef SECURE_BOOT_H
30 #define SECURE_BOOT_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include "atca_status.h"
37 #include "secure_boot_memory.h"
38 #include "atca_command.h"
40 #include "host/atca_host.h"
41 
42 
43 #define SECURE_BOOT_CONFIG_DISABLE 0
44 #define SECURE_BOOT_CONFIG_FULL_BOTH 1
45 #define SECURE_BOOT_CONFIG_FULL_SIGN 2
46 #define SECURE_BOOT_CONFIG_FULL_DIG 3
47 
48 #ifndef SECURE_BOOT_CONFIGURATION
49 #define SECURE_BOOT_CONFIGURATION SECURE_BOOT_CONFIG_FULL_DIG
50 #endif
51 
52 #ifndef SECURE_BOOT_DIGEST_ENCRYPT_ENABLED
53 #define SECURE_BOOT_DIGEST_ENCRYPT_ENABLED true
54 #endif
55 
56 #ifndef SECURE_BOOT_UPGRADE_SUPPORT
57 #define SECURE_BOOT_UPGRADE_SUPPORT true
58 #endif
59 
60 typedef struct
61 {
62  uint16_t secure_boot_mode : 2;
63  uint16_t secure_boot_reserved1 : 1;
65  uint16_t secure_boot_rand_nonce : 1;
66  uint16_t secure_boot_reserved2 : 3;
67  uint16_t secure_boot_sig_dig : 4;
68  uint16_t secure_boot_pub_key : 4;
70 
71 
72 typedef struct
73 {
76  uint8_t app_digest[ATCA_SHA_DIGEST_SIZE];
77  #if SECURE_BOOT_DIGEST_ENCRYPT_ENABLED
78  uint8_t randomnum[RANDOM_RSP_SIZE];
79  uint8_t io_protection_key[ATCA_KEY_SIZE];
80  #endif
82 
85 extern ATCA_STATUS host_generate_random_number(uint8_t *rand);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif
92 
93 
94 
Definition: secure_boot.h:60
Definitions and Prototypes for ATCA Utility Functions.
Microchip Crypto Auth device command object - this is a command builder only, it does not send the co...
uint16_t secure_boot_rand_nonce
Definition: secure_boot.h:65
ATCA_STATUS
Definition: atca_status.h:41
#define ATCA_SHA_DIGEST_SIZE
Definition: atca_command.h:652
Definition: secure_boot.h:72
Wrapper API for software SHA 256 routines.
uint16_t secure_boot_reserved2
Definition: secure_boot.h:66
Provides interface to memory component for the secure boot.
uint16_t secure_boot_reserved1
Definition: secure_boot.h:63
uint16_t secure_boot_sig_dig
Definition: secure_boot.h:67
memory_parameters memory_params
Definition: secure_boot.h:74
uint16_t secure_boot_persistent_enable
Definition: secure_boot.h:64
Definition: secure_boot_memory.h:41
ATCA_STATUS bind_host_and_secure_element_with_io_protection(uint16_t slot)
Binds host MCU and Secure element with IO protection key.
Definition: secure_boot.c:230
#define ATCA_KEY_SIZE
size of a symmetric SHA key
Definition: atca_command.h:241
ATCA_STATUS secure_boot_process(void)
Handles secure boot functionality through initialization, execution, and de-initialization.
Definition: secure_boot.c:48
Definition: atca_crypto_sw_sha2.h:45
ATCA_STATUS host_generate_random_number(uint8_t *rand)
uint16_t secure_boot_mode
Definition: secure_boot.h:62
Microchip Crypto Auth status codes.
atcac_sha2_256_ctx s_sha_context
Definition: secure_boot.h:75
#define RANDOM_RSP_SIZE
Random command response packet size.
Definition: atca_command.h:596
uint16_t secure_boot_pub_key
Definition: secure_boot.h:68