X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=twister%2Ftwister-large.c;h=1cbc9f199ba2929c16c1a228c62853e6c58ea549;hb=b8aa8d06134ce687993cb3148d66ebd86dbf1d6f;hp=36506be6d29231ff95cb38e4ebcc4aa0c5898e8d;hpb=cc6b183296a5852449e3324737e2a2dece788786;p=avr-crypto-lib.git diff --git a/twister/twister-large.c b/twister/twister-large.c index 36506be..1cbc9f1 100644 --- a/twister/twister-large.c +++ b/twister/twister-large.c @@ -1,7 +1,7 @@ /* twister-large.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 @@ -26,7 +26,7 @@ /*********************************************************************/ static -void checksum_update(twister_large_ctx_t* ctx, uint8_t col){ +void checksum_update(twister_large_ctx_t *ctx, uint8_t col){ uint8_t i, col2; uint8_t carry = 0; int sum = 0; @@ -46,7 +46,7 @@ void checksum_update(twister_large_ctx_t* ctx, uint8_t col){ /*********************************************************************/ -void twister_large_init(twister_large_ctx_t* ctx, uint16_t hashsize_b){ +void twister_large_init(twister_large_ctx_t *ctx, uint16_t hashsize_b){ memset(ctx->state.s, 0, 64); memset(ctx->checksum, 0, 64); ctx->state.counter=0xffffffffffffffffLL; @@ -57,7 +57,7 @@ void twister_large_init(twister_large_ctx_t* ctx, uint16_t hashsize_b){ /*********************************************************************/ -void twister_large_nextBlock(twister_large_ctx_t* ctx, const void* msg){ +void twister_large_nextBlock(twister_large_ctx_t *ctx, const void *msg){ uint8_t tmp[8][8]; /* 1st maxi round */ @@ -108,7 +108,7 @@ void twister_large_nextBlock(twister_large_ctx_t* ctx, const void* msg){ /*********************************************************************/ -void twister_inject_chksum(twister_large_ctx_t* ctx, uint8_t col){ +void twister_inject_chksum(twister_large_ctx_t *ctx, uint8_t col){ uint8_t i=7; do{ ctx->state.s[7][i] ^= ctx->checksum[col][i]; @@ -119,7 +119,7 @@ void twister_inject_chksum(twister_large_ctx_t* ctx, uint8_t col){ /*********************************************************************/ -void twister_large_lastBlock(twister_large_ctx_t* ctx, const void* msg, uint16_t length_b){ +void twister_large_lastBlock(twister_large_ctx_t *ctx, const void *msg, uint16_t length_b){ uint8_t tmp[64]; while(length_b>=512){ twister_large_nextBlock(ctx, msg); @@ -155,38 +155,38 @@ void twister_large_lastBlock(twister_large_ctx_t* ctx, const void* msg, uint16_t /*********************************************************************/ -void twister_large_ctx2hash(void* dest, twister_large_ctx_t* ctx, uint16_t hashsize_b){ +void twister_large_ctx2hash(void *dest, twister_large_ctx_t *ctx, uint16_t hashsize_b){ twister_ctx2hash(dest, &(ctx->state), hashsize_b); } /*********************************************************************/ /*********************************************************************/ -void twister384_init(twister384_ctx_t* ctx){ +void twister384_init(twister384_ctx_t *ctx){ twister_large_init(ctx, 384); } /*********************************************************************/ -void twister384_nextBlock(twister384_ctx_t* ctx, const void* msg){ +void twister384_nextBlock(twister384_ctx_t *ctx, const void *msg){ twister_large_nextBlock(ctx, msg); } /*********************************************************************/ -void twister384_lastBlock(twister384_ctx_t* ctx, const void* msg, uint16_t length_b){ +void twister384_lastBlock(twister384_ctx_t *ctx, const void *msg, uint16_t length_b){ twister_large_lastBlock(ctx, msg, length_b); } /*********************************************************************/ -void twister384_ctx2hash(void* dest, twister384_ctx_t* ctx){ +void twister384_ctx2hash(void *dest, twister384_ctx_t *ctx){ twister_large_ctx2hash(dest, ctx, 384); } /*********************************************************************/ -void twister384(void* dest, const void* msg, uint32_t msg_length_b){ +void twister384(void *dest, const void *msg, uint32_t msg_length_b){ twister_large_ctx_t ctx; twister_large_init(&ctx, 384); while(msg_length_b >=512){ @@ -202,31 +202,31 @@ void twister384(void* dest, const void* msg, uint32_t msg_length_b){ /*********************************************************************/ -void twister512_init(twister512_ctx_t* ctx){ +void twister512_init(twister512_ctx_t *ctx){ twister_large_init(ctx, 512); } /*********************************************************************/ -void twister512_nextBlock(twister512_ctx_t* ctx, const void* msg){ +void twister512_nextBlock(twister512_ctx_t *ctx, const void *msg){ twister_large_nextBlock(ctx, msg); } /*********************************************************************/ -void twister512_lastBlock(twister512_ctx_t* ctx, const void* msg, uint16_t length_b){ +void twister512_lastBlock(twister512_ctx_t *ctx, const void *msg, uint16_t length_b){ twister_large_lastBlock(ctx, msg, length_b); } /*********************************************************************/ -void twister512_ctx2hash(void* dest, twister512_ctx_t* ctx){ +void twister512_ctx2hash(void *dest, twister512_ctx_t *ctx){ twister_large_ctx2hash(dest, ctx, 512); } /*********************************************************************/ -void twister512(void* dest, const void* msg, uint32_t msg_length_b){ +void twister512(void *dest, const void *msg, uint32_t msg_length_b){ twister_large_ctx_t ctx; twister_large_init(&ctx, 512); while(msg_length_b >=512){