SHA1¶
You shouldn’t use this for anything new.
Macros¶
-
CF_SHA1_HASHSZ
¶ The output size of SHA1: 20 bytes.
-
CF_SHA1_BLOCKSZ
¶ The block size of SHA1: 64 bytes.
Types¶
Functions¶
-
void
cf_sha1_init
(cf_sha1_context *ctx)¶ Sets up ctx ready to hash a new message.
-
void
cf_sha1_update
(cf_sha1_context *ctx, const void *data, size_t nbytes)¶ Hashes nbytes at data. Copies the data if there isn’t enough to make a full block.
-
void
cf_sha1_digest
(const cf_sha1_context *ctx, uint8_t hash[CF_SHA1_HASHSZ])¶ Finishes the hash operation, writing CF_SHA1_HASHSZ bytes to hash.
This leaves ctx unchanged.
-
void
cf_sha1_digest_final
(cf_sha1_context *ctx, uint8_t hash[CF_SHA1_HASHSZ])¶ Finishes the hash operation, writing CF_SHA1_HASHSZ bytes to hash.
This destroys ctx, but uses less stack than
cf_sha1_digest()
.