37#define SHA1_DIGEST_LENGTH (20)
42#define SHA1_BLOCK_LENGTH (64)
96void sha1(
void *digest,
const void *data,
size_t len);
#define SHA1_BLOCK_LENGTH
Length of SHA-1 block in byte.
#define SHA1_DIGEST_LENGTH
Length of SHA-1 digests in byte.
void sha1_final_hmac(sha1_context *ctx, void *digest)
Finalizes the SHA-1 message digest with MAC.
void sha1_update(sha1_context *ctx, const void *data, size_t len)
Update the SHA-1 context with a portion of the message being hashed.
void sha1_init(sha1_context *ctx)
Initialize SHA-1 message digest context.
void sha1(void *digest, const void *data, size_t len)
Calculate a SHA1 hash from the given data.
void sha1_final(sha1_context *ctx, void *digest)
Finalizes the SHA-1 message digest.
void sha1_init_hmac(sha1_context *ctx, const void *key, size_t key_length)
Initialize SHA-1 message digest context with MAC.
uint8_t key_buffer[SHA1_BLOCK_LENGTH]
internal state of the key buffer
uint32_t state[SHA1_DIGEST_LENGTH/sizeof(uint32_t)]
buffering current state of hashing
uint32_t byte_count
already processed bytes
uint32_t buffer[SHA1_BLOCK_LENGTH/sizeof(uint32_t)]
internal buffer
uint8_t inner_hash[SHA1_DIGEST_LENGTH]
temporary buffer for the inner hashing
uint8_t buffer_offset
internal state variable to keep track if the buffer is filled before proceeding to hash this block