| 
 | 
"||" is the concatenation operator. The number in braces is the length of the hash input value in bytes.  
 | 
| 
#define  | ATCA_MSG_SIZE_NONCE   (55) | 
|   | RandOut{32} || NumIn{20} || OpCode{1} || Mode{1} || LSB of Param2{1}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_MAC   (88) | 
|   | (Key or TempKey){32} || (Challenge or TempKey){32} || OpCode{1} || Mode{1} || Param2{2} || (OTP0_7 or 0){8} || (OTP8_10 or 0){3} || SN8{1} || (SN4_7 or 0){4} || SN0_1{2} || (SN2_3 or 0){2} 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_HMAC   (88u) | 
|   | 
| 
#define  | ATCA_MSG_SIZE_GEN_DIG   (96) | 
|   | KeyId{32} || OpCode{1} || Param1{1} || Param2{2} || SN8{1} || SN0_1{2} || 0{25} || TempKey{32}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_DIVERSIFIED_KEY   (96) | 
|   | ParentKey{32} || OtherData{4} || SN8{1} || SN0_1{2} || 0{25} || InputData{32}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_DERIVE_KEY   (96) | 
|   | KeyId{32} || OpCode{1} || Param1{1} || Param2{2} || SN8{1} || SN0_1{2} || 0{25} || TempKey{32}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_DERIVE_KEY_MAC   (39) | 
|   | KeyId{32} || OpCode{1} || Param1{1} || Param2{2} || SN8{1} || SN0_1{2}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_ENCRYPT_MAC   (96) | 
|   | KeyId{32} || OpCode{1} || Param1{1} || Param2{2}|| SN8{1} || SN0_1{2} || 0{25} || TempKey{32}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_SESSION_KEY   (96) | 
|   | TransportKey{32} || 0x15{1} || 0x00{1} || KeyId{2} || SN8{1} || SN0_1{2} || 0{25} || Nonce{32}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_DELETE_MAC   (96) | 
|   | Hmac/SecretKey{32} || 0x13{1} || 0x00{1} || 0x0000{2} || SN8{1} || SN0_1{2} || 0{25} || Nonce{32}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_RESPONSE_MAC   (97) | 
|   | SlotKey{32} || Opcode{1} || Param1{1} || Param2{2} || SN8{1} || SN0_1{2} || 0{25} || client_Resp{32} || checkmac_result{1}. 
  | 
|   | 
| 
#define  | ATCA_MSG_SIZE_PRIVWRITE_MAC   (96) | 
|   | KeyId{32} || OpCode{1} || Param1{1} || Param2{2}|| SN8{1} || SN0_1{2} || 0{21} || PlainText{36}. 
  | 
|   | 
| 
#define  | ATCA_COMMAND_HEADER_SIZE   ( 4) | 
|   | 
| 
#define  | ATCA_GENDIG_ZEROS_SIZE   (25) | 
|   | 
| 
#define  | ATCA_GENDIVKEY_ZEROS_SIZE   (25) | 
|   | 
| 
#define  | ATCA_WRITE_MAC_ZEROS_SIZE   (25) | 
|   | 
| 
#define  | ATCA_DELETE_MAC_ZEROS_SIZE   (25) | 
|   | 
| 
#define  | ATCA_RESP_MAC_ZEROS_SIZE   (25) | 
|   | 
| 
#define  | ATCA_PRIVWRITE_MAC_ZEROS_SIZE   (21) | 
|   | 
| 
#define  | ATCA_PRIVWRITE_PLAIN_TEXT_SIZE   (36) | 
|   | 
| 
#define  | ATCA_DERIVE_KEY_ZEROS_SIZE   (25) | 
|   | 
| 
#define  | ATCA_HMAC_BLOCK_SIZE   (64u) | 
|   | 
| 
#define  | ATCA_ENCRYPTION_KEY_SIZE   (64) | 
|   | 
 | 
| 
#define  | MAC_MODE_USE_TEMPKEY_MASK   ((uint8_t)0x03) | 
|   | mode mask for MAC command when using TempKey 
  | 
|   | 
 | 
| 
typedef struct atca_temp_key  | atca_temp_key_t | 
|   | Structure to hold TempKey fields. 
  | 
|   | 
| 
typedef struct atca_nonce_in_out  | atca_nonce_in_out_t | 
|   | 
| 
typedef struct atca_io_decrypt_in_out  | atca_io_decrypt_in_out_t | 
|   | 
| 
typedef struct atca_verify_mac  | atca_verify_mac_in_out_t | 
|   | 
| 
typedef struct atca_secureboot_enc_in_out  | atca_secureboot_enc_in_out_t | 
|   | 
| 
typedef struct atca_secureboot_mac_in_out  | atca_secureboot_mac_in_out_t | 
|   | 
| 
typedef struct atca_mac_in_out  | atca_mac_in_out_t | 
|   | 
| 
typedef struct atca_gen_dig_in_out  | atca_gen_dig_in_out_t | 
|   | Input/output parameters for function atcah_gen_dig(). 
  | 
|   | 
| 
typedef struct atca_diversified_key_in_out  | atca_diversified_key_in_out_t | 
|   | Input/output parameters for function atcah_gendivkey(). 
  | 
|   | 
| 
typedef struct atca_write_mac_in_out  | atca_write_mac_in_out_t | 
|   | Input/output parameters for function atcah_write_auth_mac() and atcah_privwrite_auth_mac(). 
  | 
|   | 
| 
typedef struct atca_check_mac_in_out  | atca_check_mac_in_out_t | 
|   | Input/output parameters for function atcah_check_mac(). 
  | 
|   | 
| 
typedef struct atca_resp_mac_in_out  | atca_resp_mac_in_out_t | 
|   | Input/Output parameters for calculating the output response mac in SHA105 device. Used with the atcah_gen_output_resp_mac() function. 
  | 
|   | 
| 
typedef struct atca_verify_in_out  | atca_verify_in_out_t | 
|   | 
| 
typedef struct atca_gen_key_in_out  | atca_gen_key_in_out_t | 
|   | Input/output parameters for calculating the PubKey digest put into TempKey by the GenKey command with the atcah_gen_key_msg() function. 
  | 
|   | 
| 
typedef struct atca_sign_internal_in_out  | atca_sign_internal_in_out_t | 
|   | Input/output parameters for calculating the message and digest used by the Sign(internal) command. Used with the atcah_sign_internal_msg() function. 
  | 
|   | 
| 
typedef struct atca_session_key_in_out  | atca_session_key_in_out_t | 
|   | Input/Output paramters for calculating the session key by the nonce command. Used with the atcah_gen_session_key() function. 
  | 
|   | 
| 
typedef struct atca_delete_in_out  | atca_delete_in_out_t | 
|   | Input/Output paramters for calculating the mac.Used with Delete command. 
  | 
|   | 
Definitions and Prototypes for ATCA Utility Functions. 
- Copyright
 - (c) 2015-2020 Microchip Technology Inc. and its subsidiaries.