CryptoAuthLib
Microchip CryptoAuthentication Library
ATCACommand (atca_)

CryptoAuthLib command builder object, ATCACommand. Member functions for the ATCACommand object. More...

Data Structures

struct  atca_command
 atca_command is the C object backing ATCACommand. More...
 
struct  ATCAPacket
 an ATCA packet structure. This is a superset of the packet transmitted on the wire. It's also used as a buffer for receiving the response More...
 

Macros

#define ATCA_CMD_SIZE_MIN   ((uint8_t)7)
 minimum number of bytes in command (from count byte to second CRC byte) More...
 
#define ATCA_CMD_SIZE_MAX   ((uint8_t)4 * 36 + 7)
 maximum size of command packet (Verify) More...
 
#define CMD_STATUS_SUCCESS   ((uint8_t)0x00)
 status byte for success More...
 
#define CMD_STATUS_WAKEUP   ((uint8_t)0x11)
 status byte after wake-up More...
 
#define CMD_STATUS_BYTE_PARSE   ((uint8_t)0x03)
 command parse error More...
 
#define CMD_STATUS_BYTE_ECC   ((uint8_t)0x05)
 command ECC error More...
 
#define CMD_STATUS_BYTE_EXEC   ((uint8_t)0x0F)
 command execution error More...
 
#define CMD_STATUS_BYTE_COMM   ((uint8_t)0xFF)
 communication error More...
 

Typedefs

typedef struct atca_commandATCACommand
 

Functions

ATCA_STATUS initATCACommand (ATCADeviceType device_type, ATCACommand ca_cmd)
 Initializer for ATCACommand. More...
 
ATCACommand newATCACommand (ATCADeviceType device_type)
 constructor for ATCACommand More...
 
void deleteATCACommand (ATCACommand *ca_cmd)
 ATCACommand destructor. More...
 
ATCA_STATUS atCheckMAC (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand CheckMAC method. More...
 
ATCA_STATUS atCounter (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Counter method. More...
 
ATCA_STATUS atDeriveKey (ATCACommand ca_cmd, ATCAPacket *packet, bool has_mac)
 ATCACommand DeriveKey method. More...
 
ATCA_STATUS atECDH (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand ECDH method. More...
 
ATCA_STATUS atGenDig (ATCACommand ca_cmd, ATCAPacket *packet, bool is_no_mac_key)
 ATCACommand Generate Digest method. More...
 
ATCA_STATUS atGenKey (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Generate Key method. More...
 
ATCA_STATUS atHMAC (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand HMAC method. More...
 
ATCA_STATUS atInfo (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Info method. More...
 
ATCA_STATUS atLock (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Lock method. More...
 
ATCA_STATUS atMAC (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand MAC method. More...
 
ATCA_STATUS atNonce (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Nonce method. More...
 
ATCA_STATUS atPause (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Pause method. More...
 
ATCA_STATUS atPrivWrite (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand PrivWrite method. More...
 
ATCA_STATUS atRandom (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Random method. More...
 
ATCA_STATUS atRead (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Read method. More...
 
ATCA_STATUS atSecureBoot (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand SecureBoot method. More...
 
ATCA_STATUS atSHA (ATCACommand ca_cmd, ATCAPacket *packet, uint16_t write_context_size)
 ATCACommand SHA method. More...
 
ATCA_STATUS atSign (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand Sign method. More...
 
ATCA_STATUS atUpdateExtra (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand UpdateExtra method. More...
 
ATCA_STATUS atVerify (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand ECDSA Verify method. More...
 
ATCA_STATUS atWrite (ATCACommand ca_cmd, ATCAPacket *packet, bool has_mac)
 ATCACommand Write method. More...
 
ATCA_STATUS atAES (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand AES method. More...
 
ATCA_STATUS atSelfTest (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand AES method. More...
 
ATCA_STATUS atKDF (ATCACommand ca_cmd, ATCAPacket *packet)
 ATCACommand KDF method. More...
 
bool atIsSHAFamily (ATCADeviceType device_type)
 determines if a given device type is a SHA device or a superset of a SHA device More...
 
bool atIsECCFamily (ATCADeviceType device_type)
 determines if a given device type is an ECC device or a superset of a ECC device More...
 
ATCA_STATUS isATCAError (uint8_t *data)
 checks for basic error frame in data More...
 
void atCRC (size_t length, const uint8_t *data, uint8_t *crc_le)
 Calculates CRC over the given raw data and returns the CRC in little-endian byte order. More...
 
void atCalcCrc (ATCAPacket *pkt)
 This function calculates CRC and adds it to the correct offset in the packet data. More...
 
ATCA_STATUS atCheckCrc (const uint8_t *response)
 This function checks the consistency of a response. More...
 

Opcodes for Crypto Authentication device commands

#define ATCA_CHECKMAC   ((uint8_t)0x28)
 CheckMac command op-code. More...
 
#define ATCA_DERIVE_KEY   ((uint8_t)0x1C)
 DeriveKey command op-code. More...
 
#define ATCA_INFO   ((uint8_t)0x30)
 Info command op-code. More...
 
#define ATCA_GENDIG   ((uint8_t)0x15)
 GenDig command op-code. More...
 
#define ATCA_GENKEY   ((uint8_t)0x40)
 GenKey command op-code. More...
 
#define ATCA_HMAC   ((uint8_t)0x11)
 HMAC command op-code. More...
 
#define ATCA_LOCK   ((uint8_t)0x17)
 Lock command op-code. More...
 
#define ATCA_MAC   ((uint8_t)0x08)
 MAC command op-code. More...
 
#define ATCA_NONCE   ((uint8_t)0x16)
 Nonce command op-code. More...
 
#define ATCA_PAUSE   ((uint8_t)0x01)
 Pause command op-code. More...
 
#define ATCA_PRIVWRITE   ((uint8_t)0x46)
 PrivWrite command op-code. More...
 
#define ATCA_RANDOM   ((uint8_t)0x1B)
 Random command op-code. More...
 
#define ATCA_READ   ((uint8_t)0x02)
 Read command op-code. More...
 
#define ATCA_SIGN   ((uint8_t)0x41)
 Sign command op-code. More...
 
#define ATCA_UPDATE_EXTRA   ((uint8_t)0x20)
 UpdateExtra command op-code. More...
 
#define ATCA_VERIFY   ((uint8_t)0x45)
 GenKey command op-code. More...
 
#define ATCA_WRITE   ((uint8_t)0x12)
 Write command op-code. More...
 
#define ATCA_ECDH   ((uint8_t)0x43)
 ECDH command op-code. More...
 
#define ATCA_COUNTER   ((uint8_t)0x24)
 Counter command op-code. More...
 
#define ATCA_SHA   ((uint8_t)0x47)
 SHA command op-code. More...
 
#define ATCA_AES   ((uint8_t)0x51)
 AES command op-code. More...
 
#define ATCA_KDF   ((uint8_t)0x56)
 KDF command op-code. More...
 
#define ATCA_SECUREBOOT   ((uint8_t)0x80)
 Secure Boot command op-code. More...
 
#define ATCA_SELFTEST   ((uint8_t)0x77)
 Self test command op-code. More...
 

Definitions of Data and Packet Sizes

#define ATCA_BLOCK_SIZE   (32)
 size of a block More...
 
#define ATCA_WORD_SIZE   (4)
 size of a word More...
 
#define ATCA_PUB_KEY_PAD   (4)
 size of the public key pad More...
 
#define ATCA_SERIAL_NUM_SIZE   (9)
 number of bytes in the device serial number More...
 
#define ATCA_RSP_SIZE_VAL   ((uint8_t)7)
 size of response packet containing four bytes of data More...
 
#define ATCA_KEY_COUNT   (16)
 number of keys More...
 
#define ATCA_ECC_CONFIG_SIZE   (128)
 size of configuration zone More...
 
#define ATCA_SHA_CONFIG_SIZE   (88)
 size of configuration zone More...
 
#define ATCA_OTP_SIZE   (64)
 size of OTP zone More...
 
#define ATCA_DATA_SIZE   (ATCA_KEY_COUNT * ATCA_KEY_SIZE)
 size of data zone More...
 
#define ATCA_AES_GFM_SIZE   ATCA_BLOCK_SIZE
 size of GFM data More...
 
#define ATCA_CHIPMODE_OFFSET   (19)
 ChipMode byte offset within the configuration zone. More...
 
#define ATCA_CHIPMODE_I2C_ADDRESS_FLAG   ((uint8_t)0x01)
 ChipMode I2C Address in UserExtraAdd flag. More...
 
#define ATCA_CHIPMODE_TTL_ENABLE_FLAG   ((uint8_t)0x02)
 ChipMode TTLenable flag. More...
 
#define ATCA_CHIPMODE_WATCHDOG_MASK   ((uint8_t)0x04)
 ChipMode watchdog duration mask. More...
 
#define ATCA_CHIPMODE_WATCHDOG_SHORT   ((uint8_t)0x00)
 ChipMode short watchdog (~1.3s) More...
 
#define ATCA_CHIPMODE_WATCHDOG_LONG   ((uint8_t)0x04)
 ChipMode long watchdog (~13s) More...
 
#define ATCA_CHIPMODE_CLOCK_DIV_MASK   ((uint8_t)0xF8)
 ChipMode clock divider mask. More...
 
#define ATCA_CHIPMODE_CLOCK_DIV_M0   ((uint8_t)0x00)
 ChipMode clock divider M0. More...
 
#define ATCA_CHIPMODE_CLOCK_DIV_M1   ((uint8_t)0x28)
 ChipMode clock divider M1. More...
 
#define ATCA_CHIPMODE_CLOCK_DIV_M2   ((uint8_t)0x68)
 ChipMode clock divider M2. More...
 
#define ATCA_COUNT_SIZE   ((uint8_t)1)
 Number of bytes in the command packet Count. More...
 
#define ATCA_CRC_SIZE   ((uint8_t)2)
 Number of bytes in the command packet CRC. More...
 
#define ATCA_PACKET_OVERHEAD   (ATCA_COUNT_SIZE + ATCA_CRC_SIZE)
 Number of bytes in the command packet. More...
 
#define ATCA_PUB_KEY_SIZE   (64)
 size of a p256 public key More...
 
#define ATCA_PRIV_KEY_SIZE   (32)
 size of a p256 private key More...
 
#define ATCA_SIG_SIZE   (64)
 size of a p256 signature More...
 
#define ATCA_KEY_SIZE   (32)
 size of a symmetric SHA key More...
 
#define RSA2048_KEY_SIZE   (256)
 size of a RSA private key More...
 
#define ATCA_RSP_SIZE_MIN   ((uint8_t)4)
 minimum number of bytes in response More...
 
#define ATCA_RSP_SIZE_4   ((uint8_t)7)
 size of response packet containing 4 bytes data More...
 
#define ATCA_RSP_SIZE_72   ((uint8_t)75)
 size of response packet containing 64 bytes data More...
 
#define ATCA_RSP_SIZE_64   ((uint8_t)67)
 size of response packet containing 64 bytes data More...
 
#define ATCA_RSP_SIZE_32   ((uint8_t)35)
 size of response packet containing 32 bytes data More...
 
#define ATCA_RSP_SIZE_16   ((uint8_t)19)
 size of response packet containing 16 bytes data More...
 
#define ATCA_RSP_SIZE_MAX   ((uint8_t)75)
 maximum size of response packet (GenKey and Verify command) More...
 
#define OUTNONCE_SIZE   (32)
 Size of the OutNonce response expected from several commands. More...
 

Definitions for Command Parameter Ranges

#define ATCA_KEY_ID_MAX   ((uint8_t)15)
 maximum value for key id More...
 
#define ATCA_OTP_BLOCK_MAX   ((uint8_t)1)
 maximum value for OTP block More...
 

Definitions for Indexes Common to All Commands

#define ATCA_COUNT_IDX   (0)
 command packet index for count More...
 
#define ATCA_OPCODE_IDX   (1)
 command packet index for op-code More...
 
#define ATCA_PARAM1_IDX   (2)
 command packet index for first parameter More...
 
#define ATCA_PARAM2_IDX   (3)
 command packet index for second parameter More...
 
#define ATCA_DATA_IDX   (5)
 command packet index for data load More...
 
#define ATCA_RSP_DATA_IDX   (1)
 buffer index of data in response More...
 

Definitions for Zone and Address Parameters

#define ATCA_ZONE_CONFIG   ((uint8_t)0x00)
 Configuration zone. More...
 
#define ATCA_ZONE_OTP   ((uint8_t)0x01)
 OTP (One Time Programming) zone. More...
 
#define ATCA_ZONE_DATA   ((uint8_t)0x02)
 Data zone. More...
 
#define ATCA_ZONE_MASK   ((uint8_t)0x03)
 Zone mask. More...
 
#define ATCA_ZONE_ENCRYPTED   ((uint8_t)0x40)
 Zone bit 6 set: Write is encrypted with an unlocked data zone. More...
 
#define ATCA_ZONE_READWRITE_32   ((uint8_t)0x80)
 Zone bit 7 set: Access 32 bytes, otherwise 4 bytes. More...
 
#define ATCA_ADDRESS_MASK_CONFIG   (0x001F)
 Address bits 5 to 7 are 0 for Configuration zone. More...
 
#define ATCA_ADDRESS_MASK_OTP   (0x000F)
 Address bits 4 to 7 are 0 for OTP zone. More...
 
#define ATCA_ADDRESS_MASK   (0x007F)
 Address bit 7 to 15 are always 0. More...
 
#define ATCA_TEMPKEY_KEYID   (0xFFFF)
 KeyID when referencing TempKey. More...
 

Definitions for Key types

#define ATCA_B283_KEY_TYPE   0
 B283 NIST ECC key. More...
 
#define ATCA_K283_KEY_TYPE   1
 K283 NIST ECC key. More...
 
#define ATCA_P256_KEY_TYPE   4
 P256 NIST ECC key. More...
 
#define ATCA_AES_KEY_TYPE   6
 AES-128 Key. More...
 
#define ATCA_SHA_KEY_TYPE   7
 SHA key or other data. More...
 

Definitions for the AES Command

#define AES_MODE_IDX   ATCA_PARAM1_IDX
 AES command index for mode. More...
 
#define AES_KEYID_IDX   ATCA_PARAM2_IDX
 AES command index for key id. More...
 
#define AES_INPUT_IDX   ATCA_DATA_IDX
 AES command index for input data. More...
 
#define AES_COUNT   (23)
 AES command packet size. More...
 
#define AES_MODE_MASK   ((uint8_t)0xC7)
 AES mode bits 3 to 5 are 0. More...
 
#define AES_MODE_KEY_BLOCK_MASK   ((uint8_t)0xC0)
 AES mode mask for key block field. More...
 
#define AES_MODE_OP_MASK   ((uint8_t)0x07)
 AES mode operation mask. More...
 
#define AES_MODE_ENCRYPT   ((uint8_t)0x00)
 AES mode: Encrypt. More...
 
#define AES_MODE_DECRYPT   ((uint8_t)0x01)
 AES mode: Decrypt. More...
 
#define AES_MODE_GFM   ((uint8_t)0x03)
 AES mode: GFM calculation. More...
 
#define AES_MODE_KEY_BLOCK_POS   (6)
 Bit shift for key block in mode. More...
 
#define AES_DATA_SIZE   (16)
 size of AES encrypt/decrypt data More...
 
#define AES_RSP_SIZE   ATCA_RSP_SIZE_16
 AES command response packet size. More...
 

Definitions for the CheckMac Command

#define CHECKMAC_MODE_IDX   ATCA_PARAM1_IDX
 CheckMAC command index for mode. More...
 
#define CHECKMAC_KEYID_IDX   ATCA_PARAM2_IDX
 CheckMAC command index for key identifier. More...
 
#define CHECKMAC_CLIENT_CHALLENGE_IDX   ATCA_DATA_IDX
 CheckMAC command index for client challenge. More...
 
#define CHECKMAC_CLIENT_RESPONSE_IDX   (37)
 CheckMAC command index for client response. More...
 
#define CHECKMAC_DATA_IDX   (69)
 CheckMAC command index for other data. More...
 
#define CHECKMAC_COUNT   (84)
 CheckMAC command packet size. More...
 
#define CHECKMAC_MODE_CHALLENGE   ((uint8_t)0x00)
 CheckMAC mode 0: first SHA block from key id. More...
 
#define CHECKMAC_MODE_BLOCK2_TEMPKEY   ((uint8_t)0x01)
 CheckMAC mode bit 0: second SHA block from TempKey. More...
 
#define CHECKMAC_MODE_BLOCK1_TEMPKEY   ((uint8_t)0x02)
 CheckMAC mode bit 1: first SHA block from TempKey. More...
 
#define CHECKMAC_MODE_SOURCE_FLAG_MATCH   ((uint8_t)0x04)
 CheckMAC mode bit 2: match TempKey.SourceFlag. More...
 
#define CHECKMAC_MODE_INCLUDE_OTP_64   ((uint8_t)0x20)
 CheckMAC mode bit 5: include first 64 OTP bits. More...
 
#define CHECKMAC_MODE_MASK   ((uint8_t)0x27)
 CheckMAC mode bits 3, 4, 6, and 7 are 0. More...
 
#define CHECKMAC_CLIENT_CHALLENGE_SIZE   (32)
 CheckMAC size of client challenge. More...
 
#define CHECKMAC_CLIENT_RESPONSE_SIZE   (32)
 CheckMAC size of client response. More...
 
#define CHECKMAC_OTHER_DATA_SIZE   (13)
 CheckMAC size of "other data". More...
 
#define CHECKMAC_CLIENT_COMMAND_SIZE   (4)
 CheckMAC size of client command header size inside "other data". More...
 
#define CHECKMAC_CMD_MATCH   (0)
 CheckMAC return value when there is a match. More...
 
#define CHECKMAC_CMD_MISMATCH   (1)
 CheckMAC return value when there is a mismatch. More...
 
#define CHECKMAC_RSP_SIZE   ATCA_RSP_SIZE_MIN
 CheckMAC response packet size. More...
 

Definitions for the Counter command

#define COUNTER_COUNT   ATCA_CMD_SIZE_MIN
 
#define COUNTER_MODE_IDX   ATCA_PARAM1_IDX
 Counter command index for mode. More...
 
#define COUNTER_KEYID_IDX   ATCA_PARAM2_IDX
 Counter command index for key id. More...
 
#define COUNTER_MODE_MASK   ((uint8_t)0x01)
 Counter mode bits 1 to 7 are 0. More...
 
#define COUNTER_MAX_VALUE   ((uint32_t)2097151)
 Counter maximum value of the counter. More...
 
#define COUNTER_MODE_READ   ((uint8_t)0x00)
 Counter command mode for reading. More...
 
#define COUNTER_MODE_INCREMENT   ((uint8_t)0x01)
 Counter command mode for incrementing. More...
 
#define COUNTER_RSP_SIZE   ATCA_RSP_SIZE_4
 Counter command response packet size. More...
 

Definitions for the DeriveKey Command

#define DERIVE_KEY_RANDOM_IDX   ATCA_PARAM1_IDX
 DeriveKey command index for random bit. More...
 
#define DERIVE_KEY_TARGETKEY_IDX   ATCA_PARAM2_IDX
 DeriveKey command index for target slot. More...
 
#define DERIVE_KEY_MAC_IDX   ATCA_DATA_IDX
 DeriveKey command index for optional MAC. More...
 
#define DERIVE_KEY_COUNT_SMALL   ATCA_CMD_SIZE_MIN
 DeriveKey command packet size without MAC. More...
 
#define DERIVE_KEY_MODE   ((uint8_t)0x04)
 DeriveKey command mode set to 4 as in datasheet. More...
 
#define DERIVE_KEY_COUNT_LARGE   (39)
 DeriveKey command packet size with MAC. More...
 
#define DERIVE_KEY_RANDOM_FLAG   ((uint8_t)4)
 DeriveKey 1. parameter; has to match TempKey.SourceFlag. More...
 
#define DERIVE_KEY_MAC_SIZE   (32)
 DeriveKey MAC size. More...
 
#define DERIVE_KEY_RSP_SIZE   ATCA_RSP_SIZE_MIN
 DeriveKey response packet size. More...
 

Definitions for the ECDH Command

#define ECDH_PREFIX_MODE   ((uint8_t)0x00)
 
#define ECDH_COUNT   (ATCA_CMD_SIZE_MIN + ATCA_PUB_KEY_SIZE)
 
#define ECDH_MODE_SOURCE_MASK   ((uint8_t)0x01)
 
#define ECDH_MODE_SOURCE_EEPROM_SLOT   ((uint8_t)0x00)
 
#define ECDH_MODE_SOURCE_TEMPKEY   ((uint8_t)0x01)
 
#define ECDH_MODE_OUTPUT_MASK   ((uint8_t)0x02)
 
#define ECDH_MODE_OUTPUT_CLEAR   ((uint8_t)0x00)
 
#define ECDH_MODE_OUTPUT_ENC   ((uint8_t)0x02)
 
#define ECDH_MODE_COPY_MASK   ((uint8_t)0x0C)
 
#define ECDH_MODE_COPY_COMPATIBLE   ((uint8_t)0x00)
 
#define ECDH_MODE_COPY_EEPROM_SLOT   ((uint8_t)0x04)
 
#define ECDH_MODE_COPY_TEMP_KEY   ((uint8_t)0x08)
 
#define ECDH_MODE_COPY_OUTPUT_BUFFER   ((uint8_t)0x0C)
 
#define ECDH_KEY_SIZE   ATCA_BLOCK_SIZE
 ECDH output data size. More...
 
#define ECDH_RSP_SIZE   ATCA_RSP_SIZE_64
 ECDH command packet size. More...
 

Definitions for the GenDig Command

#define GENDIG_ZONE_IDX   ATCA_PARAM1_IDX
 GenDig command index for zone. More...
 
#define GENDIG_KEYID_IDX   ATCA_PARAM2_IDX
 GenDig command index for key id. More...
 
#define GENDIG_DATA_IDX   ATCA_DATA_IDX
 GenDig command index for optional data. More...
 
#define GENDIG_COUNT   ATCA_CMD_SIZE_MIN
 GenDig command packet size without "other data". More...
 
#define GENDIG_ZONE_CONFIG   ((uint8_t)0)
 GenDig zone id config. Use KeyID to specify any of the four 256-bit blocks of the Configuration zone. More...
 
#define GENDIG_ZONE_OTP   ((uint8_t)1)
 GenDig zone id OTP. Use KeyID to specify either the first or second 256-bit block of the OTP zone. More...
 
#define GENDIG_ZONE_DATA   ((uint8_t)2)
 GenDig zone id data. Use KeyID to specify a slot in the Data zone or a transport key in the hardware array. More...
 
#define GENDIG_ZONE_SHARED_NONCE   ((uint8_t)3)
 GenDig zone id shared nonce. KeyID specifies the location of the input value in the message generation. More...
 
#define GENDIG_ZONE_COUNTER   ((uint8_t)4)
 GenDig zone id counter. KeyID specifies the monotonic counter ID to be included in the message generation. More...
 
#define GENDIG_ZONE_KEY_CONFIG   ((uint8_t)5)
 GenDig zone id key config. KeyID specifies the slot for which the configuration information is to be included in the message generation. More...
 
#define GENDIG_RSP_SIZE   ATCA_RSP_SIZE_MIN
 GenDig command response packet size. More...
 

Definitions for the GenKey Command

#define GENKEY_MODE_IDX   ATCA_PARAM1_IDX
 GenKey command index for mode. More...
 
#define GENKEY_KEYID_IDX   ATCA_PARAM2_IDX
 GenKey command index for key id. More...
 
#define GENKEY_DATA_IDX   (5)
 GenKey command index for other data. More...
 
#define GENKEY_COUNT   ATCA_CMD_SIZE_MIN
 GenKey command packet size without "other data". More...
 
#define GENKEY_COUNT_DATA   (10)
 GenKey command packet size with "other data". More...
 
#define GENKEY_OTHER_DATA_SIZE   (3)
 GenKey size of "other data". More...
 
#define GENKEY_MODE_MASK   ((uint8_t)0x1C)
 GenKey mode bits 0 to 1 and 5 to 7 are 0. More...
 
#define GENKEY_MODE_PRIVATE   ((uint8_t)0x04)
 GenKey mode: private key generation. More...
 
#define GENKEY_MODE_PUBLIC   ((uint8_t)0x00)
 GenKey mode: public key calculation. More...
 
#define GENKEY_MODE_DIGEST   ((uint8_t)0x08)
 GenKey mode: PubKey digest will be created after the public key is calculated. More...
 
#define GENKEY_MODE_PUBKEY_DIGEST   ((uint8_t)0x10)
 GenKey mode: Calculate PubKey digest on the public key in KeyId. More...
 
#define GENKEY_PRIVATE_TO_TEMPKEY   ((uint16_t)0xFFFF)
 GenKey Create private key and store to tempkey (608 only) More...
 
#define GENKEY_RSP_SIZE_SHORT   ATCA_RSP_SIZE_MIN
 GenKey response packet size in Digest mode. More...
 
#define GENKEY_RSP_SIZE_LONG   ATCA_RSP_SIZE_64
 GenKey response packet size when returning a public key. More...
 

Definitions for the HMAC Command

#define HMAC_MODE_IDX   ATCA_PARAM1_IDX
 HMAC command index for mode. More...
 
#define HMAC_KEYID_IDX   ATCA_PARAM2_IDX
 HMAC command index for key id. More...
 
#define HMAC_COUNT   ATCA_CMD_SIZE_MIN
 HMAC command packet size. More...
 
#define HMAC_MODE_FLAG_TK_RAND   ((uint8_t)0x00)
 HMAC mode bit 2: The value of this bit must match the value in TempKey.SourceFlag or the command will return an error. More...
 
#define HMAC_MODE_FLAG_TK_NORAND   ((uint8_t)0x04)
 HMAC mode bit 2: The value of this bit must match the value in TempKey.SourceFlag or the command will return an error. More...
 
#define HMAC_MODE_FLAG_OTP88   ((uint8_t)0x10)
 HMAC mode bit 4: Include the first 88 OTP bits (OTP[0] through OTP[10]) in the message.; otherwise, the corresponding message bits are set to zero. Not applicable for ATECC508A. More...
 
#define HMAC_MODE_FLAG_OTP64   ((uint8_t)0x20)
 HMAC mode bit 5: Include the first 64 OTP bits (OTP[0] through OTP[7]) in the message.; otherwise, the corresponding message bits are set to zero. If Mode[4] is set, the value of this mode bit is ignored. Not applicable for ATECC508A. More...
 
#define HMAC_MODE_FLAG_FULLSN   ((uint8_t)0x40)
 HMAC mode bit 6: If set, include the 48 bits SN[2:3] and SN[4:7] in the message.; otherwise, the corresponding message bits are set to zero. More...
 
#define HMAC_MODE_MASK   ((uint8_t)0x74)
 HMAC mode bits 0, 1, 3, and 7 are 0. More...
 
#define HMAC_DIGEST_SIZE   (32)
 HMAC size of digest response. More...
 
#define HMAC_RSP_SIZE   ATCA_RSP_SIZE_32
 HMAC command response packet size. More...
 

Definitions for the Info Command

#define INFO_PARAM1_IDX   ATCA_PARAM1_IDX
 Info command index for 1. parameter. More...
 
#define INFO_PARAM2_IDX   ATCA_PARAM2_IDX
 Info command index for 2. parameter. More...
 
#define INFO_COUNT   ATCA_CMD_SIZE_MIN
 Info command packet size. More...
 
#define INFO_MODE_REVISION   ((uint8_t)0x00)
 Info mode Revision. More...
 
#define INFO_MODE_KEY_VALID   ((uint8_t)0x01)
 Info mode KeyValid. More...
 
#define INFO_MODE_STATE   ((uint8_t)0x02)
 Info mode State. More...
 
#define INFO_MODE_GPIO   ((uint8_t)0x03)
 Info mode GPIO. More...
 
#define INFO_MODE_VOL_KEY_PERMIT   ((uint8_t)0x04)
 Info mode GPIO. More...
 
#define INFO_MODE_MAX   ((uint8_t)0x03)
 Info mode maximum value. More...
 
#define INFO_NO_STATE   ((uint8_t)0x00)
 Info mode is not the state mode. More...
 
#define INFO_OUTPUT_STATE_MASK   ((uint8_t)0x01)
 Info output state mask. More...
 
#define INFO_DRIVER_STATE_MASK   ((uint8_t)0x02)
 Info driver state mask. More...
 
#define INFO_PARAM2_SET_LATCH_STATE   ((uint16_t)0x0002)
 Info param2 to set the persistent latch state. More...
 
#define INFO_PARAM2_LATCH_SET   ((uint16_t)0x0001)
 Info param2 to set the persistent latch. More...
 
#define INFO_PARAM2_LATCH_CLEAR   ((uint16_t)0x0000)
 Info param2 to clear the persistent latch. More...
 
#define INFO_SIZE   ((uint8_t)0x04)
 Info return size. More...
 
#define INFO_RSP_SIZE   ATCA_RSP_SIZE_VAL
 Info command response packet size. More...
 

Definitions for the KDF Command

#define KDF_MODE_IDX   ATCA_PARAM1_IDX
 KDF command index for mode. More...
 
#define KDF_KEYID_IDX   ATCA_PARAM2_IDX
 KDF command index for key id. More...
 
#define KDF_DETAILS_IDX   ATCA_DATA_IDX
 KDF command index for details. More...
 
#define KDF_DETAILS_SIZE   4
 KDF details (param3) size. More...
 
#define KDF_MESSAGE_IDX   (ATCA_DATA_IDX + KDF_DETAILS_SIZE)
 
#define KDF_MODE_SOURCE_MASK   ((uint8_t)0x03)
 KDF mode source key mask. More...
 
#define KDF_MODE_SOURCE_TEMPKEY   ((uint8_t)0x00)
 KDF mode source key in TempKey. More...
 
#define KDF_MODE_SOURCE_TEMPKEY_UP   ((uint8_t)0x01)
 KDF mode source key in upper TempKey. More...
 
#define KDF_MODE_SOURCE_SLOT   ((uint8_t)0x02)
 KDF mode source key in a slot. More...
 
#define KDF_MODE_SOURCE_ALTKEYBUF   ((uint8_t)0x03)
 KDF mode source key in alternate key buffer. More...
 
#define KDF_MODE_TARGET_MASK   ((uint8_t)0x1C)
 KDF mode target key mask. More...
 
#define KDF_MODE_TARGET_TEMPKEY   ((uint8_t)0x00)
 KDF mode target key in TempKey. More...
 
#define KDF_MODE_TARGET_TEMPKEY_UP   ((uint8_t)0x04)
 KDF mode target key in upper TempKey. More...
 
#define KDF_MODE_TARGET_SLOT   ((uint8_t)0x08)
 KDF mode target key in slot. More...
 
#define KDF_MODE_TARGET_ALTKEYBUF   ((uint8_t)0x0C)
 KDF mode target key in alternate key buffer. More...
 
#define KDF_MODE_TARGET_OUTPUT   ((uint8_t)0x10)
 KDF mode target key in output buffer. More...
 
#define KDF_MODE_TARGET_OUTPUT_ENC   ((uint8_t)0x14)
 KDF mode target key encrypted in output buffer. More...
 
#define KDF_MODE_ALG_MASK   ((uint8_t)0x60)
 KDF mode algorithm mask. More...
 
#define KDF_MODE_ALG_PRF   ((uint8_t)0x00)
 KDF mode PRF algorithm. More...
 
#define KDF_MODE_ALG_AES   ((uint8_t)0x20)
 KDF mode AES algorithm. More...
 
#define KDF_MODE_ALG_HKDF   ((uint8_t)0x40)
 KDF mode HKDF algorithm. More...
 
#define KDF_DETAILS_PRF_KEY_LEN_MASK   ((uint32_t)0x00000003)
 KDF details for PRF, source key length mask. More...
 
#define KDF_DETAILS_PRF_KEY_LEN_16   ((uint32_t)0x00000000)
 KDF details for PRF, source key length is 16 bytes. More...
 
#define KDF_DETAILS_PRF_KEY_LEN_32   ((uint32_t)0x00000001)
 KDF details for PRF, source key length is 32 bytes. More...
 
#define KDF_DETAILS_PRF_KEY_LEN_48   ((uint32_t)0x00000002)
 KDF details for PRF, source key length is 48 bytes. More...
 
#define KDF_DETAILS_PRF_KEY_LEN_64   ((uint32_t)0x00000003)
 KDF details for PRF, source key length is 64 bytes. More...
 
#define KDF_DETAILS_PRF_TARGET_LEN_MASK   ((uint32_t)0x00000100)
 KDF details for PRF, target length mask. More...
 
#define KDF_DETAILS_PRF_TARGET_LEN_32   ((uint32_t)0x00000000)
 KDF details for PRF, target length is 32 bytes. More...
 
#define KDF_DETAILS_PRF_TARGET_LEN_64   ((uint32_t)0x00000100)
 KDF details for PRF, target length is 64 bytes. More...
 
#define KDF_DETAILS_PRF_AEAD_MASK   ((uint32_t)0x00000600)
 KDF details for PRF, AEAD processing mask. More...
 
#define KDF_DETAILS_PRF_AEAD_MODE0   ((uint32_t)0x00000000)
 KDF details for PRF, AEAD no processing. More...
 
#define KDF_DETAILS_PRF_AEAD_MODE1   ((uint32_t)0x00000200)
 KDF details for PRF, AEAD First 32 go to target, second 32 go to output buffer. More...
 
#define KDF_DETAILS_AES_KEY_LOC_MASK   ((uint32_t)0x00000003)
 KDF details for AES, key location mask. More...
 
#define KDF_DETAILS_HKDF_MSG_LOC_MASK   ((uint32_t)0x00000003)
 KDF details for HKDF, message location mask. More...
 
#define KDF_DETAILS_HKDF_MSG_LOC_SLOT   ((uint32_t)0x00000000)
 KDF details for HKDF, message location in slot. More...
 
#define KDF_DETAILS_HKDF_MSG_LOC_TEMPKEY   ((uint32_t)0x00000001)
 KDF details for HKDF, message location in TempKey. More...
 
#define KDF_DETAILS_HKDF_MSG_LOC_INPUT   ((uint32_t)0x00000002)
 KDF details for HKDF, message location in input parameter. More...
 
#define KDF_DETAILS_HKDF_MSG_LOC_IV   ((uint32_t)0x00000003)
 KDF details for HKDF, message location is a special IV function. More...
 
#define KDF_DETAILS_HKDF_ZERO_KEY   ((uint32_t)0x00000004)
 KDF details for HKDF, key is 32 bytes of zero. More...
 

Definitions for the Lock Command

#define LOCK_ZONE_IDX   ATCA_PARAM1_IDX
 Lock command index for zone. More...
 
#define LOCK_SUMMARY_IDX   ATCA_PARAM2_IDX
 Lock command index for summary. More...
 
#define LOCK_COUNT   ATCA_CMD_SIZE_MIN
 Lock command packet size. More...
 
#define LOCK_ZONE_CONFIG   ((uint8_t)0x00)
 Lock zone is Config. More...
 
#define LOCK_ZONE_DATA   ((uint8_t)0x01)
 Lock zone is OTP or Data. More...
 
#define LOCK_ZONE_DATA_SLOT   ((uint8_t)0x02)
 Lock slot of Data. More...
 
#define LOCK_ZONE_NO_CRC   ((uint8_t)0x80)
 Lock command: Ignore summary. More...
 
#define LOCK_ZONE_MASK   (0xBF)
 Lock parameter 1 bits 6 are 0. More...
 
#define ATCA_UNLOCKED   (0x55)
 Value indicating an unlocked zone. More...
 
#define ATCA_LOCKED   (0x00)
 Value indicating a locked zone. More...
 
#define LOCK_RSP_SIZE   ATCA_RSP_SIZE_MIN
 Lock command response packet size. More...
 

Definitions for the MAC Command

#define MAC_MODE_IDX   ATCA_PARAM1_IDX
 MAC command index for mode. More...
 
#define MAC_KEYID_IDX   ATCA_PARAM2_IDX
 MAC command index for key id. More...
 
#define MAC_CHALLENGE_IDX   ATCA_DATA_IDX
 MAC command index for optional challenge. More...
 
#define MAC_COUNT_SHORT   ATCA_CMD_SIZE_MIN
 MAC command packet size without challenge. More...
 
#define MAC_COUNT_LONG   (39)
 MAC command packet size with challenge. More...
 
#define MAC_MODE_CHALLENGE   ((uint8_t)0x00)
 MAC mode 0: first SHA block from data slot. More...
 
#define MAC_MODE_BLOCK2_TEMPKEY   ((uint8_t)0x01)
 MAC mode bit 0: second SHA block from TempKey. More...
 
#define MAC_MODE_BLOCK1_TEMPKEY   ((uint8_t)0x02)
 MAC mode bit 1: first SHA block from TempKey. More...
 
#define MAC_MODE_SOURCE_FLAG_MATCH   ((uint8_t)0x04)
 MAC mode bit 2: match TempKey.SourceFlag. More...
 
#define MAC_MODE_PTNONCE_TEMPKEY   ((uint8_t)0x06)
 MAC mode bit 0: second SHA block from TempKey. More...
 
#define MAC_MODE_PASSTHROUGH   ((uint8_t)0x07)
 MAC mode bit 0-2: pass-through mode. More...
 
#define MAC_MODE_INCLUDE_OTP_88   ((uint8_t)0x10)
 MAC mode bit 4: include first 88 OTP bits. More...
 
#define MAC_MODE_INCLUDE_OTP_64   ((uint8_t)0x20)
 MAC mode bit 5: include first 64 OTP bits. More...
 
#define MAC_MODE_INCLUDE_SN   ((uint8_t)0x40)
 MAC mode bit 6: include serial number. More...
 
#define MAC_CHALLENGE_SIZE   (32)
 MAC size of challenge. More...
 
#define MAC_SIZE   (32)
 MAC size of response. More...
 
#define MAC_MODE_MASK   ((uint8_t)0x77)
 MAC mode bits 3 and 7 are 0. More...
 
#define MAC_RSP_SIZE   ATCA_RSP_SIZE_32
 MAC command response packet size. More...
 

Definitions for the Nonce Command

#define NONCE_MODE_IDX   ATCA_PARAM1_IDX
 Nonce command index for mode. More...
 
#define NONCE_PARAM2_IDX   ATCA_PARAM2_IDX
 Nonce command index for 2. parameter. More...
 
#define NONCE_INPUT_IDX   ATCA_DATA_IDX
 Nonce command index for input data. More...
 
#define NONCE_COUNT_SHORT   (ATCA_CMD_SIZE_MIN + 20)
 Nonce command packet size for 20 bytes of NumIn. More...
 
#define NONCE_COUNT_LONG   (ATCA_CMD_SIZE_MIN + 32)
 Nonce command packet size for 32 bytes of NumIn. More...
 
#define NONCE_COUNT_LONG_64   (ATCA_CMD_SIZE_MIN + 64)
 Nonce command packet size for 64 bytes of NumIn. More...
 
#define NONCE_MODE_MASK   ((uint8_t)0x03)
 Nonce mode bits 2 to 7 are 0. More...
 
#define NONCE_MODE_SEED_UPDATE   ((uint8_t)0x00)
 Nonce mode: update seed. More...
 
#define NONCE_MODE_NO_SEED_UPDATE   ((uint8_t)0x01)
 Nonce mode: do not update seed. More...
 
#define NONCE_MODE_INVALID   ((uint8_t)0x02)
 Nonce mode 2 is invalid. More...
 
#define NONCE_MODE_PASSTHROUGH   ((uint8_t)0x03)
 Nonce mode: pass-through. More...
 
#define NONCE_MODE_INPUT_LEN_MASK   ((uint8_t)0x20)
 Nonce mode: input size mask. More...
 
#define NONCE_MODE_INPUT_LEN_32   ((uint8_t)0x00)
 Nonce mode: input size is 32 bytes. More...
 
#define NONCE_MODE_INPUT_LEN_64   ((uint8_t)0x20)
 Nonce mode: input size is 64 bytes. More...
 
#define NONCE_MODE_TARGET_MASK   ((uint8_t)0xC0)
 Nonce mode: target mask. More...
 
#define NONCE_MODE_TARGET_TEMPKEY   ((uint8_t)0x00)
 Nonce mode: target is TempKey. More...
 
#define NONCE_MODE_TARGET_MSGDIGBUF   ((uint8_t)0x40)
 Nonce mode: target is Message Digest Buffer. More...
 
#define NONCE_MODE_TARGET_ALTKEYBUF   ((uint8_t)0x80)
 Nonce mode: target is Alternate Key Buffer. More...
 
#define NONCE_ZERO_CALC_MASK   ((uint16_t)0x8000)
 Nonce zero (param2): calculation mode mask. More...
 
#define NONCE_ZERO_CALC_RANDOM   ((uint16_t)0x0000)
 Nonce zero (param2): calculation mode random, use RNG in calculation and return RNG output. More...
 
#define NONCE_ZERO_CALC_TEMPKEY   ((uint16_t)0x8000)
 Nonce zero (param2): calculation mode TempKey, use TempKey in calculation and return new TempKey value. More...
 
#define NONCE_NUMIN_SIZE   (20)
 Nonce NumIn size for random modes. More...
 
#define NONCE_NUMIN_SIZE_PASSTHROUGH   (32)
 Nonce NumIn size for 32-byte pass-through mode. More...
 
#define NONCE_RSP_SIZE_SHORT   ATCA_RSP_SIZE_MIN
 Nonce command response packet size with no output. More...
 
#define NONCE_RSP_SIZE_LONG   ATCA_RSP_SIZE_32
 Nonce command response packet size with output. More...
 

Definitions for the Pause Command

#define PAUSE_SELECT_IDX   ATCA_PARAM1_IDX
 Pause command index for Selector. More...
 
#define PAUSE_PARAM2_IDX   ATCA_PARAM2_IDX
 Pause command index for 2. parameter. More...
 
#define PAUSE_COUNT   ATCA_CMD_SIZE_MIN
 Pause command packet size. More...
 
#define PAUSE_RSP_SIZE   ATCA_RSP_SIZE_MIN
 Pause command response packet size. More...
 

Definitions for the PrivWrite Command

#define PRIVWRITE_ZONE_IDX   ATCA_PARAM1_IDX
 PrivWrite command index for zone. More...
 
#define PRIVWRITE_KEYID_IDX   ATCA_PARAM2_IDX
 PrivWrite command index for KeyID. More...
 
#define PRIVWRITE_VALUE_IDX   ( 5)
 PrivWrite command index for value. More...
 
#define PRIVWRITE_MAC_IDX   (41)
 PrivWrite command index for MAC. More...
 
#define PRIVWRITE_COUNT   (75)
 PrivWrite command packet size. More...
 
#define PRIVWRITE_ZONE_MASK   ((uint8_t)0x40)
 PrivWrite zone bits 0 to 5 and 7 are 0. More...
 
#define PRIVWRITE_MODE_ENCRYPT   ((uint8_t)0x40)
 PrivWrite mode: encrypted. More...
 
#define PRIVWRITE_RSP_SIZE   ATCA_RSP_SIZE_MIN
 PrivWrite command response packet size. More...
 

Definitions for the Random Command

#define RANDOM_MODE_IDX   ATCA_PARAM1_IDX
 Random command index for mode. More...
 
#define RANDOM_PARAM2_IDX   ATCA_PARAM2_IDX
 Random command index for 2. parameter. More...
 
#define RANDOM_COUNT   ATCA_CMD_SIZE_MIN
 Random command packet size. More...
 
#define RANDOM_SEED_UPDATE   ((uint8_t)0x00)
 Random mode for automatic seed update. More...
 
#define RANDOM_NO_SEED_UPDATE   ((uint8_t)0x01)
 Random mode for no seed update. More...
 
#define RANDOM_NUM_SIZE   ((uint8_t)32)
 Number of bytes in the data packet of a random command. More...
 
#define RANDOM_RSP_SIZE   ATCA_RSP_SIZE_32
 Random command response packet size. More...
 

Definitions for the Read Command

#define READ_ZONE_IDX   ATCA_PARAM1_IDX
 Read command index for zone. More...
 
#define READ_ADDR_IDX   ATCA_PARAM2_IDX
 Read command index for address. More...
 
#define READ_COUNT   ATCA_CMD_SIZE_MIN
 Read command packet size. More...
 
#define READ_ZONE_MASK   ((uint8_t)0x83)
 Read zone bits 2 to 6 are 0. More...
 
#define READ_4_RSP_SIZE   ATCA_RSP_SIZE_VAL
 Read command response packet size when reading 4 bytes. More...
 
#define READ_32_RSP_SIZE   ATCA_RSP_SIZE_32
 Read command response packet size when reading 32 bytes. More...
 

Definitions for the SecureBoot Command

#define SECUREBOOT_MODE_IDX   ATCA_PARAM1_IDX
 SecureBoot command index for mode. More...
 
#define SECUREBOOT_DIGEST_SIZE   (32)
 SecureBoot digest input size. More...
 
#define SECUREBOOT_SIGNATURE_SIZE   (64)
 SecureBoot signature input size. More...
 
#define SECUREBOOT_COUNT_DIG   (ATCA_CMD_SIZE_MIN + SECUREBOOT_DIGEST_SIZE)
 SecureBoot command packet size for just a digest. More...
 
#define SECUREBOOT_COUNT_DIG_SIG   (ATCA_CMD_SIZE_MIN + SECUREBOOT_DIGEST_SIZE + SECUREBOOT_SIGNATURE_SIZE)
 SecureBoot command packet size for a digest and signature. More...
 
#define SECUREBOOT_MAC_SIZE   (32)
 SecureBoot MAC output size. More...
 
#define SECUREBOOT_RSP_SIZE_NO_MAC   ATCA_RSP_SIZE_MIN
 SecureBoot response packet size for no MAC. More...
 
#define SECUREBOOT_RSP_SIZE_MAC   (ATCA_PACKET_OVERHEAD + SECUREBOOT_MAC_SIZE)
 SecureBoot response packet size with MAC. More...
 
#define SECUREBOOT_MODE_MASK   ((uint8_t)0x07)
 SecureBoot mode mask. More...
 
#define SECUREBOOT_MODE_FULL   ((uint8_t)0x05)
 SecureBoot mode Full. More...
 
#define SECUREBOOT_MODE_FULL_STORE   ((uint8_t)0x06)
 SecureBoot mode FullStore. More...
 
#define SECUREBOOT_MODE_FULL_COPY   ((uint8_t)0x07)
 SecureBoot mode FullCopy. More...
 
#define SECUREBOOT_MODE_PROHIBIT_FLAG   ((uint8_t)0x40)
 SecureBoot mode flag to prohibit SecureBoot until next power cycle. More...
 
#define SECUREBOOT_MODE_ENC_MAC_FLAG   ((uint8_t)0x80)
 SecureBoot mode flag for encrypted digest and returning validating MAC. More...
 
#define SECUREBOOTCONFIG_OFFSET   (70)
 SecureBootConfig byte offset into the configuration zone. More...
 
#define SECUREBOOTCONFIG_MODE_MASK   ((uint16_t)0x0003)
 Mask for SecureBootMode field in SecureBootConfig value. More...
 
#define SECUREBOOTCONFIG_MODE_DISABLED   ((uint16_t)0x0000)
 Disabled SecureBootMode in SecureBootConfig value. More...
 
#define SECUREBOOTCONFIG_MODE_FULL_BOTH   ((uint16_t)0x0001)
 Both digest and signature always required SecureBootMode in SecureBootConfig value. More...
 
#define SECUREBOOTCONFIG_MODE_FULL_SIG   ((uint16_t)0x0002)
 Signature stored SecureBootMode in SecureBootConfig value. More...
 
#define SECUREBOOTCONFIG_MODE_FULL_DIG   ((uint16_t)0x0003)
 Digest stored SecureBootMode in SecureBootConfig value. More...
 

Definitions for the SelfTest Command

#define SELFTEST_MODE_IDX   ATCA_PARAM1_IDX
 SelfTest command index for mode. More...
 
#define SELFTEST_COUNT   ATCA_CMD_SIZE_MIN
 SelfTest command packet size. More...
 
#define SELFTEST_MODE_RNG   ((uint8_t)0x01)
 SelfTest mode RNG DRBG function. More...
 
#define SELFTEST_MODE_ECDSA_SIGN_VERIFY   ((uint8_t)0x02)
 SelfTest mode ECDSA verify function. More...
 
#define SELFTEST_MODE_ECDH   ((uint8_t)0x08)
 SelfTest mode ECDH function. More...
 
#define SELFTEST_MODE_AES   ((uint8_t)0x10)
 SelfTest mode AES encrypt function. More...
 
#define SELFTEST_MODE_SHA   ((uint8_t)0x20)
 SelfTest mode SHA function. More...
 
#define SELFTEST_MODE_ALL   ((uint8_t)0x3B)
 SelfTest mode all algorithms. More...
 
#define SELFTEST_RSP_SIZE   ATCA_RSP_SIZE_MIN
 SelfTest command response packet size. More...
 

Definitions for the SHA Command

#define SHA_COUNT_SHORT   ATCA_CMD_SIZE_MIN
 
#define SHA_COUNT_LONG   ATCA_CMD_SIZE_MIN
 Just a starting size. More...
 
#define ATCA_SHA_DIGEST_SIZE   (32)
 
#define SHA_DATA_MAX   (64)
 
#define ATCA_SHA256_BLOCK_SIZE   (64)
 
#define SHA_CONTEXT_MAX_SIZE   (99)
 
#define SHA_MODE_MASK   ((uint8_t)0x07)
 Mask the bit 0-2. More...
 
#define SHA_MODE_SHA256_START   ((uint8_t)0x00)
 Initialization, does not accept a message. More...
 
#define SHA_MODE_SHA256_UPDATE   ((uint8_t)0x01)
 Add 64 bytes in the meesage to the SHA context. More...
 
#define SHA_MODE_SHA256_END   ((uint8_t)0x02)
 Complete the calculation and return the digest. More...
 
#define SHA_MODE_SHA256_PUBLIC   ((uint8_t)0x03)
 Add 64 byte ECC public key in the slot to the SHA context. More...
 
#define SHA_MODE_HMAC_START   ((uint8_t)0x04)
 Initialization, HMAC calculation. More...
 
#define SHA_MODE_HMAC_UPDATE   ((uint8_t)0x01)
 Add 64 bytes in the meesage to the SHA context. More...
 
#define SHA_MODE_HMAC_END   ((uint8_t)0x05)
 Complete the HMAC computation and return digest. More...
 
#define SHA_MODE_608_HMAC_END   ((uint8_t)0x02)
 Complete the HMAC computation and return digest... Different command on 608. More...
 
#define SHA_MODE_READ_CONTEXT   ((uint8_t)0x06)
 Read current SHA-256 context out of the device. More...
 
#define SHA_MODE_WRITE_CONTEXT   ((uint8_t)0x07)
 Restore a SHA-256 context into the device. More...
 
#define SHA_MODE_TARGET_MASK   ((uint8_t)0xC0)
 Resulting digest target location mask. More...
 
#define SHA_MODE_TARGET_TEMPKEY   ((uint8_t)0x00)
 Place resulting digest both in Output buffer and TempKey. More...
 
#define SHA_MODE_TARGET_MSGDIGBUF   ((uint8_t)0x40)
 Place resulting digest both in Output buffer and Message Digest Buffer. More...
 
#define SHA_MODE_TARGET_OUT_ONLY   ((uint8_t)0xC0)
 Place resulting digest both in Output buffer ONLY. More...
 
#define SHA_RSP_SIZE   ATCA_RSP_SIZE_32
 SHA command response packet size. More...
 
#define SHA_RSP_SIZE_SHORT   ATCA_RSP_SIZE_MIN
 SHA command response packet size only status code. More...
 
#define SHA_RSP_SIZE_LONG   ATCA_RSP_SIZE_32
 SHA command response packet size. More...
 

Detailed Description

CryptoAuthLib command builder object, ATCACommand. Member functions for the ATCACommand object.

Macro Definition Documentation

◆ AES_COUNT

#define AES_COUNT   (23)

AES command packet size.

◆ AES_DATA_SIZE

#define AES_DATA_SIZE   (16)

size of AES encrypt/decrypt data

◆ AES_INPUT_IDX

#define AES_INPUT_IDX   ATCA_DATA_IDX

AES command index for input data.

◆ AES_KEYID_IDX

#define AES_KEYID_IDX   ATCA_PARAM2_IDX

AES command index for key id.

◆ AES_MODE_DECRYPT

#define AES_MODE_DECRYPT   ((uint8_t)0x01)

AES mode: Decrypt.

◆ AES_MODE_ENCRYPT

#define AES_MODE_ENCRYPT   ((uint8_t)0x00)

AES mode: Encrypt.

◆ AES_MODE_GFM

#define AES_MODE_GFM   ((uint8_t)0x03)

AES mode: GFM calculation.

◆ AES_MODE_IDX

#define AES_MODE_IDX   ATCA_PARAM1_IDX

AES command index for mode.

◆ AES_MODE_KEY_BLOCK_MASK

#define AES_MODE_KEY_BLOCK_MASK   ((uint8_t)0xC0)

AES mode mask for key block field.

◆ AES_MODE_KEY_BLOCK_POS

#define AES_MODE_KEY_BLOCK_POS   (6)

Bit shift for key block in mode.

◆ AES_MODE_MASK

#define AES_MODE_MASK   ((uint8_t)0xC7)

AES mode bits 3 to 5 are 0.

◆ AES_MODE_OP_MASK

#define AES_MODE_OP_MASK   ((uint8_t)0x07)

AES mode operation mask.

◆ AES_RSP_SIZE

#define AES_RSP_SIZE   ATCA_RSP_SIZE_16

AES command response packet size.

◆ ATCA_ADDRESS_MASK

#define ATCA_ADDRESS_MASK   (0x007F)

Address bit 7 to 15 are always 0.

◆ ATCA_ADDRESS_MASK_CONFIG

#define ATCA_ADDRESS_MASK_CONFIG   (0x001F)

Address bits 5 to 7 are 0 for Configuration zone.

◆ ATCA_ADDRESS_MASK_OTP

#define ATCA_ADDRESS_MASK_OTP   (0x000F)

Address bits 4 to 7 are 0 for OTP zone.

◆ ATCA_AES

#define ATCA_AES   ((uint8_t)0x51)

AES command op-code.

◆ ATCA_AES_GFM_SIZE

#define ATCA_AES_GFM_SIZE   ATCA_BLOCK_SIZE

size of GFM data

◆ ATCA_AES_KEY_TYPE

#define ATCA_AES_KEY_TYPE   6

AES-128 Key.

◆ ATCA_B283_KEY_TYPE

#define ATCA_B283_KEY_TYPE   0

B283 NIST ECC key.

◆ ATCA_BLOCK_SIZE

#define ATCA_BLOCK_SIZE   (32)

size of a block

◆ ATCA_CHECKMAC

#define ATCA_CHECKMAC   ((uint8_t)0x28)

CheckMac command op-code.

◆ ATCA_CHIPMODE_CLOCK_DIV_M0

#define ATCA_CHIPMODE_CLOCK_DIV_M0   ((uint8_t)0x00)

ChipMode clock divider M0.

◆ ATCA_CHIPMODE_CLOCK_DIV_M1

#define ATCA_CHIPMODE_CLOCK_DIV_M1   ((uint8_t)0x28)

ChipMode clock divider M1.

◆ ATCA_CHIPMODE_CLOCK_DIV_M2

#define ATCA_CHIPMODE_CLOCK_DIV_M2   ((uint8_t)0x68)

ChipMode clock divider M2.

◆ ATCA_CHIPMODE_CLOCK_DIV_MASK

#define ATCA_CHIPMODE_CLOCK_DIV_MASK   ((uint8_t)0xF8)

ChipMode clock divider mask.

◆ ATCA_CHIPMODE_I2C_ADDRESS_FLAG

#define ATCA_CHIPMODE_I2C_ADDRESS_FLAG   ((uint8_t)0x01)

ChipMode I2C Address in UserExtraAdd flag.

◆ ATCA_CHIPMODE_OFFSET

#define ATCA_CHIPMODE_OFFSET   (19)

ChipMode byte offset within the configuration zone.

◆ ATCA_CHIPMODE_TTL_ENABLE_FLAG

#define ATCA_CHIPMODE_TTL_ENABLE_FLAG   ((uint8_t)0x02)

ChipMode TTLenable flag.

◆ ATCA_CHIPMODE_WATCHDOG_LONG

#define ATCA_CHIPMODE_WATCHDOG_LONG   ((uint8_t)0x04)

ChipMode long watchdog (~13s)

◆ ATCA_CHIPMODE_WATCHDOG_MASK

#define ATCA_CHIPMODE_WATCHDOG_MASK   ((uint8_t)0x04)

ChipMode watchdog duration mask.

◆ ATCA_CHIPMODE_WATCHDOG_SHORT

#define ATCA_CHIPMODE_WATCHDOG_SHORT   ((uint8_t)0x00)

ChipMode short watchdog (~1.3s)

◆ ATCA_CMD_SIZE_MAX

#define ATCA_CMD_SIZE_MAX   ((uint8_t)4 * 36 + 7)

maximum size of command packet (Verify)

◆ ATCA_CMD_SIZE_MIN

#define ATCA_CMD_SIZE_MIN   ((uint8_t)7)

minimum number of bytes in command (from count byte to second CRC byte)

◆ ATCA_COUNT_IDX

#define ATCA_COUNT_IDX   (0)

command packet index for count

◆ ATCA_COUNT_SIZE

#define ATCA_COUNT_SIZE   ((uint8_t)1)

Number of bytes in the command packet Count.

◆ ATCA_COUNTER

#define ATCA_COUNTER   ((uint8_t)0x24)

Counter command op-code.

◆ ATCA_CRC_SIZE

#define ATCA_CRC_SIZE   ((uint8_t)2)

Number of bytes in the command packet CRC.

◆ ATCA_DATA_IDX

#define ATCA_DATA_IDX   (5)

command packet index for data load

◆ ATCA_DATA_SIZE

#define ATCA_DATA_SIZE   (ATCA_KEY_COUNT * ATCA_KEY_SIZE)

size of data zone

◆ ATCA_DERIVE_KEY

#define ATCA_DERIVE_KEY   ((uint8_t)0x1C)

DeriveKey command op-code.

◆ ATCA_ECC_CONFIG_SIZE

#define ATCA_ECC_CONFIG_SIZE   (128)

size of configuration zone

◆ ATCA_ECDH

#define ATCA_ECDH   ((uint8_t)0x43)

ECDH command op-code.

◆ ATCA_GENDIG

#define ATCA_GENDIG   ((uint8_t)0x15)

GenDig command op-code.

◆ ATCA_GENKEY

#define ATCA_GENKEY   ((uint8_t)0x40)

GenKey command op-code.

◆ ATCA_HMAC

#define ATCA_HMAC   ((uint8_t)0x11)

HMAC command op-code.

◆ ATCA_INFO

#define ATCA_INFO   ((uint8_t)0x30)

Info command op-code.

◆ ATCA_K283_KEY_TYPE

#define ATCA_K283_KEY_TYPE   1

K283 NIST ECC key.

◆ ATCA_KDF

#define ATCA_KDF   ((uint8_t)0x56)

KDF command op-code.

◆ ATCA_KEY_COUNT

#define ATCA_KEY_COUNT   (16)

number of keys

◆ ATCA_KEY_ID_MAX

#define ATCA_KEY_ID_MAX   ((uint8_t)15)

maximum value for key id

◆ ATCA_KEY_SIZE

#define ATCA_KEY_SIZE   (32)

size of a symmetric SHA key

◆ ATCA_LOCK

#define ATCA_LOCK   ((uint8_t)0x17)

Lock command op-code.

◆ ATCA_LOCKED

#define ATCA_LOCKED   (0x00)

Value indicating a locked zone.

◆ ATCA_MAC

#define ATCA_MAC   ((uint8_t)0x08)

MAC command op-code.

◆ ATCA_NONCE

#define ATCA_NONCE   ((uint8_t)0x16)

Nonce command op-code.

◆ ATCA_OPCODE_IDX

#define ATCA_OPCODE_IDX   (1)

command packet index for op-code

◆ ATCA_OTP_BLOCK_MAX

#define ATCA_OTP_BLOCK_MAX   ((uint8_t)1)

maximum value for OTP block

◆ ATCA_OTP_SIZE

#define ATCA_OTP_SIZE   (64)

size of OTP zone

◆ ATCA_P256_KEY_TYPE

#define ATCA_P256_KEY_TYPE   4

P256 NIST ECC key.

◆ ATCA_PACKET_OVERHEAD

#define ATCA_PACKET_OVERHEAD   (ATCA_COUNT_SIZE + ATCA_CRC_SIZE)

Number of bytes in the command packet.

◆ ATCA_PARAM1_IDX

#define ATCA_PARAM1_IDX   (2)

command packet index for first parameter

◆ ATCA_PARAM2_IDX

#define ATCA_PARAM2_IDX   (3)

command packet index for second parameter

◆ ATCA_PAUSE

#define ATCA_PAUSE   ((uint8_t)0x01)

Pause command op-code.

◆ ATCA_PRIV_KEY_SIZE

#define ATCA_PRIV_KEY_SIZE   (32)

size of a p256 private key

◆ ATCA_PRIVWRITE

#define ATCA_PRIVWRITE   ((uint8_t)0x46)

PrivWrite command op-code.

◆ ATCA_PUB_KEY_PAD

#define ATCA_PUB_KEY_PAD   (4)

size of the public key pad

◆ ATCA_PUB_KEY_SIZE

#define ATCA_PUB_KEY_SIZE   (64)

size of a p256 public key

◆ ATCA_RANDOM

#define ATCA_RANDOM   ((uint8_t)0x1B)

Random command op-code.

◆ ATCA_READ

#define ATCA_READ   ((uint8_t)0x02)

Read command op-code.

◆ ATCA_RSP_DATA_IDX

#define ATCA_RSP_DATA_IDX   (1)

buffer index of data in response

◆ ATCA_RSP_SIZE_16

#define ATCA_RSP_SIZE_16   ((uint8_t)19)

size of response packet containing 16 bytes data

◆ ATCA_RSP_SIZE_32

#define ATCA_RSP_SIZE_32   ((uint8_t)35)

size of response packet containing 32 bytes data

◆ ATCA_RSP_SIZE_4

#define ATCA_RSP_SIZE_4   ((uint8_t)7)

size of response packet containing 4 bytes data

◆ ATCA_RSP_SIZE_64

#define ATCA_RSP_SIZE_64   ((uint8_t)67)

size of response packet containing 64 bytes data

◆ ATCA_RSP_SIZE_72

#define ATCA_RSP_SIZE_72   ((uint8_t)75)

size of response packet containing 64 bytes data

◆ ATCA_RSP_SIZE_MAX

#define ATCA_RSP_SIZE_MAX   ((uint8_t)75)

maximum size of response packet (GenKey and Verify command)

◆ ATCA_RSP_SIZE_MIN

#define ATCA_RSP_SIZE_MIN   ((uint8_t)4)

minimum number of bytes in response

◆ ATCA_RSP_SIZE_VAL

#define ATCA_RSP_SIZE_VAL   ((uint8_t)7)

size of response packet containing four bytes of data

◆ ATCA_SECUREBOOT

#define ATCA_SECUREBOOT   ((uint8_t)0x80)

Secure Boot command op-code.

◆ ATCA_SELFTEST

#define ATCA_SELFTEST   ((uint8_t)0x77)

Self test command op-code.

◆ ATCA_SERIAL_NUM_SIZE

#define ATCA_SERIAL_NUM_SIZE   (9)

number of bytes in the device serial number

◆ ATCA_SHA

#define ATCA_SHA   ((uint8_t)0x47)

SHA command op-code.

◆ ATCA_SHA256_BLOCK_SIZE

#define ATCA_SHA256_BLOCK_SIZE   (64)

◆ ATCA_SHA_CONFIG_SIZE

#define ATCA_SHA_CONFIG_SIZE   (88)

size of configuration zone

◆ ATCA_SHA_DIGEST_SIZE

#define ATCA_SHA_DIGEST_SIZE   (32)

◆ ATCA_SHA_KEY_TYPE

#define ATCA_SHA_KEY_TYPE   7

SHA key or other data.

◆ ATCA_SIG_SIZE

#define ATCA_SIG_SIZE   (64)

size of a p256 signature

◆ ATCA_SIGN

#define ATCA_SIGN   ((uint8_t)0x41)

Sign command op-code.

◆ ATCA_TEMPKEY_KEYID

#define ATCA_TEMPKEY_KEYID   (0xFFFF)

KeyID when referencing TempKey.

◆ ATCA_UNLOCKED

#define ATCA_UNLOCKED   (0x55)

Value indicating an unlocked zone.

◆ ATCA_UPDATE_EXTRA

#define ATCA_UPDATE_EXTRA   ((uint8_t)0x20)

UpdateExtra command op-code.

◆ ATCA_VERIFY

#define ATCA_VERIFY   ((uint8_t)0x45)

GenKey command op-code.

◆ ATCA_WORD_SIZE

#define ATCA_WORD_SIZE   (4)

size of a word

◆ ATCA_WRITE

#define ATCA_WRITE   ((uint8_t)0x12)

Write command op-code.

◆ ATCA_ZONE_CONFIG

#define ATCA_ZONE_CONFIG   ((uint8_t)0x00)

Configuration zone.

◆ ATCA_ZONE_DATA

#define ATCA_ZONE_DATA   ((uint8_t)0x02)

Data zone.

◆ ATCA_ZONE_ENCRYPTED

#define ATCA_ZONE_ENCRYPTED   ((uint8_t)0x40)

Zone bit 6 set: Write is encrypted with an unlocked data zone.

◆ ATCA_ZONE_MASK

#define ATCA_ZONE_MASK   ((uint8_t)0x03)

Zone mask.

◆ ATCA_ZONE_OTP

#define ATCA_ZONE_OTP   ((uint8_t)0x01)

OTP (One Time Programming) zone.

◆ ATCA_ZONE_READWRITE_32

#define ATCA_ZONE_READWRITE_32   ((uint8_t)0x80)

Zone bit 7 set: Access 32 bytes, otherwise 4 bytes.

◆ CHECKMAC_CLIENT_CHALLENGE_IDX

#define CHECKMAC_CLIENT_CHALLENGE_IDX   ATCA_DATA_IDX

CheckMAC command index for client challenge.

◆ CHECKMAC_CLIENT_CHALLENGE_SIZE

#define CHECKMAC_CLIENT_CHALLENGE_SIZE   (32)

CheckMAC size of client challenge.

◆ CHECKMAC_CLIENT_COMMAND_SIZE

#define CHECKMAC_CLIENT_COMMAND_SIZE   (4)

CheckMAC size of client command header size inside "other data".

◆ CHECKMAC_CLIENT_RESPONSE_IDX

#define CHECKMAC_CLIENT_RESPONSE_IDX   (37)

CheckMAC command index for client response.

◆ CHECKMAC_CLIENT_RESPONSE_SIZE

#define CHECKMAC_CLIENT_RESPONSE_SIZE   (32)

CheckMAC size of client response.

◆ CHECKMAC_CMD_MATCH

#define CHECKMAC_CMD_MATCH   (0)

CheckMAC return value when there is a match.

◆ CHECKMAC_CMD_MISMATCH

#define CHECKMAC_CMD_MISMATCH   (1)

CheckMAC return value when there is a mismatch.

◆ CHECKMAC_COUNT

#define CHECKMAC_COUNT   (84)

CheckMAC command packet size.

◆ CHECKMAC_DATA_IDX

#define CHECKMAC_DATA_IDX   (69)

CheckMAC command index for other data.

◆ CHECKMAC_KEYID_IDX

#define CHECKMAC_KEYID_IDX   ATCA_PARAM2_IDX

CheckMAC command index for key identifier.

◆ CHECKMAC_MODE_BLOCK1_TEMPKEY

#define CHECKMAC_MODE_BLOCK1_TEMPKEY   ((uint8_t)0x02)

CheckMAC mode bit 1: first SHA block from TempKey.

◆ CHECKMAC_MODE_BLOCK2_TEMPKEY

#define CHECKMAC_MODE_BLOCK2_TEMPKEY   ((uint8_t)0x01)

CheckMAC mode bit 0: second SHA block from TempKey.

◆ CHECKMAC_MODE_CHALLENGE

#define CHECKMAC_MODE_CHALLENGE   ((uint8_t)0x00)

CheckMAC mode 0: first SHA block from key id.

◆ CHECKMAC_MODE_IDX

#define CHECKMAC_MODE_IDX   ATCA_PARAM1_IDX

CheckMAC command index for mode.

◆ CHECKMAC_MODE_INCLUDE_OTP_64

#define CHECKMAC_MODE_INCLUDE_OTP_64   ((uint8_t)0x20)

CheckMAC mode bit 5: include first 64 OTP bits.

◆ CHECKMAC_MODE_MASK

#define CHECKMAC_MODE_MASK   ((uint8_t)0x27)

CheckMAC mode bits 3, 4, 6, and 7 are 0.

◆ CHECKMAC_MODE_SOURCE_FLAG_MATCH

#define CHECKMAC_MODE_SOURCE_FLAG_MATCH   ((uint8_t)0x04)

CheckMAC mode bit 2: match TempKey.SourceFlag.

◆ CHECKMAC_OTHER_DATA_SIZE

#define CHECKMAC_OTHER_DATA_SIZE   (13)

CheckMAC size of "other data".

◆ CHECKMAC_RSP_SIZE

#define CHECKMAC_RSP_SIZE   ATCA_RSP_SIZE_MIN

CheckMAC response packet size.

◆ CMD_STATUS_BYTE_COMM

#define CMD_STATUS_BYTE_COMM   ((uint8_t)0xFF)

communication error

◆ CMD_STATUS_BYTE_ECC

#define CMD_STATUS_BYTE_ECC   ((uint8_t)0x05)

command ECC error

◆ CMD_STATUS_BYTE_EXEC

#define CMD_STATUS_BYTE_EXEC   ((uint8_t)0x0F)

command execution error

◆ CMD_STATUS_BYTE_PARSE

#define CMD_STATUS_BYTE_PARSE   ((uint8_t)0x03)

command parse error

◆ CMD_STATUS_SUCCESS

#define CMD_STATUS_SUCCESS   ((uint8_t)0x00)

status byte for success

◆ CMD_STATUS_WAKEUP

#define CMD_STATUS_WAKEUP   ((uint8_t)0x11)

status byte after wake-up

◆ COUNTER_COUNT

#define COUNTER_COUNT   ATCA_CMD_SIZE_MIN

◆ COUNTER_KEYID_IDX

#define COUNTER_KEYID_IDX   ATCA_PARAM2_IDX

Counter command index for key id.

◆ COUNTER_MAX_VALUE

#define COUNTER_MAX_VALUE   ((uint32_t)2097151)

Counter maximum value of the counter.

◆ COUNTER_MODE_IDX

#define COUNTER_MODE_IDX   ATCA_PARAM1_IDX

Counter command index for mode.

◆ COUNTER_MODE_INCREMENT

#define COUNTER_MODE_INCREMENT   ((uint8_t)0x01)

Counter command mode for incrementing.

◆ COUNTER_MODE_MASK

#define COUNTER_MODE_MASK   ((uint8_t)0x01)

Counter mode bits 1 to 7 are 0.

◆ COUNTER_MODE_READ

#define COUNTER_MODE_READ   ((uint8_t)0x00)

Counter command mode for reading.

◆ COUNTER_RSP_SIZE

#define COUNTER_RSP_SIZE   ATCA_RSP_SIZE_4

Counter command response packet size.

◆ DERIVE_KEY_COUNT_LARGE

#define DERIVE_KEY_COUNT_LARGE   (39)

DeriveKey command packet size with MAC.

◆ DERIVE_KEY_COUNT_SMALL

#define DERIVE_KEY_COUNT_SMALL   ATCA_CMD_SIZE_MIN

DeriveKey command packet size without MAC.

◆ DERIVE_KEY_MAC_IDX

#define DERIVE_KEY_MAC_IDX   ATCA_DATA_IDX

DeriveKey command index for optional MAC.

◆ DERIVE_KEY_MAC_SIZE

#define DERIVE_KEY_MAC_SIZE   (32)

DeriveKey MAC size.

◆ DERIVE_KEY_MODE

#define DERIVE_KEY_MODE   ((uint8_t)0x04)

DeriveKey command mode set to 4 as in datasheet.

◆ DERIVE_KEY_RANDOM_FLAG

#define DERIVE_KEY_RANDOM_FLAG   ((uint8_t)4)

DeriveKey 1. parameter; has to match TempKey.SourceFlag.

◆ DERIVE_KEY_RANDOM_IDX

#define DERIVE_KEY_RANDOM_IDX   ATCA_PARAM1_IDX

DeriveKey command index for random bit.

◆ DERIVE_KEY_RSP_SIZE

#define DERIVE_KEY_RSP_SIZE   ATCA_RSP_SIZE_MIN

DeriveKey response packet size.

◆ DERIVE_KEY_TARGETKEY_IDX

#define DERIVE_KEY_TARGETKEY_IDX   ATCA_PARAM2_IDX

DeriveKey command index for target slot.

◆ ECDH_COUNT

#define ECDH_COUNT   (ATCA_CMD_SIZE_MIN + ATCA_PUB_KEY_SIZE)

◆ ECDH_KEY_SIZE

#define ECDH_KEY_SIZE   ATCA_BLOCK_SIZE

ECDH output data size.

◆ ECDH_MODE_COPY_COMPATIBLE

#define ECDH_MODE_COPY_COMPATIBLE   ((uint8_t)0x00)

◆ ECDH_MODE_COPY_EEPROM_SLOT

#define ECDH_MODE_COPY_EEPROM_SLOT   ((uint8_t)0x04)

◆ ECDH_MODE_COPY_MASK

#define ECDH_MODE_COPY_MASK   ((uint8_t)0x0C)

◆ ECDH_MODE_COPY_OUTPUT_BUFFER

#define ECDH_MODE_COPY_OUTPUT_BUFFER   ((uint8_t)0x0C)

◆ ECDH_MODE_COPY_TEMP_KEY

#define ECDH_MODE_COPY_TEMP_KEY   ((uint8_t)0x08)

◆ ECDH_MODE_OUTPUT_CLEAR

#define ECDH_MODE_OUTPUT_CLEAR   ((uint8_t)0x00)

◆ ECDH_MODE_OUTPUT_ENC

#define ECDH_MODE_OUTPUT_ENC   ((uint8_t)0x02)

◆ ECDH_MODE_OUTPUT_MASK

#define ECDH_MODE_OUTPUT_MASK   ((uint8_t)0x02)

◆ ECDH_MODE_SOURCE_EEPROM_SLOT

#define ECDH_MODE_SOURCE_EEPROM_SLOT   ((uint8_t)0x00)

◆ ECDH_MODE_SOURCE_MASK

#define ECDH_MODE_SOURCE_MASK   ((uint8_t)0x01)

◆ ECDH_MODE_SOURCE_TEMPKEY

#define ECDH_MODE_SOURCE_TEMPKEY   ((uint8_t)0x01)

◆ ECDH_PREFIX_MODE

#define ECDH_PREFIX_MODE   ((uint8_t)0x00)

◆ ECDH_RSP_SIZE

#define ECDH_RSP_SIZE   ATCA_RSP_SIZE_64

ECDH command packet size.

◆ GENDIG_COUNT

#define GENDIG_COUNT   ATCA_CMD_SIZE_MIN

GenDig command packet size without "other data".

◆ GENDIG_DATA_IDX

#define GENDIG_DATA_IDX   ATCA_DATA_IDX

GenDig command index for optional data.

◆ GENDIG_KEYID_IDX

#define GENDIG_KEYID_IDX   ATCA_PARAM2_IDX

GenDig command index for key id.

◆ GENDIG_RSP_SIZE

#define GENDIG_RSP_SIZE   ATCA_RSP_SIZE_MIN

GenDig command response packet size.

◆ GENDIG_ZONE_CONFIG

#define GENDIG_ZONE_CONFIG   ((uint8_t)0)

GenDig zone id config. Use KeyID to specify any of the four 256-bit blocks of the Configuration zone.

◆ GENDIG_ZONE_COUNTER

#define GENDIG_ZONE_COUNTER   ((uint8_t)4)

GenDig zone id counter. KeyID specifies the monotonic counter ID to be included in the message generation.

◆ GENDIG_ZONE_DATA

#define GENDIG_ZONE_DATA   ((uint8_t)2)

GenDig zone id data. Use KeyID to specify a slot in the Data zone or a transport key in the hardware array.

◆ GENDIG_ZONE_IDX

#define GENDIG_ZONE_IDX   ATCA_PARAM1_IDX

GenDig command index for zone.

◆ GENDIG_ZONE_KEY_CONFIG

#define GENDIG_ZONE_KEY_CONFIG   ((uint8_t)5)

GenDig zone id key config. KeyID specifies the slot for which the configuration information is to be included in the message generation.

◆ GENDIG_ZONE_OTP

#define GENDIG_ZONE_OTP   ((uint8_t)1)

GenDig zone id OTP. Use KeyID to specify either the first or second 256-bit block of the OTP zone.

◆ GENDIG_ZONE_SHARED_NONCE

#define GENDIG_ZONE_SHARED_NONCE   ((uint8_t)3)

GenDig zone id shared nonce. KeyID specifies the location of the input value in the message generation.

◆ GENKEY_COUNT

#define GENKEY_COUNT   ATCA_CMD_SIZE_MIN

GenKey command packet size without "other data".

◆ GENKEY_COUNT_DATA

#define GENKEY_COUNT_DATA   (10)

GenKey command packet size with "other data".

◆ GENKEY_DATA_IDX

#define GENKEY_DATA_IDX   (5)

GenKey command index for other data.

◆ GENKEY_KEYID_IDX

#define GENKEY_KEYID_IDX   ATCA_PARAM2_IDX

GenKey command index for key id.

◆ GENKEY_MODE_DIGEST

#define GENKEY_MODE_DIGEST   ((uint8_t)0x08)

GenKey mode: PubKey digest will be created after the public key is calculated.

◆ GENKEY_MODE_IDX

#define GENKEY_MODE_IDX   ATCA_PARAM1_IDX

GenKey command index for mode.

◆ GENKEY_MODE_MASK

#define GENKEY_MODE_MASK   ((uint8_t)0x1C)

GenKey mode bits 0 to 1 and 5 to 7 are 0.

◆ GENKEY_MODE_PRIVATE

#define GENKEY_MODE_PRIVATE   ((uint8_t)0x04)

GenKey mode: private key generation.

◆ GENKEY_MODE_PUBKEY_DIGEST

#define GENKEY_MODE_PUBKEY_DIGEST   ((uint8_t)0x10)

GenKey mode: Calculate PubKey digest on the public key in KeyId.

◆ GENKEY_MODE_PUBLIC

#define GENKEY_MODE_PUBLIC   ((uint8_t)0x00)

GenKey mode: public key calculation.

◆ GENKEY_OTHER_DATA_SIZE

#define GENKEY_OTHER_DATA_SIZE   (3)

GenKey size of "other data".

◆ GENKEY_PRIVATE_TO_TEMPKEY

#define GENKEY_PRIVATE_TO_TEMPKEY   ((uint16_t)0xFFFF)

GenKey Create private key and store to tempkey (608 only)

◆ GENKEY_RSP_SIZE_LONG

#define GENKEY_RSP_SIZE_LONG   ATCA_RSP_SIZE_64

GenKey response packet size when returning a public key.

◆ GENKEY_RSP_SIZE_SHORT

#define GENKEY_RSP_SIZE_SHORT   ATCA_RSP_SIZE_MIN

GenKey response packet size in Digest mode.

◆ HMAC_COUNT

#define HMAC_COUNT   ATCA_CMD_SIZE_MIN

HMAC command packet size.

◆ HMAC_DIGEST_SIZE

#define HMAC_DIGEST_SIZE   (32)

HMAC size of digest response.

◆ HMAC_KEYID_IDX

#define HMAC_KEYID_IDX   ATCA_PARAM2_IDX

HMAC command index for key id.

◆ HMAC_MODE_FLAG_FULLSN

#define HMAC_MODE_FLAG_FULLSN   ((uint8_t)0x40)

HMAC mode bit 6: If set, include the 48 bits SN[2:3] and SN[4:7] in the message.; otherwise, the corresponding message bits are set to zero.

◆ HMAC_MODE_FLAG_OTP64

#define HMAC_MODE_FLAG_OTP64   ((uint8_t)0x20)

HMAC mode bit 5: Include the first 64 OTP bits (OTP[0] through OTP[7]) in the message.; otherwise, the corresponding message bits are set to zero. If Mode[4] is set, the value of this mode bit is ignored. Not applicable for ATECC508A.

◆ HMAC_MODE_FLAG_OTP88

#define HMAC_MODE_FLAG_OTP88   ((uint8_t)0x10)

HMAC mode bit 4: Include the first 88 OTP bits (OTP[0] through OTP[10]) in the message.; otherwise, the corresponding message bits are set to zero. Not applicable for ATECC508A.

◆ HMAC_MODE_FLAG_TK_NORAND

#define HMAC_MODE_FLAG_TK_NORAND   ((uint8_t)0x04)

HMAC mode bit 2: The value of this bit must match the value in TempKey.SourceFlag or the command will return an error.

◆ HMAC_MODE_FLAG_TK_RAND

#define HMAC_MODE_FLAG_TK_RAND   ((uint8_t)0x00)

HMAC mode bit 2: The value of this bit must match the value in TempKey.SourceFlag or the command will return an error.

◆ HMAC_MODE_IDX

#define HMAC_MODE_IDX   ATCA_PARAM1_IDX

HMAC command index for mode.

◆ HMAC_MODE_MASK

#define HMAC_MODE_MASK   ((uint8_t)0x74)

HMAC mode bits 0, 1, 3, and 7 are 0.

◆ HMAC_RSP_SIZE

#define HMAC_RSP_SIZE   ATCA_RSP_SIZE_32

HMAC command response packet size.

◆ INFO_COUNT

#define INFO_COUNT   ATCA_CMD_SIZE_MIN

Info command packet size.

◆ INFO_DRIVER_STATE_MASK

#define INFO_DRIVER_STATE_MASK   ((uint8_t)0x02)

Info driver state mask.

◆ INFO_MODE_GPIO

#define INFO_MODE_GPIO   ((uint8_t)0x03)

Info mode GPIO.

◆ INFO_MODE_KEY_VALID

#define INFO_MODE_KEY_VALID   ((uint8_t)0x01)

Info mode KeyValid.

◆ INFO_MODE_MAX

#define INFO_MODE_MAX   ((uint8_t)0x03)

Info mode maximum value.

◆ INFO_MODE_REVISION

#define INFO_MODE_REVISION   ((uint8_t)0x00)

Info mode Revision.

◆ INFO_MODE_STATE

#define INFO_MODE_STATE   ((uint8_t)0x02)

Info mode State.

◆ INFO_MODE_VOL_KEY_PERMIT

#define INFO_MODE_VOL_KEY_PERMIT   ((uint8_t)0x04)

Info mode GPIO.

◆ INFO_NO_STATE

#define INFO_NO_STATE   ((uint8_t)0x00)

Info mode is not the state mode.

◆ INFO_OUTPUT_STATE_MASK

#define INFO_OUTPUT_STATE_MASK   ((uint8_t)0x01)

Info output state mask.

◆ INFO_PARAM1_IDX

#define INFO_PARAM1_IDX   ATCA_PARAM1_IDX

Info command index for 1. parameter.

◆ INFO_PARAM2_IDX

#define INFO_PARAM2_IDX   ATCA_PARAM2_IDX

Info command index for 2. parameter.

◆ INFO_PARAM2_LATCH_CLEAR

#define INFO_PARAM2_LATCH_CLEAR   ((uint16_t)0x0000)

Info param2 to clear the persistent latch.

◆ INFO_PARAM2_LATCH_SET

#define INFO_PARAM2_LATCH_SET   ((uint16_t)0x0001)

Info param2 to set the persistent latch.

◆ INFO_PARAM2_SET_LATCH_STATE

#define INFO_PARAM2_SET_LATCH_STATE   ((uint16_t)0x0002)

Info param2 to set the persistent latch state.

◆ INFO_RSP_SIZE

#define INFO_RSP_SIZE   ATCA_RSP_SIZE_VAL

Info command response packet size.

◆ INFO_SIZE

#define INFO_SIZE   ((uint8_t)0x04)

Info return size.

◆ KDF_DETAILS_AES_KEY_LOC_MASK

#define KDF_DETAILS_AES_KEY_LOC_MASK   ((uint32_t)0x00000003)

KDF details for AES, key location mask.

◆ KDF_DETAILS_HKDF_MSG_LOC_INPUT

#define KDF_DETAILS_HKDF_MSG_LOC_INPUT   ((uint32_t)0x00000002)

KDF details for HKDF, message location in input parameter.

◆ KDF_DETAILS_HKDF_MSG_LOC_IV

#define KDF_DETAILS_HKDF_MSG_LOC_IV   ((uint32_t)0x00000003)

KDF details for HKDF, message location is a special IV function.

◆ KDF_DETAILS_HKDF_MSG_LOC_MASK

#define KDF_DETAILS_HKDF_MSG_LOC_MASK   ((uint32_t)0x00000003)

KDF details for HKDF, message location mask.

◆ KDF_DETAILS_HKDF_MSG_LOC_SLOT

#define KDF_DETAILS_HKDF_MSG_LOC_SLOT   ((uint32_t)0x00000000)

KDF details for HKDF, message location in slot.

◆ KDF_DETAILS_HKDF_MSG_LOC_TEMPKEY

#define KDF_DETAILS_HKDF_MSG_LOC_TEMPKEY   ((uint32_t)0x00000001)

KDF details for HKDF, message location in TempKey.

◆ KDF_DETAILS_HKDF_ZERO_KEY

#define KDF_DETAILS_HKDF_ZERO_KEY   ((uint32_t)0x00000004)

KDF details for HKDF, key is 32 bytes of zero.

◆ KDF_DETAILS_IDX

#define KDF_DETAILS_IDX   ATCA_DATA_IDX

KDF command index for details.

◆ KDF_DETAILS_PRF_AEAD_MASK

#define KDF_DETAILS_PRF_AEAD_MASK   ((uint32_t)0x00000600)

KDF details for PRF, AEAD processing mask.

◆ KDF_DETAILS_PRF_AEAD_MODE0

#define KDF_DETAILS_PRF_AEAD_MODE0   ((uint32_t)0x00000000)

KDF details for PRF, AEAD no processing.

◆ KDF_DETAILS_PRF_AEAD_MODE1

#define KDF_DETAILS_PRF_AEAD_MODE1   ((uint32_t)0x00000200)

KDF details for PRF, AEAD First 32 go to target, second 32 go to output buffer.

◆ KDF_DETAILS_PRF_KEY_LEN_16

#define KDF_DETAILS_PRF_KEY_LEN_16   ((uint32_t)0x00000000)

KDF details for PRF, source key length is 16 bytes.

◆ KDF_DETAILS_PRF_KEY_LEN_32

#define KDF_DETAILS_PRF_KEY_LEN_32   ((uint32_t)0x00000001)

KDF details for PRF, source key length is 32 bytes.

◆ KDF_DETAILS_PRF_KEY_LEN_48

#define KDF_DETAILS_PRF_KEY_LEN_48   ((uint32_t)0x00000002)

KDF details for PRF, source key length is 48 bytes.

◆ KDF_DETAILS_PRF_KEY_LEN_64

#define KDF_DETAILS_PRF_KEY_LEN_64   ((uint32_t)0x00000003)

KDF details for PRF, source key length is 64 bytes.

◆ KDF_DETAILS_PRF_KEY_LEN_MASK

#define KDF_DETAILS_PRF_KEY_LEN_MASK   ((uint32_t)0x00000003)

KDF details for PRF, source key length mask.

◆ KDF_DETAILS_PRF_TARGET_LEN_32

#define KDF_DETAILS_PRF_TARGET_LEN_32   ((uint32_t)0x00000000)

KDF details for PRF, target length is 32 bytes.

◆ KDF_DETAILS_PRF_TARGET_LEN_64

#define KDF_DETAILS_PRF_TARGET_LEN_64   ((uint32_t)0x00000100)

KDF details for PRF, target length is 64 bytes.

◆ KDF_DETAILS_PRF_TARGET_LEN_MASK

#define KDF_DETAILS_PRF_TARGET_LEN_MASK   ((uint32_t)0x00000100)

KDF details for PRF, target length mask.

◆ KDF_DETAILS_SIZE

#define KDF_DETAILS_SIZE   4

KDF details (param3) size.

◆ KDF_KEYID_IDX

#define KDF_KEYID_IDX   ATCA_PARAM2_IDX

KDF command index for key id.

◆ KDF_MESSAGE_IDX

#define KDF_MESSAGE_IDX   (ATCA_DATA_IDX + KDF_DETAILS_SIZE)

◆ KDF_MODE_ALG_AES

#define KDF_MODE_ALG_AES   ((uint8_t)0x20)

KDF mode AES algorithm.

◆ KDF_MODE_ALG_HKDF

#define KDF_MODE_ALG_HKDF   ((uint8_t)0x40)

KDF mode HKDF algorithm.

◆ KDF_MODE_ALG_MASK

#define KDF_MODE_ALG_MASK   ((uint8_t)0x60)

KDF mode algorithm mask.

◆ KDF_MODE_ALG_PRF

#define KDF_MODE_ALG_PRF   ((uint8_t)0x00)

KDF mode PRF algorithm.

◆ KDF_MODE_IDX

#define KDF_MODE_IDX   ATCA_PARAM1_IDX

KDF command index for mode.

◆ KDF_MODE_SOURCE_ALTKEYBUF

#define KDF_MODE_SOURCE_ALTKEYBUF   ((uint8_t)0x03)

KDF mode source key in alternate key buffer.

◆ KDF_MODE_SOURCE_MASK

#define KDF_MODE_SOURCE_MASK   ((uint8_t)0x03)

KDF mode source key mask.

◆ KDF_MODE_SOURCE_SLOT

#define KDF_MODE_SOURCE_SLOT   ((uint8_t)0x02)

KDF mode source key in a slot.

◆ KDF_MODE_SOURCE_TEMPKEY

#define KDF_MODE_SOURCE_TEMPKEY   ((uint8_t)0x00)

KDF mode source key in TempKey.

◆ KDF_MODE_SOURCE_TEMPKEY_UP

#define KDF_MODE_SOURCE_TEMPKEY_UP   ((uint8_t)0x01)

KDF mode source key in upper TempKey.

◆ KDF_MODE_TARGET_ALTKEYBUF

#define KDF_MODE_TARGET_ALTKEYBUF   ((uint8_t)0x0C)

KDF mode target key in alternate key buffer.

◆ KDF_MODE_TARGET_MASK

#define KDF_MODE_TARGET_MASK   ((uint8_t)0x1C)

KDF mode target key mask.

◆ KDF_MODE_TARGET_OUTPUT

#define KDF_MODE_TARGET_OUTPUT   ((uint8_t)0x10)

KDF mode target key in output buffer.

◆ KDF_MODE_TARGET_OUTPUT_ENC

#define KDF_MODE_TARGET_OUTPUT_ENC   ((uint8_t)0x14)

KDF mode target key encrypted in output buffer.

◆ KDF_MODE_TARGET_SLOT

#define KDF_MODE_TARGET_SLOT   ((uint8_t)0x08)

KDF mode target key in slot.

◆ KDF_MODE_TARGET_TEMPKEY

#define KDF_MODE_TARGET_TEMPKEY   ((uint8_t)0x00)

KDF mode target key in TempKey.

◆ KDF_MODE_TARGET_TEMPKEY_UP

#define KDF_MODE_TARGET_TEMPKEY_UP   ((uint8_t)0x04)

KDF mode target key in upper TempKey.

◆ LOCK_COUNT

#define LOCK_COUNT   ATCA_CMD_SIZE_MIN

Lock command packet size.

◆ LOCK_RSP_SIZE

#define LOCK_RSP_SIZE   ATCA_RSP_SIZE_MIN

Lock command response packet size.

◆ LOCK_SUMMARY_IDX

#define LOCK_SUMMARY_IDX   ATCA_PARAM2_IDX

Lock command index for summary.

◆ LOCK_ZONE_CONFIG

#define LOCK_ZONE_CONFIG   ((uint8_t)0x00)

Lock zone is Config.

◆ LOCK_ZONE_DATA

#define LOCK_ZONE_DATA   ((uint8_t)0x01)

Lock zone is OTP or Data.

◆ LOCK_ZONE_DATA_SLOT

#define LOCK_ZONE_DATA_SLOT   ((uint8_t)0x02)

Lock slot of Data.

◆ LOCK_ZONE_IDX

#define LOCK_ZONE_IDX   ATCA_PARAM1_IDX

Lock command index for zone.

◆ LOCK_ZONE_MASK

#define LOCK_ZONE_MASK   (0xBF)

Lock parameter 1 bits 6 are 0.

◆ LOCK_ZONE_NO_CRC

#define LOCK_ZONE_NO_CRC   ((uint8_t)0x80)

Lock command: Ignore summary.

◆ MAC_CHALLENGE_IDX

#define MAC_CHALLENGE_IDX   ATCA_DATA_IDX

MAC command index for optional challenge.

◆ MAC_CHALLENGE_SIZE

#define MAC_CHALLENGE_SIZE   (32)

MAC size of challenge.

◆ MAC_COUNT_LONG

#define MAC_COUNT_LONG   (39)

MAC command packet size with challenge.

◆ MAC_COUNT_SHORT

#define MAC_COUNT_SHORT   ATCA_CMD_SIZE_MIN

MAC command packet size without challenge.

◆ MAC_KEYID_IDX

#define MAC_KEYID_IDX   ATCA_PARAM2_IDX

MAC command index for key id.

◆ MAC_MODE_BLOCK1_TEMPKEY

#define MAC_MODE_BLOCK1_TEMPKEY   ((uint8_t)0x02)

MAC mode bit 1: first SHA block from TempKey.

◆ MAC_MODE_BLOCK2_TEMPKEY

#define MAC_MODE_BLOCK2_TEMPKEY   ((uint8_t)0x01)

MAC mode bit 0: second SHA block from TempKey.

◆ MAC_MODE_CHALLENGE

#define MAC_MODE_CHALLENGE   ((uint8_t)0x00)

MAC mode 0: first SHA block from data slot.

◆ MAC_MODE_IDX

#define MAC_MODE_IDX   ATCA_PARAM1_IDX

MAC command index for mode.

◆ MAC_MODE_INCLUDE_OTP_64

#define MAC_MODE_INCLUDE_OTP_64   ((uint8_t)0x20)

MAC mode bit 5: include first 64 OTP bits.

◆ MAC_MODE_INCLUDE_OTP_88

#define MAC_MODE_INCLUDE_OTP_88   ((uint8_t)0x10)

MAC mode bit 4: include first 88 OTP bits.

◆ MAC_MODE_INCLUDE_SN

#define MAC_MODE_INCLUDE_SN   ((uint8_t)0x40)

MAC mode bit 6: include serial number.

◆ MAC_MODE_MASK

#define MAC_MODE_MASK   ((uint8_t)0x77)

MAC mode bits 3 and 7 are 0.

◆ MAC_MODE_PASSTHROUGH

#define MAC_MODE_PASSTHROUGH   ((uint8_t)0x07)

MAC mode bit 0-2: pass-through mode.

◆ MAC_MODE_PTNONCE_TEMPKEY

#define MAC_MODE_PTNONCE_TEMPKEY   ((uint8_t)0x06)

MAC mode bit 0: second SHA block from TempKey.

◆ MAC_MODE_SOURCE_FLAG_MATCH

#define MAC_MODE_SOURCE_FLAG_MATCH   ((uint8_t)0x04)

MAC mode bit 2: match TempKey.SourceFlag.

◆ MAC_RSP_SIZE

#define MAC_RSP_SIZE   ATCA_RSP_SIZE_32

MAC command response packet size.

◆ MAC_SIZE

#define MAC_SIZE   (32)

MAC size of response.

◆ NONCE_COUNT_LONG

#define NONCE_COUNT_LONG   (ATCA_CMD_SIZE_MIN + 32)

Nonce command packet size for 32 bytes of NumIn.

◆ NONCE_COUNT_LONG_64

#define NONCE_COUNT_LONG_64   (ATCA_CMD_SIZE_MIN + 64)

Nonce command packet size for 64 bytes of NumIn.

◆ NONCE_COUNT_SHORT

#define NONCE_COUNT_SHORT   (ATCA_CMD_SIZE_MIN + 20)

Nonce command packet size for 20 bytes of NumIn.

◆ NONCE_INPUT_IDX

#define NONCE_INPUT_IDX   ATCA_DATA_IDX

Nonce command index for input data.

◆ NONCE_MODE_IDX

#define NONCE_MODE_IDX   ATCA_PARAM1_IDX

Nonce command index for mode.

◆ NONCE_MODE_INPUT_LEN_32

#define NONCE_MODE_INPUT_LEN_32   ((uint8_t)0x00)

Nonce mode: input size is 32 bytes.

◆ NONCE_MODE_INPUT_LEN_64

#define NONCE_MODE_INPUT_LEN_64   ((uint8_t)0x20)

Nonce mode: input size is 64 bytes.

◆ NONCE_MODE_INPUT_LEN_MASK

#define NONCE_MODE_INPUT_LEN_MASK   ((uint8_t)0x20)

Nonce mode: input size mask.

◆ NONCE_MODE_INVALID

#define NONCE_MODE_INVALID   ((uint8_t)0x02)

Nonce mode 2 is invalid.

◆ NONCE_MODE_MASK

#define NONCE_MODE_MASK   ((uint8_t)0x03)

Nonce mode bits 2 to 7 are 0.

◆ NONCE_MODE_NO_SEED_UPDATE

#define NONCE_MODE_NO_SEED_UPDATE   ((uint8_t)0x01)

Nonce mode: do not update seed.

◆ NONCE_MODE_PASSTHROUGH

#define NONCE_MODE_PASSTHROUGH   ((uint8_t)0x03)

Nonce mode: pass-through.

◆ NONCE_MODE_SEED_UPDATE

#define NONCE_MODE_SEED_UPDATE   ((uint8_t)0x00)

Nonce mode: update seed.

◆ NONCE_MODE_TARGET_ALTKEYBUF

#define NONCE_MODE_TARGET_ALTKEYBUF   ((uint8_t)0x80)

Nonce mode: target is Alternate Key Buffer.

◆ NONCE_MODE_TARGET_MASK

#define NONCE_MODE_TARGET_MASK   ((uint8_t)0xC0)

Nonce mode: target mask.

◆ NONCE_MODE_TARGET_MSGDIGBUF

#define NONCE_MODE_TARGET_MSGDIGBUF   ((uint8_t)0x40)

Nonce mode: target is Message Digest Buffer.

◆ NONCE_MODE_TARGET_TEMPKEY

#define NONCE_MODE_TARGET_TEMPKEY   ((uint8_t)0x00)

Nonce mode: target is TempKey.

◆ NONCE_NUMIN_SIZE

#define NONCE_NUMIN_SIZE   (20)

Nonce NumIn size for random modes.

◆ NONCE_NUMIN_SIZE_PASSTHROUGH

#define NONCE_NUMIN_SIZE_PASSTHROUGH   (32)

Nonce NumIn size for 32-byte pass-through mode.

◆ NONCE_PARAM2_IDX

#define NONCE_PARAM2_IDX   ATCA_PARAM2_IDX

Nonce command index for 2. parameter.

◆ NONCE_RSP_SIZE_LONG

#define NONCE_RSP_SIZE_LONG   ATCA_RSP_SIZE_32

Nonce command response packet size with output.

◆ NONCE_RSP_SIZE_SHORT

#define NONCE_RSP_SIZE_SHORT   ATCA_RSP_SIZE_MIN

Nonce command response packet size with no output.

◆ NONCE_ZERO_CALC_MASK

#define NONCE_ZERO_CALC_MASK   ((uint16_t)0x8000)

Nonce zero (param2): calculation mode mask.

◆ NONCE_ZERO_CALC_RANDOM

#define NONCE_ZERO_CALC_RANDOM   ((uint16_t)0x0000)

Nonce zero (param2): calculation mode random, use RNG in calculation and return RNG output.

◆ NONCE_ZERO_CALC_TEMPKEY

#define NONCE_ZERO_CALC_TEMPKEY   ((uint16_t)0x8000)

Nonce zero (param2): calculation mode TempKey, use TempKey in calculation and return new TempKey value.

◆ OUTNONCE_SIZE

#define OUTNONCE_SIZE   (32)

Size of the OutNonce response expected from several commands.

◆ PAUSE_COUNT

#define PAUSE_COUNT   ATCA_CMD_SIZE_MIN

Pause command packet size.

◆ PAUSE_PARAM2_IDX

#define PAUSE_PARAM2_IDX   ATCA_PARAM2_IDX

Pause command index for 2. parameter.

◆ PAUSE_RSP_SIZE

#define PAUSE_RSP_SIZE   ATCA_RSP_SIZE_MIN

Pause command response packet size.

◆ PAUSE_SELECT_IDX

#define PAUSE_SELECT_IDX   ATCA_PARAM1_IDX

Pause command index for Selector.

◆ PRIVWRITE_COUNT

#define PRIVWRITE_COUNT   (75)

PrivWrite command packet size.

◆ PRIVWRITE_KEYID_IDX

#define PRIVWRITE_KEYID_IDX   ATCA_PARAM2_IDX

PrivWrite command index for KeyID.

◆ PRIVWRITE_MAC_IDX

#define PRIVWRITE_MAC_IDX   (41)

PrivWrite command index for MAC.

◆ PRIVWRITE_MODE_ENCRYPT

#define PRIVWRITE_MODE_ENCRYPT   ((uint8_t)0x40)

PrivWrite mode: encrypted.

◆ PRIVWRITE_RSP_SIZE

#define PRIVWRITE_RSP_SIZE   ATCA_RSP_SIZE_MIN

PrivWrite command response packet size.

◆ PRIVWRITE_VALUE_IDX

#define PRIVWRITE_VALUE_IDX   ( 5)

PrivWrite command index for value.

◆ PRIVWRITE_ZONE_IDX

#define PRIVWRITE_ZONE_IDX   ATCA_PARAM1_IDX

PrivWrite command index for zone.

◆ PRIVWRITE_ZONE_MASK

#define PRIVWRITE_ZONE_MASK   ((uint8_t)0x40)

PrivWrite zone bits 0 to 5 and 7 are 0.

◆ RANDOM_COUNT

#define RANDOM_COUNT   ATCA_CMD_SIZE_MIN

Random command packet size.

◆ RANDOM_MODE_IDX

#define RANDOM_MODE_IDX   ATCA_PARAM1_IDX

Random command index for mode.

◆ RANDOM_NO_SEED_UPDATE

#define RANDOM_NO_SEED_UPDATE   ((uint8_t)0x01)

Random mode for no seed update.

◆ RANDOM_NUM_SIZE

#define RANDOM_NUM_SIZE   ((uint8_t)32)

Number of bytes in the data packet of a random command.

◆ RANDOM_PARAM2_IDX

#define RANDOM_PARAM2_IDX   ATCA_PARAM2_IDX

Random command index for 2. parameter.

◆ RANDOM_RSP_SIZE

#define RANDOM_RSP_SIZE   ATCA_RSP_SIZE_32

Random command response packet size.

◆ RANDOM_SEED_UPDATE

#define RANDOM_SEED_UPDATE   ((uint8_t)0x00)

Random mode for automatic seed update.

◆ READ_32_RSP_SIZE

#define READ_32_RSP_SIZE   ATCA_RSP_SIZE_32

Read command response packet size when reading 32 bytes.

◆ READ_4_RSP_SIZE

#define READ_4_RSP_SIZE   ATCA_RSP_SIZE_VAL

Read command response packet size when reading 4 bytes.

◆ READ_ADDR_IDX

#define READ_ADDR_IDX   ATCA_PARAM2_IDX

Read command index for address.

◆ READ_COUNT

#define READ_COUNT   ATCA_CMD_SIZE_MIN

Read command packet size.

◆ READ_ZONE_IDX

#define READ_ZONE_IDX   ATCA_PARAM1_IDX

Read command index for zone.

◆ READ_ZONE_MASK

#define READ_ZONE_MASK   ((uint8_t)0x83)

Read zone bits 2 to 6 are 0.

◆ RSA2048_KEY_SIZE

#define RSA2048_KEY_SIZE   (256)

size of a RSA private key

◆ SECUREBOOT_COUNT_DIG

#define SECUREBOOT_COUNT_DIG   (ATCA_CMD_SIZE_MIN + SECUREBOOT_DIGEST_SIZE)

SecureBoot command packet size for just a digest.

◆ SECUREBOOT_COUNT_DIG_SIG

#define SECUREBOOT_COUNT_DIG_SIG   (ATCA_CMD_SIZE_MIN + SECUREBOOT_DIGEST_SIZE + SECUREBOOT_SIGNATURE_SIZE)

SecureBoot command packet size for a digest and signature.

◆ SECUREBOOT_DIGEST_SIZE

#define SECUREBOOT_DIGEST_SIZE   (32)

SecureBoot digest input size.

◆ SECUREBOOT_MAC_SIZE

#define SECUREBOOT_MAC_SIZE   (32)

SecureBoot MAC output size.

◆ SECUREBOOT_MODE_ENC_MAC_FLAG

#define SECUREBOOT_MODE_ENC_MAC_FLAG   ((uint8_t)0x80)

SecureBoot mode flag for encrypted digest and returning validating MAC.

◆ SECUREBOOT_MODE_FULL

#define SECUREBOOT_MODE_FULL   ((uint8_t)0x05)

SecureBoot mode Full.

◆ SECUREBOOT_MODE_FULL_COPY

#define SECUREBOOT_MODE_FULL_COPY   ((uint8_t)0x07)

SecureBoot mode FullCopy.

◆ SECUREBOOT_MODE_FULL_STORE

#define SECUREBOOT_MODE_FULL_STORE   ((uint8_t)0x06)

SecureBoot mode FullStore.

◆ SECUREBOOT_MODE_IDX

#define SECUREBOOT_MODE_IDX   ATCA_PARAM1_IDX

SecureBoot command index for mode.

◆ SECUREBOOT_MODE_MASK

#define SECUREBOOT_MODE_MASK   ((uint8_t)0x07)

SecureBoot mode mask.

◆ SECUREBOOT_MODE_PROHIBIT_FLAG

#define SECUREBOOT_MODE_PROHIBIT_FLAG   ((uint8_t)0x40)

SecureBoot mode flag to prohibit SecureBoot until next power cycle.

◆ SECUREBOOT_RSP_SIZE_MAC

#define SECUREBOOT_RSP_SIZE_MAC   (ATCA_PACKET_OVERHEAD + SECUREBOOT_MAC_SIZE)

SecureBoot response packet size with MAC.

◆ SECUREBOOT_RSP_SIZE_NO_MAC

#define SECUREBOOT_RSP_SIZE_NO_MAC   ATCA_RSP_SIZE_MIN

SecureBoot response packet size for no MAC.

◆ SECUREBOOT_SIGNATURE_SIZE

#define SECUREBOOT_SIGNATURE_SIZE   (64)

SecureBoot signature input size.

◆ SECUREBOOTCONFIG_MODE_DISABLED

#define SECUREBOOTCONFIG_MODE_DISABLED   ((uint16_t)0x0000)

Disabled SecureBootMode in SecureBootConfig value.

◆ SECUREBOOTCONFIG_MODE_FULL_BOTH

#define SECUREBOOTCONFIG_MODE_FULL_BOTH   ((uint16_t)0x0001)

Both digest and signature always required SecureBootMode in SecureBootConfig value.

◆ SECUREBOOTCONFIG_MODE_FULL_DIG

#define SECUREBOOTCONFIG_MODE_FULL_DIG   ((uint16_t)0x0003)

Digest stored SecureBootMode in SecureBootConfig value.

◆ SECUREBOOTCONFIG_MODE_FULL_SIG

#define SECUREBOOTCONFIG_MODE_FULL_SIG   ((uint16_t)0x0002)

Signature stored SecureBootMode in SecureBootConfig value.

◆ SECUREBOOTCONFIG_MODE_MASK

#define SECUREBOOTCONFIG_MODE_MASK   ((uint16_t)0x0003)

Mask for SecureBootMode field in SecureBootConfig value.

◆ SECUREBOOTCONFIG_OFFSET

#define SECUREBOOTCONFIG_OFFSET   (70)

SecureBootConfig byte offset into the configuration zone.

◆ SELFTEST_COUNT

#define SELFTEST_COUNT   ATCA_CMD_SIZE_MIN

SelfTest command packet size.

◆ SELFTEST_MODE_AES

#define SELFTEST_MODE_AES   ((uint8_t)0x10)

SelfTest mode AES encrypt function.

◆ SELFTEST_MODE_ALL

#define SELFTEST_MODE_ALL   ((uint8_t)0x3B)

SelfTest mode all algorithms.

◆ SELFTEST_MODE_ECDH

#define SELFTEST_MODE_ECDH   ((uint8_t)0x08)

SelfTest mode ECDH function.

◆ SELFTEST_MODE_ECDSA_SIGN_VERIFY

#define SELFTEST_MODE_ECDSA_SIGN_VERIFY   ((uint8_t)0x02)

SelfTest mode ECDSA verify function.

◆ SELFTEST_MODE_IDX

#define SELFTEST_MODE_IDX   ATCA_PARAM1_IDX

SelfTest command index for mode.

◆ SELFTEST_MODE_RNG

#define SELFTEST_MODE_RNG   ((uint8_t)0x01)

SelfTest mode RNG DRBG function.

◆ SELFTEST_MODE_SHA

#define SELFTEST_MODE_SHA   ((uint8_t)0x20)

SelfTest mode SHA function.

◆ SELFTEST_RSP_SIZE

#define SELFTEST_RSP_SIZE   ATCA_RSP_SIZE_MIN

SelfTest command response packet size.

◆ SHA_CONTEXT_MAX_SIZE

#define SHA_CONTEXT_MAX_SIZE   (99)

◆ SHA_COUNT_LONG

#define SHA_COUNT_LONG   ATCA_CMD_SIZE_MIN

Just a starting size.

◆ SHA_COUNT_SHORT

#define SHA_COUNT_SHORT   ATCA_CMD_SIZE_MIN

◆ SHA_DATA_MAX

#define SHA_DATA_MAX   (64)

◆ SHA_MODE_608_HMAC_END

#define SHA_MODE_608_HMAC_END   ((uint8_t)0x02)

Complete the HMAC computation and return digest... Different command on 608.

◆ SHA_MODE_HMAC_END

#define SHA_MODE_HMAC_END   ((uint8_t)0x05)

Complete the HMAC computation and return digest.

◆ SHA_MODE_HMAC_START

#define SHA_MODE_HMAC_START   ((uint8_t)0x04)

Initialization, HMAC calculation.

◆ SHA_MODE_HMAC_UPDATE

#define SHA_MODE_HMAC_UPDATE   ((uint8_t)0x01)

Add 64 bytes in the meesage to the SHA context.

◆ SHA_MODE_MASK

#define SHA_MODE_MASK   ((uint8_t)0x07)

Mask the bit 0-2.

◆ SHA_MODE_READ_CONTEXT

#define SHA_MODE_READ_CONTEXT   ((uint8_t)0x06)

Read current SHA-256 context out of the device.

◆ SHA_MODE_SHA256_END

#define SHA_MODE_SHA256_END   ((uint8_t)0x02)

Complete the calculation and return the digest.

◆ SHA_MODE_SHA256_PUBLIC

#define SHA_MODE_SHA256_PUBLIC   ((uint8_t)0x03)

Add 64 byte ECC public key in the slot to the SHA context.

◆ SHA_MODE_SHA256_START

#define SHA_MODE_SHA256_START   ((uint8_t)0x00)

Initialization, does not accept a message.

◆ SHA_MODE_SHA256_UPDATE

#define SHA_MODE_SHA256_UPDATE   ((uint8_t)0x01)

Add 64 bytes in the meesage to the SHA context.

◆ SHA_MODE_TARGET_MASK

#define SHA_MODE_TARGET_MASK   ((uint8_t)0xC0)

Resulting digest target location mask.

◆ SHA_MODE_TARGET_MSGDIGBUF

#define SHA_MODE_TARGET_MSGDIGBUF   ((uint8_t)0x40)

Place resulting digest both in Output buffer and Message Digest Buffer.

◆ SHA_MODE_TARGET_OUT_ONLY

#define SHA_MODE_TARGET_OUT_ONLY   ((uint8_t)0xC0)

Place resulting digest both in Output buffer ONLY.

◆ SHA_MODE_TARGET_TEMPKEY

#define SHA_MODE_TARGET_TEMPKEY   ((uint8_t)0x00)

Place resulting digest both in Output buffer and TempKey.

◆ SHA_MODE_WRITE_CONTEXT

#define SHA_MODE_WRITE_CONTEXT   ((uint8_t)0x07)

Restore a SHA-256 context into the device.

◆ SHA_RSP_SIZE

#define SHA_RSP_SIZE   ATCA_RSP_SIZE_32

SHA command response packet size.

◆ SHA_RSP_SIZE_LONG

#define SHA_RSP_SIZE_LONG   ATCA_RSP_SIZE_32

SHA command response packet size.

◆ SHA_RSP_SIZE_SHORT

#define SHA_RSP_SIZE_SHORT   ATCA_RSP_SIZE_MIN

SHA command response packet size only status code.

Typedef Documentation

◆ ATCACommand

typedef struct atca_command* ATCACommand

Function Documentation

◆ atAES()

ATCA_STATUS atAES ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand AES method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atCalcCrc()

void atCalcCrc ( ATCAPacket packet)

This function calculates CRC and adds it to the correct offset in the packet data.

Parameters
[in]packetPacket to calculate CRC data for

◆ atCheckCrc()

ATCA_STATUS atCheckCrc ( const uint8_t *  response)

This function checks the consistency of a response.

Parameters
[in]responsepointer to response
Returns
ATCA_SUCCESS on success, otherwise ATCA_RX_CRC_ERROR

◆ atCheckMAC()

ATCA_STATUS atCheckMAC ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand CheckMAC method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atCounter()

ATCA_STATUS atCounter ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Counter method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ atCRC()

void atCRC ( size_t  length,
const uint8_t *  data,
uint8_t *  crc_le 
)

Calculates CRC over the given raw data and returns the CRC in little-endian byte order.

Parameters
[in]lengthSize of data not including the CRC byte positions
[in]dataPointer to the data over which to compute the CRC
[out]crc_lePointer to the place where the two-bytes of CRC will be returned in little-endian byte order.

◆ atDeriveKey()

ATCA_STATUS atDeriveKey ( ATCACommand  ca_cmd,
ATCAPacket packet,
bool  has_mac 
)

ATCACommand DeriveKey method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
[in]has_machasMAC determines if MAC data is present in the packet input
Returns
ATCA_SUCCESS

◆ atECDH()

ATCA_STATUS atECDH ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand ECDH method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atGenDig()

ATCA_STATUS atGenDig ( ATCACommand  ca_cmd,
ATCAPacket packet,
bool  is_no_mac_key 
)

ATCACommand Generate Digest method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
[in]is_no_mac_keyShould be true if GenDig is being run on a slot that has its SlotConfig.NoMac bit set
Returns
ATCA_SUCCESS

◆ atGenKey()

ATCA_STATUS atGenKey ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Generate Key method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atHMAC()

ATCA_STATUS atHMAC ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand HMAC method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atInfo()

ATCA_STATUS atInfo ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Info method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atIsECCFamily()

bool atIsECCFamily ( ATCADeviceType  device_type)

determines if a given device type is an ECC device or a superset of a ECC device

Parameters
[in]device_typeType of device to check for family type
Returns
boolean indicating whether the given device is an ECC family device.

◆ atIsSHAFamily()

bool atIsSHAFamily ( ATCADeviceType  device_type)

determines if a given device type is a SHA device or a superset of a SHA device

Parameters
[in]device_typeType of device to check for family type
Returns
boolean indicating whether the given device is a SHA family device.

◆ atKDF()

ATCA_STATUS atKDF ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand KDF method.

Parameters
[in]ca_cmdInstance
[in]packetPointer to the packet containing the command being built.
Returns
ATCA_SUCCESS

◆ atLock()

ATCA_STATUS atLock ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Lock method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atMAC()

ATCA_STATUS atMAC ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand MAC method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atNonce()

ATCA_STATUS atNonce ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Nonce method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ atPause()

ATCA_STATUS atPause ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Pause method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atPrivWrite()

ATCA_STATUS atPrivWrite ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand PrivWrite method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atRandom()

ATCA_STATUS atRandom ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Random method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atRead()

ATCA_STATUS atRead ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Read method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atSecureBoot()

ATCA_STATUS atSecureBoot ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand SecureBoot method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atSelfTest()

ATCA_STATUS atSelfTest ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand AES method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atSHA()

ATCA_STATUS atSHA ( ATCACommand  ca_cmd,
ATCAPacket packet,
uint16_t  write_context_size 
)

ATCACommand SHA method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
[in]write_context_sizethe length of the sha write_context data
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ atSign()

ATCA_STATUS atSign ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand Sign method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atUpdateExtra()

ATCA_STATUS atUpdateExtra ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand UpdateExtra method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS

◆ atVerify()

ATCA_STATUS atVerify ( ATCACommand  ca_cmd,
ATCAPacket packet 
)

ATCACommand ECDSA Verify method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ atWrite()

ATCA_STATUS atWrite ( ATCACommand  ca_cmd,
ATCAPacket packet,
bool  has_mac 
)

ATCACommand Write method.

Parameters
[in]ca_cmdinstance
[in]packetpointer to the packet containing the command being built
[in]has_macFlag to indicate whether a mac is present or not
Returns
ATCA_SUCCESS

◆ deleteATCACommand()

void deleteATCACommand ( ATCACommand ca_cmd)

ATCACommand destructor.

Parameters
[in]ca_cmdinstance of a command object

◆ initATCACommand()

ATCA_STATUS initATCACommand ( ATCADeviceType  device_type,
ATCACommand  ca_cmd 
)

Initializer for ATCACommand.

Parameters
[in]device_typeSpecifies which set of commands and execution times should be associated with this command object.
[in]ca_cmdPre-allocated command structure to initialize.
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ isATCAError()

ATCA_STATUS isATCAError ( uint8_t *  data)

checks for basic error frame in data

Parameters
[in]datapointer to received data - expected to be in the form of a CA device response frame
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ newATCACommand()

ATCACommand newATCACommand ( ATCADeviceType  device_type)

constructor for ATCACommand

Parameters
[in]device_typeSpecifies which set of commands and execution times should be associated with this command object.
Returns
Initialized object on success. NULL on failure.