diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-07 19:24:57 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-21 10:41:07 +0000 |
commit | be82c40703d267184ee07bf7be71002122c86656 (patch) | |
tree | 7c303ad3712e12b753a7bac878430003d8524a8d /contrib/epee/include/int-util.h | |
parent | Merge pull request #5939 (diff) | |
download | monero-be82c40703d267184ee07bf7be71002122c86656.tar.xz |
Support median block size > 4 GB
add a 128/64 division routine so we can use a > 32 bit median block
size in calculations
Diffstat (limited to 'contrib/epee/include/int-util.h')
-rw-r--r-- | contrib/epee/include/int-util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/epee/include/int-util.h b/contrib/epee/include/int-util.h index 8ef5be40a..939c018ea 100644 --- a/contrib/epee/include/int-util.h +++ b/contrib/epee/include/int-util.h @@ -129,6 +129,9 @@ static inline uint32_t div128_32(uint64_t dividend_hi, uint64_t dividend_lo, uin return remainder; } +// Long divisor with 2^64 base +void div128_64(uint64_t dividend_hi, uint64_t dividend_lo, uint64_t divisor, uint64_t* quotient_hi, uint64_t *quotient_lo, uint64_t *remainder_hi, uint64_t *remainder_lo); + #define IDENT16(x) ((uint16_t) (x)) #define IDENT32(x) ((uint32_t) (x)) #define IDENT64(x) ((uint64_t) (x)) |