]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - hmac-sha256/hmac-sha256.c
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / hmac-sha256 / hmac-sha256.c
index 6a5718906b2d6fd5aa3899f33880cf06c74d99fc..a64e3c72c2e463f80a698b22b2f985d9f4d5ab25 100644 (file)
@@ -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 voidkey, 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 voidblock){
+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 voidblock, 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(voiddest, 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];