X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=twister%2Ftwister-large.c;fp=twister%2Ftwister-large.c;h=905cd59001e8d8722e0799f5a82ca5cde94e35c1;hp=36506be6d29231ff95cb38e4ebcc4aa0c5898e8d;hb=3a9f9d918fb95474996af535c225a7e187d88372;hpb=33d65e8032f77c1cbec1bc99e898affc96966c3c diff --git a/twister/twister-large.c b/twister/twister-large.c index 36506be..905cd59 100644 --- a/twister/twister-large.c +++ b/twister/twister-large.c @@ -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){