Skip to content

Commit

Permalink
Added Supported for Cryptoauthlibv3.2.2 and tested for all solutions.
Browse files Browse the repository at this point in the history
  • Loading branch information
MCHP-Shan committed Jul 31, 2020
1 parent 6ca5cff commit a84cac6
Show file tree
Hide file tree
Showing 481 changed files with 20,809 additions and 16,922 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@
<logicalFolder name="f2" displayName="libraries" projectFiles="true">
<logicalFolder name="f3" displayName="3rdparty" projectFiles="true">
<logicalFolder name="f1" displayName="http_parser" projectFiles="true">
<itemPath>../../../../../../../libraries/3rdparty/http_parser/.git</itemPath>
<itemPath>../../../../../../../libraries/3rdparty/http_parser/.mailmap</itemPath>
<itemPath>../../../../../../../libraries/3rdparty/http_parser/.travis.yml</itemPath>
<itemPath>../../../../../../../libraries/3rdparty/http_parser/AUTHORS</itemPath>
Expand Down Expand Up @@ -434,7 +433,6 @@
</logicalFolder>
</logicalFolder>
<logicalFolder name="f4" displayName="pkcs11" projectFiles="true">
<itemPath>../../../../../../../libraries/3rdparty/pkcs11/.git</itemPath>
<itemPath>../../../../../../../libraries/3rdparty/pkcs11/pkcs11.h</itemPath>
<itemPath>../../../../../../../libraries/3rdparty/pkcs11/pkcs11f.h</itemPath>
<itemPath>../../../../../../../libraries/3rdparty/pkcs11/pkcs11t.h</itemPath>
Expand Down Expand Up @@ -1062,7 +1060,7 @@
<itemPath>../src/config/aws_demos/library/cryptoauthlib/crypto/atca_crypto_sw_sha2.h</itemPath>
</logicalFolder>
<logicalFolder name="f1" displayName="hal" projectFiles="true">
<itemPath>../src/config/aws_demos/library/cryptoauthlib/hal/ATECC608A_0.c</itemPath>
<itemPath>../src/config/aws_demos/library/cryptoauthlib/hal/ATECC608_0.c</itemPath>
<itemPath>../src/config/aws_demos/library/cryptoauthlib/hal/atca_hal.c</itemPath>
<itemPath>../src/config/aws_demos/library/cryptoauthlib/hal/atca_hal.h</itemPath>
<itemPath>../src/config/aws_demos/library/cryptoauthlib/hal/atca_start_config.h</itemPath>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,20 @@


project: aws_demos
creation_date: 2020-07-16T10:43:54.436+05:30[Asia/Calcutta] # ISO 8601 format: https://www.w3.org/TR/NOTE-datetime
creation_date: 2020-07-31T12:00:32.413+05:30[Asia/Calcutta] # ISO 8601 format: https://www.w3.org/TR/NOTE-datetime
operating_system: Windows 10
mhc_mode: IDE # [IDE|Standalone|Headless]
mplabx_version: --Please Update your plugin-- # if MPLAB X plugin only
plugin_version: v3.4.2 # if MPLAB X plugin only
mplabx_version: v5.35 # if MPLAB X plugin only
plugin_version: v3.5.1 # if MPLAB X plugin only

modules:
- {name: "amazon-freertos", version: "unknown"}
- {name: "aws_cloud", version: "v3.0.0"}
- {name: "bsp", version: "v3.7.0"}
- {name: "CMSIS-FreeRTOS", version: "unknown"}
- {name: "contentmanager", version: "v1.3.1"}
- {name: "core", version: "v3.7.2"}
- {name: "crypto", version: "v3.5.0"}
- {name: "cryptoauthlib", version: "v3.2.1"}
- {name: "cryptoauthlib", version: "v3.2.2"}
- {name: "csp", version: "v3.7.1"}
- {name: "core", version: "v3.7.2"}
- {name: "dev_packs", version: "v3.7.0"}
- {name: "mhc", version: "v3.4.0"}
- {name: "mplabx-plugin", version: "v3.5.0"}
- {name: "amazon-freertos", version: "unknown"}
- {name: "mhc", version: "unknown"}
- {name: "aws_cloud", version: "unknown"}
- {name: "net", version: "v3.6.1"}
- {name: "wireless", version: "v3.2.0-rc2"}
- {name: "wolfMQTT", version: "v1.2.0"}
- {name: "wolfssl", version: "v4.3.0"}
- {name: "zlib", version: "v1.2.11"}
- {name: "bsp", version: "v3.7.0"}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ ATCA_STATUS atcab_init_ext(ATCADevice* device, ATCAIfaceCfg *cfg)
}
#endif

#ifdef ATCA_ATECC608A_SUPPORT
if (cfg->devtype == ATECC608A)
#ifdef ATCA_ATECC608_SUPPORT
if (cfg->devtype == ATECC608)
{
if ((status = atcab_read_bytes_zone(ATCA_ZONE_CONFIG, 0, ATCA_CHIPMODE_OFFSET, &(*device)->mCommands->clock_divider, 1)) != ATCA_SUCCESS)
if ((status = calib_read_bytes_zone(*device, ATCA_ZONE_CONFIG, 0, ATCA_CHIPMODE_OFFSET, &(*device)->mCommands->clock_divider, 1)) != ATCA_SUCCESS)
{
return status;
}
Expand Down Expand Up @@ -368,7 +368,7 @@ ATCA_STATUS atcab_aes(uint8_t mode, uint16_t key_id, const uint8_t* aes_in, uint

if (atcab_is_ca_device(dev_type))
{
#if defined(ATCA_ATECC608A_SUPPORT)
#if defined(ATCA_ATECC608_SUPPORT)
status = calib_aes(_gDevice, mode, key_id, aes_in, aes_out);
#endif
}
Expand Down Expand Up @@ -402,7 +402,7 @@ ATCA_STATUS atcab_aes_encrypt_ext(ATCADevice device, uint16_t key_id, uint8_t ke

if (atcab_is_ca_device(dev_type))
{
#if defined(ATCA_ATECC608A_SUPPORT)
#if defined(ATCA_ATECC608_SUPPORT)
status = calib_aes_encrypt(device, key_id, key_block, plaintext, ciphertext);
#endif
}
Expand Down Expand Up @@ -454,7 +454,7 @@ ATCA_STATUS atcab_aes_decrypt_ext(ATCADevice device, uint16_t key_id, uint8_t ke

if (atcab_is_ca_device(dev_type))
{
#if defined(ATCA_ATECC608A_SUPPORT)
#if defined(ATCA_ATECC608_SUPPORT)
status = calib_aes_decrypt(device, key_id, key_block, ciphertext, plaintext);
#endif
}
Expand Down Expand Up @@ -502,7 +502,7 @@ ATCA_STATUS atcab_aes_gfm(const uint8_t* h, const uint8_t* input, uint8_t* outpu

if (atcab_is_ca_device(dev_type))
{
#if defined(ATCA_ATECC608A_SUPPORT)
#if defined(ATCA_ATECC608_SUPPORT)
status = calib_aes_gfm(_gDevice, h, input, output);
#endif
}
Expand Down Expand Up @@ -596,7 +596,7 @@ ATCA_STATUS atcab_aes_gcm_init_rand(atca_aes_gcm_ctx_t* ctx, uint16_t key_id, ui
}

/** \brief Process Additional Authenticated Data (AAD) using GCM mode and a
* key within the ATECC608A device.
* key within the ATECC608 device.
*
* This can be called multiple times. atcab_aes_gcm_init() or
* atcab_aes_gcm_init_rand() should be called before the first use of this
Expand Down Expand Up @@ -631,7 +631,7 @@ ATCA_STATUS atcab_aes_gcm_aad_update(atca_aes_gcm_ctx_t* ctx, const uint8_t* aad
return status;
}

/** \brief Encrypt data using GCM mode and a key within the ATECC608A device.
/** \brief Encrypt data using GCM mode and a key within the ATECC608 device.
* atcab_aes_gcm_init() or atcab_aes_gcm_init_rand() should be called
* before the first use of this function.
*
Expand Down Expand Up @@ -694,7 +694,7 @@ ATCA_STATUS atcab_aes_gcm_encrypt_finish(atca_aes_gcm_ctx_t* ctx, uint8_t* tag,
return status;
}

/** \brief Decrypt data using GCM mode and a key within the ATECC608A device.
/** \brief Decrypt data using GCM mode and a key within the ATECC608 device.
* atcab_aes_gcm_init() or atcab_aes_gcm_init_rand() should be called
* before the first use of this function.
*
Expand Down Expand Up @@ -1056,7 +1056,7 @@ ATCA_STATUS atcab_ecdh_ioenc(uint16_t key_id, const uint8_t* public_key, uint8_t

if (atcab_is_ca_device(dev_type))
{
#ifdef ATCA_ATECC608A_SUPPORT
#ifdef ATCA_ATECC608_SUPPORT
status = calib_ecdh_ioenc(_gDevice, key_id, public_key, pms, io_key);
#endif
}
Expand Down Expand Up @@ -1089,7 +1089,7 @@ ATCA_STATUS atcab_ecdh_tempkey(const uint8_t* public_key, uint8_t* pms)

if (atcab_is_ca_device(dev_type))
{
#ifdef ATCA_ATECC608A_SUPPORT
#ifdef ATCA_ATECC608_SUPPORT
status = calib_ecdh_tempkey(_gDevice, public_key, pms);
#endif
}
Expand Down Expand Up @@ -1123,7 +1123,7 @@ ATCA_STATUS atcab_ecdh_tempkey_ioenc(const uint8_t* public_key, uint8_t* pms, co

if (atcab_is_ca_device(dev_type))
{
#ifdef ATCA_ATECC608A_SUPPORT
#ifdef ATCA_ATECC608_SUPPORT
status = calib_ecdh_tempkey_ioenc(_gDevice, public_key, pms, io_key);
#endif
}
Expand Down Expand Up @@ -1383,7 +1383,7 @@ ATCA_STATUS atcab_info(uint8_t* revision)
}

/** \brief Use the Info command to set the persistent latch state for an
* ATECC608A device.
* ATECC608 device.
*
* \param[out] state Persistent latch state. Set (true) or clear (false).
*
Expand Down Expand Up @@ -1412,7 +1412,7 @@ ATCA_STATUS atcab_info_set_latch(bool state)
}

/** \brief Use the Info command to get the persistent latch current state for
* an ATECC608A device.
* an ATECC608 device.
*
* \param[out] state The state is returned here. Set (true) or Cler (false).
*
Expand Down Expand Up @@ -1731,7 +1731,7 @@ ATCA_STATUS atcab_mac(uint8_t mode, uint16_t key_id, const uint8_t* challenge, u
* nonce calculation mode (bit 15).
* \param[in] num_in Input value to either be included in the nonce
* calculation in random modes (20 bytes) or to be
* written directly (32 bytes or 64 bytes(ATECC608A))
* written directly (32 bytes or 64 bytes(ATECC608))
* in pass-through mode.
* \param[out] rand_out If using a random mode, the internally generated
* 32-byte random number that was used in the nonce
Expand Down Expand Up @@ -1794,7 +1794,7 @@ ATCA_STATUS atcab_nonce(const uint8_t* num_in)
/** \brief Execute a Nonce command in pass-through mode to load one of the
* device's internal buffers with a fixed value.
*
* For the ATECC608A, available targets are TempKey (32 or 64 bytes), Message
* For the ATECC608, available targets are TempKey (32 or 64 bytes), Message
* Digest Buffer (32 or 64 bytes), or the Alternate Key Buffer (32 bytes). For
* all other devices, only TempKey (32 bytes) is available.
*
Expand Down Expand Up @@ -2472,7 +2472,7 @@ ATCA_STATUS atcab_secureboot(uint8_t mode, uint16_t param2, const uint8_t* diges

if (atcab_is_ca_device(dev_type))
{
#ifdef ATCA_ATECC608A_SUPPORT
#ifdef ATCA_ATECC608_SUPPORT
status = calib_secureboot(_gDevice, mode, param2, digest, signature, mac);
#endif
}
Expand Down Expand Up @@ -2509,7 +2509,7 @@ ATCA_STATUS atcab_secureboot_mac(uint8_t mode, const uint8_t* digest, const uint

if (atcab_is_ca_device(dev_type))
{
#ifdef ATCA_ATECC608A_SUPPORT
#ifdef ATCA_ATECC608_SUPPORT
status = calib_secureboot_mac(_gDevice, mode, digest, signature, num_in, io_key, is_verified);
#endif
}
Expand All @@ -2527,7 +2527,7 @@ ATCA_STATUS atcab_secureboot_mac(uint8_t mode, const uint8_t* digest, const uint
/* SelfTest Command */

/** \brief Executes the SelfTest command, which performs a test of one or more
* of the cryptographic engines within the ATECC608A chip.
* of the cryptographic engines within the ATECC608 chip.
*
* \param[in] mode Functions to test. Can be a bit field combining any
* of the following: SELFTEST_MODE_RNG,
Expand All @@ -2546,7 +2546,7 @@ ATCA_STATUS atcab_selftest(uint8_t mode, uint16_t param2, uint8_t* result)

if (atcab_is_ca_device(dev_type))
{
#ifdef ATCA_ATECC608A_SUPPORT
#ifdef ATCA_ATECC608_SUPPORT
status = calib_selftest(_gDevice, mode, param2, result);
#endif
}
Expand All @@ -2572,12 +2572,12 @@ ATCA_STATUS atcab_selftest(uint8_t mode, uint16_t param2, uint8_t* result)
* End(2), Public(3), HMACstart(4), HMACend(5),
* Read_Context(6), or Write_Context(7). Also
* message digest target location for the
* ATECC608A.
* ATECC608.
* \param[in] length Number of bytes in the message parameter or
* KeySlot for the HMAC key if Mode is
* HMACstart(4) or Public(3).
* \param[in] data_in Message bytes to be hashed or Write_Context if
* restoring a context on the ATECC608A. Can be
* restoring a context on the ATECC608. Can be
* NULL if not required by the mode.
* \param[out] data_out Data returned by the command (digest or
* context).
Expand Down Expand Up @@ -2704,7 +2704,7 @@ ATCA_STATUS atcab_sha_end(uint8_t* digest, uint16_t length, const uint8_t* messa
}

/** \brief Executes SHA command to read the SHA-256 context back. Only for
* ATECC608A with SHA-256 contexts. HMAC not supported.
* ATECC608 with SHA-256 contexts. HMAC not supported.
*
* \param[out] context Context data is returned here.
* \param[in,out] context_size As input, the size of the context buffer in
Expand Down Expand Up @@ -2738,7 +2738,7 @@ ATCA_STATUS atcab_sha_read_context(uint8_t* context, uint16_t* context_size)
}

/** \brief Executes SHA command to write (restore) a SHA-256 context into the
* the device. Only supported for ATECC608A with SHA-256 contexts.
* the device. Only supported for ATECC608 with SHA-256 contexts.
*
* \param[in] context Context data to be restored.
* \param[in] context_size Size of the context data in bytes.
Expand Down Expand Up @@ -2988,7 +2988,7 @@ ATCA_STATUS atcab_sha_hmac_update(atca_hmac_sha256_ctx_t* ctx, const uint8_t* da
* \param[in] ctx HMAC/SHA-256 context
* \param[out] digest HMAC/SHA-256 result is returned here (32 bytes).
* \param[in] target Where to save the digest internal to the device.
* For ATECC608A, can be SHA_MODE_TARGET_TEMPKEY,
* For ATECC608, can be SHA_MODE_TARGET_TEMPKEY,
* SHA_MODE_TARGET_MSGDIGBUF, or SHA_MODE_TARGET_OUT_ONLY.
* For all other devices, SHA_MODE_TARGET_TEMPKEY is the
* only option.
Expand Down Expand Up @@ -3024,7 +3024,7 @@ ATCA_STATUS atcab_sha_hmac_finish(atca_hmac_sha256_ctx_t* ctx, uint8_t* digest,
* \param[in] key_slot Slot key id to use for the HMAC calculation
* \param[out] digest Digest is returned here (32 bytes).
* \param[in] target Where to save the digest internal to the device.
* For ATECC608A, can be SHA_MODE_TARGET_TEMPKEY,
* For ATECC608, can be SHA_MODE_TARGET_TEMPKEY,
* SHA_MODE_TARGET_MSGDIGBUF, or
* SHA_MODE_TARGET_OUT_ONLY. For all other devices,
* SHA_MODE_TARGET_TEMPKEY is the only option.
Expand Down Expand Up @@ -3095,7 +3095,7 @@ ATCA_STATUS atcab_sign_base(uint8_t mode, uint16_t key_id, uint8_t* signature)
/** \brief Executes Sign command, to sign a 32-byte external message using the
* private key in the specified slot. The message to be signed
* will be loaded into the Message Digest Buffer to the
* ATECC608A device or TempKey for other devices.
* ATECC608 device or TempKey for other devices.
*
* \param[in] key_id Slot of the private key to be used to sign the
* message.
Expand Down Expand Up @@ -3211,7 +3211,7 @@ ATCA_STATUS atcab_updateextra(uint8_t mode, uint16_t new_value)
* public key. In all cases, the signature is an input to the command.
*
* For the Stored, External, and ValidateExternal Modes, the contents of
* TempKey (or Message Digest Buffer in some cases for the ATECC608A) should
* TempKey (or Message Digest Buffer in some cases for the ATECC608) should
* contain the 32 byte message.
*
* \param[in] mode Verify command mode and options
Expand Down Expand Up @@ -3261,7 +3261,7 @@ ATCA_STATUS atcab_verify(uint8_t mode, uint16_t key_id, const uint8_t* signature
/** \brief Executes the Verify command, which verifies a signature (ECDSA
* verify operation) with all components (message, signature, and
* public key) supplied. The message to be signed will be loaded into
* the Message Digest Buffer to the ATECC608A device or TempKey for
* the Message Digest Buffer to the ATECC608 device or TempKey for
* other devices.
*
* \param[in] message 32 byte message to be verified. Typically
Expand Down Expand Up @@ -3304,7 +3304,7 @@ ATCA_STATUS atcab_verify_extern(const uint8_t* message, const uint8_t* signature
/** \brief Executes the Verify command with verification MAC, which verifies a
* signature (ECDSA verify operation) with all components (message,
* signature, and public key) supplied. This function is only available
* on the ATECC608A.
* on the ATECC608.
*
* \param[in] message 32 byte message to be verified. Typically
* the SHA256 hash of the full message.
Expand Down Expand Up @@ -3347,7 +3347,7 @@ ATCA_STATUS atcab_verify_extern_mac(const uint8_t* message, const uint8_t* signa
/** \brief Executes the Verify command, which verifies a signature (ECDSA
* verify operation) with a public key stored in the device. The
* message to be signed will be loaded into the Message Digest Buffer
* to the ATECC608A device or TempKey for other devices.
* to the ATECC608 device or TempKey for other devices.
*
* \param[in] message 32 byte message to be verified. Typically
* the SHA256 hash of the full message.
Expand Down Expand Up @@ -3387,7 +3387,7 @@ ATCA_STATUS atcab_verify_stored(const uint8_t* message, const uint8_t* signature

/** \brief Executes the Verify command with verification MAC, which verifies a
* signature (ECDSA verify operation) with a public key stored in the
* device. This function is only available on the ATECC608A.
* device. This function is only available on the ATECC608.
*
* \param[in] message 32 byte message to be verified. Typically
* the SHA256 hash of the full message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/** \brief default configuration for an ECCx08A device */
ATCAIfaceCfg cfg_ateccx08a_i2c_default = {
.iface_type = ATCA_I2C_IFACE,
.devtype = ATECC608A,
.devtype = ATECC608,
{
.atcai2c.slave_address = 0xC0,
.atcai2c.bus = 2,
Expand All @@ -57,7 +57,7 @@ ATCAIfaceCfg cfg_ateccx08a_i2c_default = {
/** \brief default configuration for an ECCx08A device on the logical SWI bus over UART*/
ATCAIfaceCfg cfg_ateccx08a_swi_default = {
.iface_type = ATCA_SWI_IFACE,
.devtype = ATECC608A,
.devtype = ATECC608,
{
.atcaswi.bus = 4,
},
Expand All @@ -70,7 +70,7 @@ ATCAIfaceCfg cfg_ateccx08a_swi_default = {
/** \brief default configuration for Kit protocol over the device's async interface */
ATCAIfaceCfg cfg_ateccx08a_kitcdc_default = {
.iface_type = ATCA_UART_IFACE,
.devtype = ATECC608A,
.devtype = ATECC608,
{
.atcauart.port = 0,
.atcauart.baud = 115200,
Expand All @@ -86,7 +86,7 @@ ATCAIfaceCfg cfg_ateccx08a_kitcdc_default = {
/** \brief default configuration for Kit protocol over the device's async interface */
ATCAIfaceCfg cfg_ateccx08a_kithid_default = {
.iface_type = ATCA_HID_IFACE,
.devtype = ATECC608A,
.devtype = ATECC608,
{
.atcahid.dev_interface = ATCA_KIT_AUTO_IFACE,
.atcahid.dev_identity = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

/** Include Device Support Options */
#define ATCA_ATECC608A_SUPPORT
#define ATCA_ATECC608_SUPPORT


/* Polling Configuration Options */
Expand Down
Loading

0 comments on commit a84cac6

Please sign in to comment.