CryptoAuthLib
Microchip CryptoAuthentication Library
atca_crypto_sw_sha2.h
Go to the documentation of this file.
1 
28 #ifndef ATCA_CRYPTO_SW_SHA2_H
29 #define ATCA_CRYPTO_SW_SHA2_H
30 
31 #include "atca_crypto_sw.h"
32 #include <stddef.h>
33 #include <stdint.h>
34 
43 #define ATCA_SHA2_256_DIGEST_SIZE (32)
44 
45 typedef struct
46 {
47  uint32_t pad[48];
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
55 int atcac_sw_sha2_256_update(atcac_sha2_256_ctx* ctx, const uint8_t* data, size_t data_size);
57 int atcac_sw_sha2_256(const uint8_t * data, size_t data_size, uint8_t digest[ATCA_SHA2_256_DIGEST_SIZE]);
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
64 #endif
#define ATCA_SHA2_256_DIGEST_SIZE
Definition: atca_crypto_sw_sha2.h:43
Common defines for CryptoAuthLib software crypto wrappers.
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 which computes Hash of given data using SHA256 software ...
Definition: atca_crypto_sw_sha2.c:83
int atcac_sw_sha2_256_init(atcac_sha2_256_ctx *ctx)
initializes the SHA256 software
Definition: atca_crypto_sw_sha2.c:36
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 dat...
Definition: atca_crypto_sw_sha2.c:55
Definition: atca_crypto_sw_sha2.h:45
int atcac_sw_sha2_256_finish(atcac_sha2_256_ctx *ctx, uint8_t digest[ATCA_SHA2_256_DIGEST_SIZE])
completes the final SHA256 calculation and returns the final digest/hash
Definition: atca_crypto_sw_sha2.c:68