CryptoAuthLib
Atmel CryptoAuthentication Library
sha2_routines.h
Go to the documentation of this file.
1 
42 #ifndef SHA2_ROUTINES_H
43 #define SHA2_ROUTINES_H
44 
45 #include <stdint.h>
46 
47 #define SHA256_DIGEST_SIZE (32)
48 #define SHA256_BLOCK_SIZE (64)
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 typedef struct {
55  uint32_t total_msg_size;
56  uint32_t block_size;
57  uint8_t block[SHA256_BLOCK_SIZE * 2];
58  uint32_t hash[8];
60 
61 void sw_sha256_init(sw_sha256_ctx* ctx);
62 
63 void sw_sha256_update(sw_sha256_ctx* ctx, const uint8_t* message, uint32_t len);
64 
65 void sw_sha256_final(sw_sha256_ctx * ctx, uint8_t digest[SHA256_DIGEST_SIZE]);
66 
67 void sw_sha256(const uint8_t * message, unsigned int len, uint8_t digest[SHA256_DIGEST_SIZE]);
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif // SHA2_ROUTINES_H
74 
void sw_sha256(const uint8_t *message, unsigned int len, uint8_t digest[SHA256_DIGEST_SIZE])
Definition: sha2_routines.c:221
void sw_sha256_init(sw_sha256_ctx *ctx)
Definition: sha2_routines.c:143
#define SHA256_DIGEST_SIZE
Definition: sha2_routines.h:47
void sw_sha256_update(sw_sha256_ctx *ctx, const uint8_t *message, uint32_t len)
Definition: sha2_routines.c:156
uint32_t block_size
Number of bytes in current block.
Definition: sha2_routines.h:56
#define SHA256_BLOCK_SIZE
Definition: sha2_routines.h:48
void sw_sha256_final(sw_sha256_ctx *ctx, uint8_t digest[SHA256_DIGEST_SIZE])
Definition: sha2_routines.c:185
uint32_t total_msg_size
Total number of message bytes processed.
Definition: sha2_routines.h:55
Definition: sha2_routines.h:54