X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=twister-small.c;h=2f46af02be237504a41561b3959e13743049075b;hb=288c82e97b3c37666b1c11475b45a956b3e5e8e0;hp=68e8e827b67b96e11212e1455d5386382c943486;hpb=0076b72ccd398bf7571c5144ba36eda8a24f6c70;p=avr-crypto-lib.git diff --git a/twister-small.c b/twister-small.c index 68e8e82..2f46af0 100644 --- a/twister-small.c +++ b/twister-small.c @@ -53,6 +53,7 @@ void twister_small_nextBlock(twister_state_t* ctx, void* msg){ void twister_small_lastBlock(twister_state_t* ctx, void* msg, uint16_t length_b){ uint8_t tmp[64]; + uint8_t i; while(length_b>512){ twister_small_nextBlock(ctx, msg); msg = ((uint8_t*)msg)+64; @@ -63,6 +64,7 @@ void twister_small_lastBlock(twister_state_t* ctx, void* msg, uint16_t length_b) tmp[length_b/8] |= 0x80 >> (length_b&0x07); twister_small_nextBlock(ctx, tmp); ctx->length_counter_b -= 512 - length_b; + twister_mini_round(ctx, &(ctx->length_counter_b)); twister_blank_round(ctx); }