X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=shabal%2Fshabal.c;h=fe88fda4a03713616e2450451ccff015eee96246;hp=f18908ae6b4f9ccde632f5bbfe574b012b1c8897;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=4f50c75ee5a6cc88bf7ea71957ed509e298e6c25 diff --git a/shabal/shabal.c b/shabal/shabal.c index f18908a..fe88fda 100644 --- a/shabal/shabal.c +++ b/shabal/shabal.c @@ -1,7 +1,7 @@ /* shabal.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 @@ -19,7 +19,7 @@ /* * \file shabal.c * \author Daniel Otte - * \email daniel.otte@rub.de + * \email bg@nerilex.org * \date 2009-04-17 * \license GPLv3 or later * @@ -47,7 +47,7 @@ uint32_t shabal_v(uint32_t a){ #define ROTL32(a,n) (((a)<<(n))|((a)>>(32-(n)))) static -void shabal_p(shabal_ctx_t* ctx, const void* m){ +void shabal_p(shabal_ctx_t *ctx, const void *m){ uint8_t i,j; for(i=0;i<16;++i){ ctx->b[i] = ROTL32(ctx->b[i],17); @@ -70,9 +70,9 @@ void shabal_p(shabal_ctx_t* ctx, const void* m){ } } -void shabal_nextBlock(shabal_ctx_t* ctx, const void* block){ +void shabal_nextBlock(shabal_ctx_t *ctx, const void *block){ uint8_t i; - uint32_t* t; + uint32_t *t; for(i=0;i<16;++i){ ctx->b[i] += ((uint32_t*)block)[i]; } @@ -88,9 +88,9 @@ void shabal_nextBlock(shabal_ctx_t* ctx, const void* block){ ctx->b = t; } -void shabal_lastBlock(shabal_ctx_t* ctx, const void* block, uint16_t length_b){ +void shabal_lastBlock(shabal_ctx_t *ctx, const void *block, uint16_t length_b){ uint8_t i,j; - uint32_t* t; + uint32_t *t; uint8_t buffer[64]; while(length_b>=SHABAL_BLOCKSIZE){ shabal_nextBlock(ctx, block); @@ -116,6 +116,6 @@ void shabal_lastBlock(shabal_ctx_t* ctx, const void* block, uint16_t length_b){ } -void shabal_ctx2hash(void* dest, const shabal_ctx_t* ctx, uint16_t outlength_b){ +void shabal_ctx2hash(void *dest, const shabal_ctx_t *ctx, uint16_t outlength_b){ memcpy(dest, &(ctx->c[16-outlength_b/32]), outlength_b/8); }