CryptoAuthLib
Atmel CryptoAuthentication Library
|
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. See the atca_command.h file for details on the ATCACommand methods More... | |
Functions | |
ATCACommand | newATCACommand (ATCADeviceType device_type) |
constructor for ATCACommand More... | |
ATCA_STATUS | atCheckMAC (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand CheckMAC method. More... | |
ATCA_STATUS | atCounter (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Counter method. More... | |
ATCA_STATUS | atDeriveKey (ATCACommand cacmd, ATCAPacket *packet, bool hasMAC) |
ATCACommand DeriveKey method. More... | |
ATCA_STATUS | atECDH (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand ECDH method. More... | |
ATCA_STATUS | atGenDig (ATCACommand cacmd, ATCAPacket *packet, bool hasMACKey) |
ATCACommand Generate Digest method. More... | |
ATCA_STATUS | atGenKey (ATCACommand cacmd, ATCAPacket *packet, bool isPubKey) |
ATCACommand Generate Key method. More... | |
ATCA_STATUS | atHMAC (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand HMAC method. More... | |
ATCA_STATUS | atInfo (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Info method. More... | |
ATCA_STATUS | atLock (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Lock method. More... | |
ATCA_STATUS | atMAC (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand MAC method. More... | |
ATCA_STATUS | atNonce (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Nonce method. More... | |
ATCA_STATUS | atPause (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Pause method. More... | |
ATCA_STATUS | atPrivWrite (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand PrivWrite method. More... | |
ATCA_STATUS | atRandom (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Random method. More... | |
ATCA_STATUS | atRead (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Read method. More... | |
ATCA_STATUS | atSHA (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand SHA method. More... | |
ATCA_STATUS | atSign (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Sign method. More... | |
ATCA_STATUS | atUpdateExtra (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand UpdateExtra method. More... | |
ATCA_STATUS | atVerify (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand ECDSA Verify method. More... | |
ATCA_STATUS | atWrite (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Write method. More... | |
ATCA_STATUS | atWriteEnc (ATCACommand cacmd, ATCAPacket *packet) |
ATCACommand Write encrypted method. More... | |
void | deleteATCACommand (ATCACommand *cacmd) |
ATCACommand destructor. More... | |
ATCA_STATUS | atInitExecTimes (ATCACommand cacmd, ATCADeviceType device_type) |
initialize the execution times for a given device type More... | |
uint16_t | atGetExecTime (ATCACommand cacmd, ATCA_CmdMap cmd) |
return the typical execution type for the given command More... | |
void | atCRC (uint8_t length, uint8_t *data, uint8_t *crc) |
This function calculates CRC given raw data, puts the CRC to given pointer. More... | |
void | atCalcCrc (ATCAPacket *packet) |
This function calculates CRC and adds it to the correct offset in the packet data. More... | |
uint8_t | atCheckCrc (uint8_t *response) |
This function checks the consistency of a response. More... | |
bool | atIsSHAFamily (ATCADeviceType deviceType) |
determines if a given device type is a SHA device or a superset of a SHA device More... | |
bool | atIsECCFamily (ATCADeviceType deviceType) |
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... | |
Variables | |
uint16_t | exectimes_x08a [] |
execution times for x08a family, these are based on the typical value from the datasheet More... | |
uint16_t | exectimes_204a [] |
execution times for 204a, these are based on the typical value from the datasheet More... | |
CryptoAuthLib command builder object, ATCACommand. Member functions for the ATCACommand object.
void atCalcCrc | ( | ATCAPacket * | packet | ) |
This function calculates CRC and adds it to the correct offset in the packet data.
[in] | packet | Packet to calculate CRC data for |
uint8_t atCheckCrc | ( | uint8_t * | response | ) |
This function checks the consistency of a response.
[in] | response | pointer to response |
ATCA_STATUS atCheckMAC | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand CheckMAC method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atCounter | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Counter method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
void atCRC | ( | uint8_t | length, |
uint8_t * | data, | ||
uint8_t * | crc | ||
) |
This function calculates CRC given raw data, puts the CRC to given pointer.
[in] | length | size of data not including the CRC byte positions |
[in] | data | pointer to the data over which to compute the CRC |
[out] | crc | pointer to the place where the two-bytes of CRC will be placed |
ATCA_STATUS atDeriveKey | ( | ATCACommand | cacmd, |
ATCAPacket * | packet, | ||
bool | hasMAC | ||
) |
ATCACommand DeriveKey method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
[in] | hasMAC | hasMAC determines if MAC data is present in the packet input |
ATCA_STATUS atECDH | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand ECDH method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atGenDig | ( | ATCACommand | cacmd, |
ATCAPacket * | packet, | ||
bool | hasMACKey | ||
) |
ATCACommand Generate Digest method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
[in] | hasMACKey |
ATCA_STATUS atGenKey | ( | ATCACommand | cacmd, |
ATCAPacket * | packet, | ||
bool | isPubKey | ||
) |
ATCACommand Generate Key method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
[in] | isPubKey | indicates whether "other data" is present in packet |
uint16_t atGetExecTime | ( | ATCACommand | cacmd, |
ATCA_CmdMap | cmd | ||
) |
return the typical execution type for the given command
[in] | cacmd | the command object for which the execution times are associated |
[in] | cmd | - the specific command for which to lookup the execution time |
ATCA_STATUS atHMAC | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand HMAC method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atInfo | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Info method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atInitExecTimes | ( | ATCACommand | cacmd, |
ATCADeviceType | device_type | ||
) |
initialize the execution times for a given device type
[in] | cacmd | - the command containing the list of execution times for the device |
[in] | device_type | - the device type - execution times vary by device type |
bool atIsECCFamily | ( | ATCADeviceType | deviceType | ) |
determines if a given device type is an ECC device or a superset of a ECC device
[in] | deviceType | - the type of device to check for family type |
bool atIsSHAFamily | ( | ATCADeviceType | deviceType | ) |
determines if a given device type is a SHA device or a superset of a SHA device
[in] | deviceType | - the type of device to check for family type |
ATCA_STATUS atLock | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Lock method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atMAC | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand MAC method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atNonce | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Nonce method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atPause | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Pause method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atPrivWrite | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand PrivWrite method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atRandom | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Random method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atRead | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Read method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atSHA | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand SHA method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atSign | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Sign method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atUpdateExtra | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand UpdateExtra method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atVerify | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand ECDSA Verify method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atWrite | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Write method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
ATCA_STATUS atWriteEnc | ( | ATCACommand | cacmd, |
ATCAPacket * | packet | ||
) |
ATCACommand Write encrypted method.
[in] | cacmd | instance |
[in] | packet | pointer to the packet containing the command being built |
void deleteATCACommand | ( | ATCACommand * | cacmd | ) |
ATCACommand destructor.
[in] | cacmd | instance of a command object |
ATCA_STATUS isATCAError | ( | uint8_t * | data | ) |
checks for basic error frame in data
[in] | data | pointer to received data - expected to be in the form of a CA device response frame |
ATCACommand newATCACommand | ( | ATCADeviceType | device_type | ) |
constructor for ATCACommand
[in] | device_type | - specifies which set of commands and execution times should be associated with this command object |
uint16_t exectimes_204a[] |
execution times for 204a, these are based on the typical value from the datasheet
uint16_t exectimes_x08a[] |
execution times for x08a family, these are based on the typical value from the datasheet