X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=hfal%2Fhfal-basic.c;h=428c4ad6497689a577a8cc7e764468399bdb8384;hp=f8f63f8fd3aab5419d158d654ce62d436121229a;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=8007e094d9e9e9477a08978c5ad2d96c6cb8bb66 diff --git a/hfal/hfal-basic.c b/hfal/hfal-basic.c index f8f63f8..428c4ad 100644 --- a/hfal/hfal-basic.c +++ b/hfal/hfal-basic.c @@ -1,7 +1,7 @@ /* hfal-basic.c */ /* This file is part of the AVR-Crypto-Lib. - Copyright (C) 2009 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 @@ -22,7 +22,7 @@ #include "hfal-basic.h" #include -uint8_t hfal_hash_init(const hfdesc_t* hash_descriptor, hfgen_ctx_t* ctx){ +uint8_t hfal_hash_init(const hfdesc_t *hash_descriptor, hfgen_ctx_t *ctx){ hf_init_fpt f; uint16_t tmp; ctx->desc_ptr = (hfdesc_t*)hash_descriptor; @@ -34,37 +34,37 @@ uint8_t hfal_hash_init(const hfdesc_t* hash_descriptor, hfgen_ctx_t* ctx){ return 0; } -void hfal_hash_nextBlock(hfgen_ctx_t* ctx, const void* block){ +void hfal_hash_nextBlock(hfgen_ctx_t *ctx, const void *block){ hf_nextBlock_fpt f; - hfdesc_t* x=(ctx->desc_ptr); + hfdesc_t *x=(ctx->desc_ptr); f =(hf_nextBlock_fpt)pgm_read_word(&(x->nextBlock)); f(ctx->ctx, block); } -void hfal_hash_lastBlock(hfgen_ctx_t* ctx, const void* block, uint16_t length_b){ +void hfal_hash_lastBlock(hfgen_ctx_t *ctx, const void *block, uint16_t length_b){ hf_lastBlock_fpt f; - hfdesc_t* x=ctx->desc_ptr; + hfdesc_t *x=ctx->desc_ptr; f =(hf_lastBlock_fpt)pgm_read_word(&(x->lastBlock)); f(ctx->ctx, block, length_b); } -void hfal_hash_ctx2hash(void* dest, hfgen_ctx_t* ctx){ +void hfal_hash_ctx2hash(void *dest, hfgen_ctx_t *ctx){ hf_ctx2hash_fpt f; - hfdesc_t* x=ctx->desc_ptr; + hfdesc_t *x=ctx->desc_ptr; f =(hf_ctx2hash_fpt)pgm_read_word(&(x->ctx2hash)); f(dest, ctx->ctx); } -void hfal_hash_free(hfgen_ctx_t* ctx){ +void hfal_hash_free(hfgen_ctx_t *ctx){ hf_free_fpt f; - hfdesc_t* x=ctx->desc_ptr; + hfdesc_t *x=ctx->desc_ptr; f =(hf_free_fpt)pgm_read_word(&(x->free)); if(f) f(ctx->ctx); free(ctx->ctx); } -void hfal_hash_mem(const hfdesc_t* hash_descriptor, void* dest, const void* msg, uint32_t length_b){ +void hfal_hash_mem(const hfdesc_t *hash_descriptor, void *dest, const void *msg, uint32_t length_b){ void_fpt f; f = (void_fpt)pgm_read_word(&(hash_descriptor->mem)); if(f){ @@ -89,19 +89,19 @@ void hfal_hash_mem(const hfdesc_t* hash_descriptor, void* dest, const void* msg, } } -uint16_t hfal_hash_getBlocksize(const hfdesc_t* hash_descriptor){ +uint16_t hfal_hash_getBlocksize(const hfdesc_t *hash_descriptor){ uint16_t ret; ret = pgm_read_word(&(hash_descriptor->blocksize_b)); return ret; } -uint16_t hfal_hash_getHashsize(const hfdesc_t* hash_descriptor){ +uint16_t hfal_hash_getHashsize(const hfdesc_t *hash_descriptor){ uint16_t ret; ret = pgm_read_word(&(hash_descriptor->hashsize_b)); return ret; } -uint16_t hfal_hash_getCtxsize_B(const hfdesc_t* hash_descriptor){ +uint16_t hfal_hash_getCtxsize_B(const hfdesc_t *hash_descriptor){ uint16_t ret; ret = pgm_read_word(&(hash_descriptor->ctxsize_B)); return ret;