The purpose of this directory is to contain the files implementing the APIs for a basic interface to the core CryptoAuthLib library.High-level functions like these make it very convenient to use the library when standard configurations and defaults are in play. They are the easiest to use when developing examples or trying to understand the "flow" of an authentication operation without getting overwhelmed by the details.This makes simple jobs easy and if you need more sophistication and power, you can employ the full power of the CryptoAuthLib object model.See the Doxygen documentation in cryptoauthlib/docs for details on the API of the calib commands.
|
#define | ATCA_AES_ENABLE_EN_SHIFT (0) |
|
#define | ATCA_AES_ENABLE_EN_MASK (0x01u << ATCA_AES_ENABLE_EN_SHIFT) |
|
#define | ATCA_I2C_ENABLE_EN_SHIFT (0) |
|
#define | ATCA_I2C_ENABLE_EN_MASK (0x01u << ATCA_I2C_ENABLE_EN_SHIFT) |
|
#define | ATCA_COUNTER_MATCH_EN_SHIFT (0) |
|
#define | ATCA_COUNTER_MATCH_EN_MASK (0x01u << ATCA_COUNTER_MATCH_EN_SHIFT) |
|
#define | ATCA_COUNTER_MATCH_KEY_SHIFT (4) |
|
#define | ATCA_COUNTER_MATCH_KEY_MASK (0x0Fu << ATCA_COUNTER_MATCH_KEY_SHIFT) |
|
#define | ATCA_COUNTER_MATCH_KEY(v) (ATCA_COUNTER_MATCH_KEY_MASK & (v << ATCA_COUNTER_MATCH_KEY_SHIFT)) |
|
#define | ATCA_CHIP_MODE_I2C_EXTRA_SHIFT (0) |
|
#define | ATCA_CHIP_MODE_I2C_EXTRA_MASK (0x01u << ATCA_CHIP_MODE_I2C_EXTRA_SHIFT) |
|
#define | ATCA_CHIP_MODE_TTL_EN_SHIFT (1) |
|
#define | ATCA_CHIP_MODE_TTL_EN_MASK (0x01u << ATCA_CHIP_MODE_TTL_EN_SHIFT) |
|
#define | ATCA_CHIP_MODE_WDG_LONG_SHIFT (2) |
|
#define | ATCA_CHIP_MODE_WDG_LONG_MASK (0x01u << ATCA_CHIP_MODE_WDG_LONG_SHIFT) |
|
#define | ATCA_CHIP_MODE_CLK_DIV_SHIFT (3) |
|
#define | ATCA_CHIP_MODE_CLK_DIV_MASK (0x1Fu << ATCA_CHIP_MODE_CLK_DIV_SHIFT) |
|
#define | ATCA_CHIP_MODE_CLK_DIV(v) (ATCA_CHIP_MODE_CLK_DIV_MASK & (v << ATCA_CHIP_MODE_CLK_DIV_SHIFT)) |
|
#define | ATCA_SLOT_CONFIG_READKEY_SHIFT (0) |
|
#define | ATCA_SLOT_CONFIG_READKEY_MASK (0x0Fu << ATCA_SLOT_CONFIG_READKEY_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_READKEY(v) (ATCA_SLOT_CONFIG_READKEY_MASK & (v << ATCA_SLOT_CONFIG_READKEY_SHIFT)) |
|
#define | ATCA_SLOT_CONFIG_NOMAC_SHIFT (4) |
|
#define | ATCA_SLOT_CONFIG_NOMAC_MASK (0x01u << ATCA_SLOT_CONFIG_NOMAC_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_LIMITED_USE_SHIFT (5) |
|
#define | ATCA_SLOT_CONFIG_LIMITED_USE_MASK (0x01u << ATCA_SLOT_CONFIG_LIMITED_USE_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_ENC_READ_SHIFT (6) |
|
#define | ATCA_SLOT_CONFIG_ENC_READ_MASK (0x01u << ATCA_SLOT_CONFIG_ENC_READ_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_IS_SECRET_SHIFT (7) |
|
#define | ATCA_SLOT_CONFIG_IS_SECRET_MASK (0x01u << ATCA_SLOT_CONFIG_IS_SECRET_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_WRITE_KEY_SHIFT (8) |
|
#define | ATCA_SLOT_CONFIG_WRITE_KEY_MASK ((uint32_t)0x0Fu << ATCA_SLOT_CONFIG_WRITE_KEY_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_WRITE_KEY(v) (ATCA_SLOT_CONFIG_WRITE_KEY_MASK & (v << ATCA_SLOT_CONFIG_WRITE_KEY_SHIFT)) |
|
#define | ATCA_SLOT_CONFIG_WRITE_CONFIG_SHIFT (12) |
|
#define | ATCA_SLOT_CONFIG_WRITE_CONFIG_MASK (((uint32_t)0x0Fu << ATCA_SLOT_CONFIG_WRITE_CONFIG_SHIFT)) |
|
#define | ATCA_SLOT_CONFIG_WRITE_CONFIG(v) ((ATCA_SLOT_CONFIG_WRITE_CONFIG_MASK & ((uint32_t)(v) << ATCA_SLOT_CONFIG_WRITE_CONFIG_SHIFT))) |
|
#define | ATCA_SLOT_CONFIG_EXT_SIG_SHIFT (0) |
|
#define | ATCA_SLOT_CONFIG_EXT_SIG_MASK (0x01u << ATCA_SLOT_CONFIG_EXT_SIG_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_INT_SIG_SHIFT (1) |
|
#define | ATCA_SLOT_CONFIG_INT_SIG_MASK (0x01u << ATCA_SLOT_CONFIG_INT_SIG_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_ECDH_SHIFT (2) |
|
#define | ATCA_SLOT_CONFIG_ECDH_MASK (0x01u << ATCA_SLOT_CONFIG_ECDH_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_WRITE_ECDH_SHIFT (3) |
|
#define | ATCA_SLOT_CONFIG_WRITE_ECDH_MASK (0x01u << ATCA_SLOT_CONFIG_WRITE_ECDH_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_GEN_KEY_SHIFT (8) |
|
#define | ATCA_SLOT_CONFIG_GEN_KEY_MASK (0x01u << ATCA_SLOT_CONFIG_GEN_KEY_SHIFT) |
|
#define | ATCA_SLOT_CONFIG_PRIV_WRITE_SHIFT (9) |
|
#define | ATCA_SLOT_CONFIG_PRIV_WRITE_MASK (0x01u << ATCA_SLOT_CONFIG_PRIV_WRITE_SHIFT) |
|
#define | ATCA_USE_LOCK_ENABLE_SHIFT (0) |
|
#define | ATCA_USE_LOCK_ENABLE_MASK (0x0Fu << ATCA_USE_LOCK_ENABLE_SHIFT) |
|
#define | ATCA_USE_LOCK_KEY_SHIFT (4) |
|
#define | ATCA_USE_LOCK_KEY_MASK (0x0Fu << ATCA_USE_LOCK_KEY_SHIFT) |
|
#define | ATCA_VOL_KEY_PERM_SLOT_SHIFT (0) |
|
#define | ATCA_VOL_KEY_PERM_SLOT_MASK (0x0Fu << ATCA_VOL_KEY_PERM_SLOT_SHIFT) |
|
#define | ATCA_VOL_KEY_PERM_SLOT(v) (ATCA_VOL_KEY_PERM_SLOT_MASK & (v << ATCA_VOL_KEY_PERM_SLOT_SHIFT)) |
|
#define | ATCA_VOL_KEY_PERM_EN_SHIFT (7) |
|
#define | ATCA_VOL_KEY_PERM_EN_MASK (0x01u << ATCA_VOL_KEY_PERM_EN_SHIFT) |
|
#define | ATCA_SECURE_BOOT_MODE_SHIFT (0) |
|
#define | ATCA_SECURE_BOOT_MODE_MASK (0x03u << ATCA_SECURE_BOOT_MODE_SHIFT) |
|
#define | ATCA_SECURE_BOOT_MODE(v) (ATCA_SECURE_BOOT_MODE_MASK & (v << ATCA_SECURE_BOOT_MODE_SHIFT)) |
|
#define | ATCA_SECURE_BOOT_PERSIST_EN_SHIFT (3) |
|
#define | ATCA_SECURE_BOOT_PERSIST_EN_MASK (0x01u << ATCA_SECURE_BOOT_PERSIST_EN_SHIFT) |
|
#define | ATCA_SECURE_BOOT_RAND_NONCE_SHIFT (4) |
|
#define | ATCA_SECURE_BOOT_RAND_NONCE_MASK (0x01u << ATCA_SECURE_BOOT_RAND_NONCE_SHIFT) |
|
#define | ATCA_SECURE_BOOT_DIGEST_SHIFT (8) |
|
#define | ATCA_SECURE_BOOT_DIGEST_MASK (0x0Fu << ATCA_SECURE_BOOT_DIGEST_SHIFT) |
|
#define | ATCA_SECURE_BOOT_DIGEST(v) (ATCA_SECURE_BOOT_DIGEST_MASK & (v << ATCA_SECURE_BOOT_DIGEST_SHIFT)) |
|
#define | ATCA_SECURE_BOOT_PUB_KEY_SHIFT (12) |
|
#define | ATCA_SECURE_BOOT_PUB_KEY_MASK (0x0Fu << ATCA_SECURE_BOOT_PUB_KEY_SHIFT) |
|
#define | ATCA_SECURE_BOOT_PUB_KEY(v) (ATCA_SECURE_BOOT_PUB_KEY_MASK & (v << ATCA_SECURE_BOOT_PUB_KEY_SHIFT)) |
|
#define | ATCA_SLOT_LOCKED(v) ((0x01 << v) & 0xFFFFu) |
|
#define | ATCA_CHIP_OPT_POST_EN_SHIFT (0) |
|
#define | ATCA_CHIP_OPT_POST_EN_MASK (0x01u << ATCA_CHIP_OPT_POST_EN_SHIFT) |
|
#define | ATCA_CHIP_OPT_IO_PROT_EN_SHIFT (1) |
|
#define | ATCA_CHIP_OPT_IO_PROT_EN_MASK (0x01u << ATCA_CHIP_OPT_IO_PROT_EN_SHIFT) |
|
#define | ATCA_CHIP_OPT_KDF_AES_EN_SHIFT (2) |
|
#define | ATCA_CHIP_OPT_KDF_AES_EN_MASK (0x01u << ATCA_CHIP_OPT_KDF_AES_EN_SHIFT) |
|
#define | ATCA_CHIP_OPT_ECDH_PROT_SHIFT (8) |
|
#define | ATCA_CHIP_OPT_ECDH_PROT_MASK (0x03u << ATCA_CHIP_OPT_ECDH_PROT_SHIFT) |
|
#define | ATCA_CHIP_OPT_ECDH_PROT(v) (ATCA_CHIP_OPT_ECDH_PROT_MASK & (v << ATCA_CHIP_OPT_ECDH_PROT_SHIFT)) |
|
#define | ATCA_CHIP_OPT_KDF_PROT_SHIFT (10) |
|
#define | ATCA_CHIP_OPT_KDF_PROT_MASK (0x03u << ATCA_CHIP_OPT_KDF_PROT_SHIFT) |
|
#define | ATCA_CHIP_OPT_KDF_PROT(v) (ATCA_CHIP_OPT_KDF_PROT_MASK & (v << ATCA_CHIP_OPT_KDF_PROT_SHIFT)) |
|
#define | ATCA_CHIP_OPT_IO_PROT_KEY_SHIFT (12) |
|
#define | ATCA_CHIP_OPT_IO_PROT_KEY_MASK ((uint16_t)0x0Fu << ATCA_CHIP_OPT_IO_PROT_KEY_SHIFT) |
|
#define | ATCA_CHIP_OPT_IO_PROT_KEY(v) (ATCA_CHIP_OPT_IO_PROT_KEY_MASK & (v << ATCA_CHIP_OPT_IO_PROT_KEY_SHIFT)) |
|
#define | ATCA_KEY_CONFIG_OFFSET(x) (96UL + (x) * 2u) |
|
#define | ATCA_KEY_CONFIG_PRIVATE_SHIFT (0) |
|
#define | ATCA_KEY_CONFIG_PRIVATE_MASK (0x01u << ATCA_KEY_CONFIG_PRIVATE_SHIFT) |
|
#define | ATCA_KEY_CONFIG_PUB_INFO_SHIFT (1) |
|
#define | ATCA_KEY_CONFIG_PUB_INFO_MASK (0x01u << ATCA_KEY_CONFIG_PUB_INFO_SHIFT) |
|
#define | ATCA_KEY_CONFIG_KEY_TYPE_SHIFT (2) |
|
#define | ATCA_KEY_CONFIG_KEY_TYPE_MASK ((0x07u << ATCA_KEY_CONFIG_KEY_TYPE_SHIFT)) |
|
#define | ATCA_KEY_CONFIG_KEY_TYPE(v) ((ATCA_KEY_CONFIG_KEY_TYPE_MASK & ((v) << ATCA_KEY_CONFIG_KEY_TYPE_SHIFT))) |
|
#define | ATCA_KEY_CONFIG_LOCKABLE_SHIFT (5) |
|
#define | ATCA_KEY_CONFIG_LOCKABLE_MASK (0x01u << ATCA_KEY_CONFIG_LOCKABLE_SHIFT) |
|
#define | ATCA_KEY_CONFIG_REQ_RANDOM_SHIFT (6) |
|
#define | ATCA_KEY_CONFIG_REQ_RANDOM_MASK (0x01u << ATCA_KEY_CONFIG_REQ_RANDOM_SHIFT) |
|
#define | ATCA_KEY_CONFIG_REQ_AUTH_SHIFT (7) |
|
#define | ATCA_KEY_CONFIG_REQ_AUTH_MASK (0x01u << ATCA_KEY_CONFIG_REQ_AUTH_SHIFT) |
|
#define | ATCA_KEY_CONFIG_AUTH_KEY_SHIFT (8) |
|
#define | ATCA_KEY_CONFIG_AUTH_KEY_MASK (0x0Fu << ATCA_KEY_CONFIG_AUTH_KEY_SHIFT) |
|
#define | ATCA_KEY_CONFIG_AUTH_KEY(v) (ATCA_KEY_CONFIG_AUTH_KEY_MASK & (v << ATCA_KEY_CONFIG_AUTH_KEY_SHIFT)) |
|
#define | ATCA_KEY_CONFIG_PERSIST_DIS_SHIFT (12) |
|
#define | ATCA_KEY_CONFIG_PERSIST_DIS_MASK (0x01u << ATCA_KEY_CONFIG_PERSIST_DIS_SHIFT) |
|
#define | ATCA_KEY_CONFIG_RFU_SHIFT (13) |
|
#define | ATCA_KEY_CONFIG_RFU_MASK (0x01u << ATCA_KEY_CONFIG_RFU_SHIFT) |
|
#define | ATCA_KEY_CONFIG_X509_ID_SHIFT (14) |
|
#define | ATCA_KEY_CONFIG_X509_ID_MASK (0x03u << ATCA_KEY_CONFIG_X509_ID_SHIFT) |
|
#define | ATCA_KEY_CONFIG_X509_ID(v) (ATCA_KEY_CONFIG_X509_ID_MASK & (v << ATCA_KEY_CONFIG_X509_ID_SHIFT)) |
|
|
ATCA_STATUS | calib_wakeup_i2c (ATCADevice device) |
| basic API methods are all prefixed with atcab_ (CryptoAuthLib Basic) the fundamental premise of the basic API is it is based on a single interface instance and that instance is global, so all basic API commands assume that one global device is the one to operate on.
|
|
ATCA_STATUS | calib_wakeup (ATCADevice device) |
| wakeup the CryptoAuth device
|
|
ATCA_STATUS | calib_idle (ATCADevice device) |
| idle the CryptoAuth device
|
|
ATCA_STATUS | calib_sleep (ATCADevice device) |
| invoke sleep on the CryptoAuth device
|
|
ATCA_STATUS | calib_exit (ATCADevice device) |
| common cleanup code which idles the device after any operation
|
|
ATCA_STATUS | calib_get_addr (uint8_t zone, uint16_t slot, uint8_t block, uint8_t offset, uint16_t *addr) |
| Compute the address given the zone, slot, block, and offset.
|
|
ATCA_STATUS | calib_get_zone_size (ATCADevice device, uint8_t zone, uint16_t slot, size_t *size) |
| Gets the size of the specified zone in bytes.
|
|
ATCA_STATUS | calib_ca2_get_addr (uint8_t zone, uint16_t slot, uint8_t block, uint8_t offset, uint16_t *addr) |
| Compute the address given the zone, slot, block, and offset for the device.
|
|
ATCA_STATUS | calib_is_locked (ATCADevice device, uint8_t zone, bool *is_locked) |
|
ATCA_STATUS | calib_is_slot_locked (ATCADevice device, uint16_t slot, bool *is_locked) |
|
ATCA_STATUS | calib_ca2_is_locked (ATCADevice device, uint8_t zone, bool *is_locked) |
| Use Info command to check config/data is locked or not.
|
|
ATCA_STATUS | calib_ca2_is_data_locked (ATCADevice device, bool *is_locked) |
| Use Info command to check ECC204 Data zone lock status.
|
|
ATCA_STATUS | calib_ca2_is_config_locked (ATCADevice device, bool *is_locked) |
| Executes Read command, which reads the configuration zone to see if the specified slot is locked.
|
|
ATCADeviceType | calib_get_devicetype (uint8_t revision[4]) |
| Parse the revision field to get the device type.
|
|
ATCADeviceType | calib_get_devicetype_with_device_id (uint8_t device_id, uint8_t device_revision) |
|
ATCA_STATUS | calib_info_base (ATCADevice device, uint8_t mode, uint16_t param2, uint8_t *out_data) |
| Issues an Info command, which return internal device information and can control GPIO and the persistent latch.
|
|
ATCA_STATUS | calib_info (ATCADevice device, uint8_t *revision) |
| Use the Info command to get the device revision (DevRev).
|
|
ATCA_STATUS | calib_info_privkey_valid (ATCADevice device, uint16_t key_id, uint8_t *is_valid) |
| Use Info command to check ECC Private key stored in key slot is valid or not.
|
|
ATCA_STATUS | calib_info_lock_status (ATCADevice device, uint16_t param2, uint8_t *is_locked) |
| Use Info command to ECC204,TA010 config/data zone lock status.
|
|
ATCA_STATUS | calib_info_chip_status (ATCADevice device, uint8_t *chip_status) |
| Use Info command to get ECC204,TA010,SHA10x chip status.
|
|
These methods provide a simple API to CryptoAuth chips.