+= is preincrement, not postincrement

This commit is contained in:
Juhani Krekelä 2021-04-05 02:15:57 +03:00
parent debac6c434
commit 7e91a099fe
1 changed files with 4 additions and 2 deletions

6
puer.c
View File

@ -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