]> git.cryptolib.org Git - avr-crypto-lib.git/commitdiff
removing debugging stuff from keccak
authorbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Thu, 11 Feb 2010 14:29:18 +0000 (14:29 +0000)
committerbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Thu, 11 Feb 2010 14:29:18 +0000 (14:29 +0000)
keccak/keccak.c

index e2df514aee3d51b936df847eb485b13a3238b7a5..c9ab7aefdd8f39400339a1a4c18897cd353334dc 100644 (file)
@@ -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+3<ctx->bs){
+       if(length_b/8+1+3<=ctx->bs){
                memcpy(tmp+length_b/8+1, pad, 3);
        }else{
-               if(length_b/8+1+2<ctx->bs){
+               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+1<ctx->bs){
+                       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);