57#ifndef __TC_SHA256_H__
58#define __TC_SHA256_H__
67#define TC_SHA256_BLOCK_SIZE (64)
68#define TC_SHA256_DIGEST_SIZE (32)
69#define TC_SHA256_STATE_BLOCKS (TC_SHA256_DIGEST_SIZE/4)
71struct tc_sha256_state_struct {
72 unsigned int iv[TC_SHA256_STATE_BLOCKS];
74 uint8_t leftover[TC_SHA256_BLOCK_SIZE];
75 size_t leftover_offset;
78typedef struct tc_sha256_state_struct *TCSha256State_t;
105int tc_sha256_update (TCSha256State_t s,
const uint8_t *data,
size_t datalen);
int tc_sha256_update(TCSha256State_t s, const uint8_t *data, size_t datalen)
SHA256 update procedure Hashes data_length bytes addressed by data into state s.
Definition sha256.c:65
int tc_sha256_init(TCSha256State_t s)
SHA256 initialization procedure Initializes s.
Definition sha256.c:39
int tc_sha256_final(uint8_t *digest, TCSha256State_t s)
SHA256 final procedure Inserts the completed hash computation into digest.
Definition sha256.c:87