Fix big-endian handling in stage1 bigint_write_twos_complement

This commit is contained in:
Cody Tapscott
2022-02-11 08:46:01 -07:00
parent 70d7f87be0
commit eeb043f583

View File

@@ -313,12 +313,12 @@ void bigint_write_twos_complement(const BigInt *big_int, uint8_t *buf, size_t bi
}
if (digit_index == 0) break;
digit_index -= 1;
if (digit_index == last_digit_index) {
buf_index += bytes_in_last_digit;
} else {
buf_index += 8;
}
digit_index -= 1;
}
} else {
size_t digit_count = (bit_count + 63) / 64;