From: bg Date: Thu, 11 Feb 2010 14:29:18 +0000 (+0000) Subject: removing debugging stuff from keccak X-Git-Url: https://git.cryptolib.org/?a=commitdiff_plain;h=60782c4d65b45ea0dd219ff8e6a82a12d8021b7e;p=avr-crypto-lib.git removing debugging stuff from keccak --- diff --git a/keccak/keccak.c b/keccak/keccak.c index e2df514..c9ab7ae 100644 --- a/keccak/keccak.c +++ b/keccak/keccak.c @@ -177,16 +177,16 @@ void keccak_lastBlock(keccak_ctx_t* ctx, const void* block, uint16_t length_b){ pad[0] = ctx->d; pad[1] = ctx->bs; pad[2] = 0x01; - if(length_b/8+1+3bs){ + if(length_b/8+1+3<=ctx->bs){ memcpy(tmp+length_b/8+1, pad, 3); }else{ - if(length_b/8+1+2bs){ + if(length_b/8+1+2<=ctx->bs){ memcpy(tmp+length_b/8+1, pad, 2); keccak_nextBlock(ctx, tmp); memset(tmp, 0x00, ctx->bs); tmp[0]=0x01; }else{ - if(length_b/8+1+1bs){ + if(length_b/8+1+1<=ctx->bs){ memcpy(tmp+length_b/8+1, pad, 1); keccak_nextBlock(ctx, tmp); memset(tmp, 0x00, ctx->bs);