CryptoAuthLib
Atmel CryptoAuthentication Library
atca_crypto_sw_sha2.h
Go to the documentation of this file.
1 
42 #ifndef ATCA_CRYPTO_SW_SHA2_H
43 #define ATCA_CRYPTO_SW_SHA2_H
44 
45 #include "atca_crypto_sw.h"
46 #include <stddef.h>
47 #include <stdint.h>
48 
57 #define ATCA_SHA2_256_DIGEST_SIZE (32)
58 
59 typedef struct {
60  uint32_t pad[48];
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
68 int atcac_sw_sha2_256_update(atcac_sha2_256_ctx* ctx, const uint8_t* data, size_t data_size);
70 int atcac_sw_sha2_256(const uint8_t * data, size_t data_size, uint8_t digest[ATCA_SHA2_256_DIGEST_SIZE]);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
77 #endif
int atcac_sw_sha2_256_init(atcac_sha2_256_ctx *ctx)
initializes the SHA256 software
Definition: atca_crypto_sw_sha2.c:50
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:67
Definition: atca_crypto_sw_sha2.h:59
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 to comput SHA256 of given data
Definition: atca_crypto_sw_sha2.c:95
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
Definition: atca_crypto_sw_sha2.c:80
#define ATCA_SHA2_256_DIGEST_SIZE
Definition: atca_crypto_sw_sha2.h:57