X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=hmac-sha256%2Fhmac-sha256.c;h=a64e3c72c2e463f80a698b22b2f985d9f4d5ab25;hp=6a5718906b2d6fd5aa3899f33880cf06c74d99fc;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=b8d6b2bd3ddea45506f584c7d44fe5fff0557ed1 diff --git a/hmac-sha256/hmac-sha256.c b/hmac-sha256/hmac-sha256.c index 6a57189..a64e3c7 100644 --- a/hmac-sha256/hmac-sha256.c +++ b/hmac-sha256/hmac-sha256.c @@ -1,7 +1,7 @@ /* hmac-sha256.c */ /* This file is part of the AVR-Crypto-Lib. - Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ * * implementation of HMAC as described in RFC2104 * Author: Daniel Otte - * email: daniel.otte@rub.de + * email: bg@nerilex.org * License: GPLv3 or later **/ @@ -39,7 +39,7 @@ #ifndef HMAC_SHA256_SHORTONLY -void hmac_sha256_init(hmac_sha256_ctx_t *s, const void* key, uint16_t keylength_b){ +void hmac_sha256_init(hmac_sha256_ctx_t *s, const void *key, uint16_t keylength_b){ uint8_t buffer[HMAC_SHA256_BLOCK_BYTES]; uint8_t i; @@ -68,11 +68,11 @@ void hmac_sha256_init(hmac_sha256_ctx_t *s, const void* key, uint16_t keylength_ #endif } -void hmac_sha256_nextBlock(hmac_sha256_ctx_t *s, const void* block){ +void hmac_sha256_nextBlock(hmac_sha256_ctx_t *s, const void *block){ sha256_nextBlock(&(s->a), block); } -void hmac_sha256_lastBlock(hmac_sha256_ctx_t *s, const void* block, uint16_t length_b){ +void hmac_sha256_lastBlock(hmac_sha256_ctx_t *s, const void *block, uint16_t length_b){ /* while(length_b>=SHA256_BLOCK_BITS){ sha256_nextBlock(&(s->a), block); block = (uint8_t*)block + SHA256_BLOCK_BYTES; @@ -81,7 +81,7 @@ void hmac_sha256_lastBlock(hmac_sha256_ctx_t *s, const void* block, uint16_t len */ sha256_lastBlock(&(s->a), block, length_b); } -void hmac_sha256_final(void* dest, hmac_sha256_ctx_t *s){ +void hmac_sha256_final(void *dest, hmac_sha256_ctx_t *s){ sha256_ctx2hash((sha256_hash_t*)dest, &(s->a)); sha256_lastBlock(&(s->b), dest, SHA256_HASH_BITS); sha256_ctx2hash((sha256_hash_t*)dest, &(s->b)); @@ -93,7 +93,7 @@ void hmac_sha256_final(void* dest, hmac_sha256_ctx_t *s){ * keylength in bits! * message length in bits! */ -void hmac_sha256(void* dest, const void* key, uint16_t keylength_b, const void* msg, uint32_t msglength_b){ /* a one-shot*/ +void hmac_sha256(void *dest, const void *key, uint16_t keylength_b, const void *msg, uint32_t msglength_b){ /* a one-shot*/ sha256_ctx_t s; uint8_t i; uint8_t buffer[HMAC_SHA256_BLOCK_BYTES];