-
- sha1_init(s);
- sha1_nextBlock(s, buffer);
-#if defined SECURE_WIPE_BUFFER
- memset(buffer, 0, SHA256_BLOCK_BITS/8);
-#endif
-}
-
-void hmac_sha1_final(hmac_sha1_ctx_t *s, void* key, uint16_t keylength_b){
- uint8_t buffer[SHA1_BLOCK_BYTES];
- uint8_t i;
- sha1_ctx_t a;
-
- memset(buffer, 0, SHA1_BLOCK_BYTES);
- if (keylength_b > SHA1_BLOCK_BITS){
- sha1((void*)buffer, key, keylength_b);
- } else {
- memcpy(buffer, key, (keylength_b+7)/8);
- }