These methods provide a software implementation of various crypto algorithms.
More...
|
int | atcac_sw_ecdsa_verify_p256 (const uint8_t msg[ATCA_ECC_P256_FIELD_SIZE], const uint8_t signature[ATCA_ECC_P256_SIGNATURE_SIZE], const uint8_t public_key[ATCA_ECC_P256_PUBLIC_KEY_SIZE]) |
| return software generated ECDSA verification result More...
|
|
int | atcac_sw_random (uint8_t *data, size_t data_size) |
| return software generated random number More...
|
|
int | atcac_sw_sha1_init (atcac_sha1_ctx *ctx) |
|
int | atcac_sw_sha1_update (atcac_sha1_ctx *ctx, const uint8_t *data, size_t data_size) |
|
int | atcac_sw_sha1_finish (atcac_sha1_ctx *ctx, uint8_t digest[ATCA_SHA1_DIGEST_SIZE]) |
|
int | atcac_sw_sha1 (const uint8_t *data, size_t data_size, uint8_t digest[ATCA_SHA1_DIGEST_SIZE]) |
|
int | atcac_sw_sha2_256_init (atcac_sha2_256_ctx *ctx) |
| initializes the SHA256 software More...
|
|
int | atcac_sw_sha2_256_update (atcac_sha2_256_ctx *ctx, const uint8_t *data, size_t data_size) |
| updates the running hash with the next block of data, called iteratively for the entire stream of data to be hashed More...
|
|
int | atcac_sw_sha2_256_finish (atcac_sha2_256_ctx *ctx, uint8_t digest[ATCA_SHA2_256_DIGEST_SIZE]) |
| completes the final SHA calculation and returns the final digest/hash More...
|
|
int | atcac_sw_sha2_256 (const uint8_t *data, size_t data_size, uint8_t digest[ATCA_SHA2_256_DIGEST_SIZE]) |
| single call convenience function to comput SHA256 of given data More...
|
|
These methods provide a software implementation of various crypto algorithms.
#define ATCA_ECC_P256_FIELD_SIZE (256 / 8) |
#define ATCA_SHA1_DIGEST_SIZE (20) |
#define ATCA_SHA2_256_DIGEST_SIZE (32) |
int atcac_sw_ecdsa_verify_p256 |
( |
const uint8_t |
msg[ATCA_ECC_P256_FIELD_SIZE], |
|
|
const uint8_t |
signature[ATCA_ECC_P256_SIGNATURE_SIZE], |
|
|
const uint8_t |
public_key[ATCA_ECC_P256_PUBLIC_KEY_SIZE] |
|
) |
| |
return software generated ECDSA verification result
- Parameters
-
[in] | msg | ptr to message or challenge |
[in] | signature | ptr to the signature to verify |
[in] | public_key | ptr to public key of device which signed the challenge return ATCA_STATUS |
int atcac_sw_random |
( |
uint8_t * |
data, |
|
|
size_t |
data_size |
|
) |
| |
return software generated random number
- Parameters
-
[out] | data | ptr to space to receive the random number |
[in] | data_size | size of data buffer return ATCA_STATUS |
int atcac_sw_sha1 |
( |
const uint8_t * |
data, |
|
|
size_t |
data_size, |
|
|
uint8_t |
digest[ATCA_SHA1_DIGEST_SIZE] |
|
) |
| |
int atcac_sw_sha1_finish |
( |
atcac_sha1_ctx * |
ctx, |
|
|
uint8_t |
digest[ATCA_SHA1_DIGEST_SIZE] |
|
) |
| |
int atcac_sw_sha1_update |
( |
atcac_sha1_ctx * |
ctx, |
|
|
const uint8_t * |
data, |
|
|
size_t |
data_size |
|
) |
| |
int atcac_sw_sha2_256 |
( |
const uint8_t * |
data, |
|
|
size_t |
data_size, |
|
|
uint8_t |
digest[ATCA_SHA2_256_DIGEST_SIZE] |
|
) |
| |
single call convenience function to comput SHA256 of given data
- Parameters
-
[in] | data | pointer to stream of data to hash |
[in] | data_size | size of data stream to hash |
[out] | digest | result |
- Returns
- ATCA_STATUS
int atcac_sw_sha2_256_finish |
( |
atcac_sha2_256_ctx * |
ctx, |
|
|
uint8_t |
digest[ATCA_SHA2_256_DIGEST_SIZE] |
|
) |
| |
completes the final SHA calculation and returns the final digest/hash
- Parameters
-
[in] | ctx | ptr to context data structure |
[out] | digest | receives the computed digest of the SHA 256 has |
- Returns
- ATCA_STATUS
initializes the SHA256 software
- Parameters
-
[in] | ctx | ptr to context data structure |
- Returns
- ATCA_STATUS value
int atcac_sw_sha2_256_update |
( |
atcac_sha2_256_ctx * |
ctx, |
|
|
const uint8_t * |
data, |
|
|
size_t |
data_size |
|
) |
| |
updates the running hash with the next block of data, called iteratively for the entire stream of data to be hashed
- Parameters
-
[in] | ctx | ptr to SHA context data structure |
[in] | data | ptr to next block of data to hash |
[in] | data_size | size amount of data to hash in the given block, in bytes |
- Returns
- ATCA_STATUS