Firmware SDK
twr_sha256.h
1 #ifndef _TWR_SHA256_H
2 #define _TWR_SHA256_H
3 
4 #include "twr_common.h"
5 
9 
11 
12 typedef struct
13 {
14  uint8_t _buffer[64];
15  size_t _length;
16  uint64_t _bit_length;
17  uint32_t _state[8];
18 
19 } twr_sha256_t;
20 
22 
25 
26 void twr_sha256_init(twr_sha256_t *self);
27 
32 
33 void twr_sha256_update(twr_sha256_t *self, const void *buffer, size_t length);
34 
39 
40 void twr_sha256_final(twr_sha256_t *self, uint8_t *hash, bool little_endian);
41 
43 
44 #endif
void twr_sha256_update(twr_sha256_t *self, const void *buffer, size_t length)
Compute SHA256 from data.
Definition: twr_sha256.c:40
void twr_sha256_final(twr_sha256_t *self, uint8_t *hash, bool little_endian)
Finalize SHA256 computation and read the final hash.
Definition: twr_sha256.c:58
void twr_sha256_init(twr_sha256_t *self)
Initialize SHA256 structure.
Definition: twr_sha256.c:26