X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=hmac-sha1%2Fhmac-sha1.c;h=3ac88722ca814eb8f870e8157d96bcdc79be1e1b;hb=27f4804c185ae24b3b6367bb2fdb898d6692d0f6;hp=783040208cca6e1ac7faf217df814aa4e170a716;hpb=7b5401ab9ce23a5da1de8b6c7de3a1aa20ac4cf8;p=avr-crypto-lib.git diff --git a/hmac-sha1/hmac-sha1.c b/hmac-sha1/hmac-sha1.c index 7830402..3ac8872 100644 --- a/hmac-sha1/hmac-sha1.c +++ b/hmac-sha1/hmac-sha1.c @@ -31,7 +31,7 @@ #include #include #include "config.h" -#include "sha1/sha1.h" +#include "sha1.h" #include "hmac-sha1.h" #define IPAD 0x36 @@ -74,17 +74,17 @@ void hmac_sha1_nextBlock(hmac_sha1_ctx_t *s, const void* block){ } void hmac_sha1_lastBlock(hmac_sha1_ctx_t *s, const void* block, uint16_t length_b){ while(length_b>=SHA1_BLOCK_BITS){ - sha1_nextBlock(&(s->a), block); + sha1_nextBlock(&s->a, block); block = (uint8_t*)block + SHA1_BLOCK_BYTES; length_b -= SHA1_BLOCK_BITS; } - sha1_lastBlock(&(s->a), block, length_b); + sha1_lastBlock(&s->a, block, length_b); } void hmac_sha1_final(void* dest, hmac_sha1_ctx_t *s){ - sha1_ctx2hash((sha1_hash_t*)dest, &(s->a)); - sha1_lastBlock(&(s->b), dest, SHA1_HASH_BITS); - sha1_ctx2hash((sha1_hash_t*)dest, &(s->b)); + sha1_ctx2hash(dest, &s->a); + sha1_lastBlock(&s->b, dest, SHA1_HASH_BITS); + sha1_ctx2hash(dest, &(s->b)); } #endif