diff --git a/puer.c b/puer.c index 4682d74..ec8d4c5 100644 --- a/puer.c +++ b/puer.c @@ -200,8 +200,10 @@ void finalize_hash(struct hashstate *state, unsigned char hash[32]) { } // Add the number of bits, and do one last compression - word2bytes(&state->buffer[state->length+=4], state->totalbits>>32); - word2bytes(&state->buffer[state->length+=4], state->totalbits & 0xffffffffUL); + word2bytes(&state->buffer[state->length], state->totalbits>>32); + state->length += 4; + word2bytes(&state->buffer[state->length], state->totalbits & 0xffffffffUL); + state->length += 4; compress_hash(state); // Extract the hash state