Provides api interfaces to use with ATSHA206A device. More...
#include "atca_status.h"
Macros | |
#define | ATCA_SHA206A_ZONE_WRITE_LOCK 0x20u |
#define | ATCA_SHA206A_DKEY_CONSUMPTION_MASK 0x01u |
#define | ATCA_SHA206A_PKEY_CONSUMPTION_MASK 0x02u |
#define | ATCA_SHA206A_SYMMETRIC_KEY_ID_SLOT 0X07u |
Enumerations | |
enum | { SHA206A_DATA_STORE0 =8 , SHA206A_DATA_STORE1 , SHA206A_DATA_STORE2 } |
Functions | |
ATCA_STATUS | sha206a_diversify_parent_key (uint8_t *parent_key, uint8_t *diversified_key) |
Computes the diversified key based on the parent key provided and device serial number. | |
ATCA_STATUS | sha206a_generate_derive_key (uint8_t *parent_key, uint8_t *derived_key, uint8_t param1, uint16_t param2) |
Generates the derived key based on the parent key and other parameters provided. | |
ATCA_STATUS | sha206a_generate_challenge_response_pair (uint8_t *key, uint8_t *challenge, uint8_t *response) |
Generates the response based on Key and Challenge provided. | |
ATCA_STATUS | sha206a_authenticate (uint8_t *challenge, uint8_t *expected_response, uint8_t *is_authenticated) |
verifies the challenge and provided response using key in device | |
ATCA_STATUS | sha206a_verify_device_consumption (uint8_t *is_consumed) |
verifies the device is fully consumed or not based on Parent and Derived Key use flags. | |
ATCA_STATUS | sha206a_check_dk_useflag_validity (uint8_t *is_consumed) |
verifies Derived Key use flags for consumption | |
ATCA_STATUS | sha206a_check_pk_useflag_validity (uint8_t *is_consumed) |
verifies Parent Key use flags for consumption | |
ATCA_STATUS | sha206a_get_dk_useflag_count (uint8_t *dk_available_count) |
calculates available Derived Key use counts | |
ATCA_STATUS | sha206a_get_pk_useflag_count (uint8_t *pk_available_count) |
calculates available Parent Key use counts | |
ATCA_STATUS | sha206a_get_dk_update_count (uint8_t *dk_update_count) |
Read Derived Key slot update count. It will be wraps around 256. | |
ATCA_STATUS | sha206a_write_data_store (uint8_t slot, uint8_t *data, uint8_t block, uint8_t offset, uint8_t len, bool lock_after_write) |
Update the data store slot with user data and lock it if necessary. | |
ATCA_STATUS | sha206a_read_data_store (uint8_t slot, uint8_t *data, uint8_t offset, uint8_t len) |
Read the data stored in Data store. | |
ATCA_STATUS | sha206a_get_data_store_lock_status (uint8_t slot, uint8_t *is_locked) |
Returns the lock status of the given data store. | |
Provides api interfaces to use with ATSHA206A device.
ATCA_STATUS sha206a_authenticate | ( | uint8_t * | challenge, |
uint8_t * | expected_response, | ||
uint8_t * | is_authenticated | ||
) |
verifies the challenge and provided response using key in device
[in] | challenge | Challenge to be used in the response calculations |
[in] | expected_response | Expected response from the device. |
[out] | is_authenticated | result of expected of response and calcualted response |
ATCA_STATUS sha206a_check_dk_useflag_validity | ( | uint8_t * | is_consumed | ) |
verifies Derived Key use flags for consumption
[out] | is_consumed | indicates if DK is available for consumption. |
ATCA_STATUS sha206a_check_pk_useflag_validity | ( | uint8_t * | is_consumed | ) |
verifies Parent Key use flags for consumption
[out] | is_consumed | indicates if PK is available for consumption |
ATCA_STATUS sha206a_diversify_parent_key | ( | uint8_t * | parent_key, |
uint8_t * | diversified_key | ||
) |
Computes the diversified key based on the parent key provided and device serial number.
[in] | parent_key | parent key to be diversified |
[out] | diversified_key | diversified parent key |
ATCA_STATUS sha206a_generate_challenge_response_pair | ( | uint8_t * | key, |
uint8_t * | challenge, | ||
uint8_t * | response | ||
) |
Generates the response based on Key and Challenge provided.
[in] | key | Input data contains device's key |
[in] | challenge | Input data to be used in challenge response calculation |
[out] | response | response derived from key and challenge |
ATCA_STATUS sha206a_generate_derive_key | ( | uint8_t * | parent_key, |
uint8_t * | derived_key, | ||
uint8_t | param1, | ||
uint16_t | param2 | ||
) |
Generates the derived key based on the parent key and other parameters provided.
[in] | parent_key | Input data contains device's parent key |
[out] | derived_key | Output data derived from parent key |
[in] | param1 | Input data to be used in derive key calculation |
[in] | param2 | Input data to be used in derive key calculation |
ATCA_STATUS sha206a_get_data_store_lock_status | ( | uint8_t | slot, |
uint8_t * | is_locked | ||
) |
Returns the lock status of the given data store.
[in] | slot | Slot number of the data store |
[out] | is_locked | lock status of the data store |
ATCA_STATUS sha206a_get_dk_update_count | ( | uint8_t * | dk_update_count | ) |
Read Derived Key slot update count. It will be wraps around 256.
[out] | dk_update_count | returns number of times the slot has been updated with derived key |
ATCA_STATUS sha206a_get_dk_useflag_count | ( | uint8_t * | dk_available_count | ) |
calculates available Derived Key use counts
[out] | dk_available_count | counts available bit's as 1 |
ATCA_STATUS sha206a_get_pk_useflag_count | ( | uint8_t * | pk_available_count | ) |
calculates available Parent Key use counts
[out] | pk_available_count | counts available bit's as 1 |
ATCA_STATUS sha206a_read_data_store | ( | uint8_t | slot, |
uint8_t * | data, | ||
uint8_t | offset, | ||
uint8_t | len | ||
) |
Read the data stored in Data store.
[in] | slot | Slot number to read from |
[in] | data | Pointer to hold slot data data |
[in] | offset | Byte offset within the zone to read from. |
[in] | len | data length |
ATCA_STATUS sha206a_verify_device_consumption | ( | uint8_t * | is_consumed | ) |
verifies the device is fully consumed or not based on Parent and Derived Key use flags.
[out] | is_consumed | result of device consumption |
ATCA_STATUS sha206a_write_data_store | ( | uint8_t | slot, |
uint8_t * | data, | ||
uint8_t | block, | ||
uint8_t | offset, | ||
uint8_t | len, | ||
bool | lock_after_write | ||
) |
Update the data store slot with user data and lock it if necessary.
[in] | slot | Slot number to be written with data |
[in] | data | Pointer that holds the data |
[in] | block | 32-byte block to write to. |
[in] | offset | 4-byte word within the specified block to write to. If performing a 32-byte write, this should be 0. |
[in] | len | data length |
[in] | lock_after_write | set 1 to lock slot after write, otherwise 0 |