74 uint64_t high, uint64_t low);
Support for process management (memory allocation, logging, etc.)
void sc_uint128_copy(const sc_uint128_t *input, sc_uint128_t *output)
Copies an initialized sc_uint128_t to a sc_uint128_t.
int sc_uint128_compare(const void *a, const void *b)
Compare the sc_uint128_t a and the sc_uint128_t b.
void sc_uint128_add_inplace(sc_uint128_t *a, const sc_uint128_t *b)
Adds the uint128 b to the uint128_t a.
void sc_uint128_bitwise_and_inplace(sc_uint128_t *a, const sc_uint128_t *b)
Calculates the bitwise and of the uint128_t a and the uint128_t b.
void sc_uint128_bitwise_neg(const sc_uint128_t *a, sc_uint128_t *result)
Calculates the bitwise negation of the uint128_t a.
void sc_uint128_bitwise_or(const sc_uint128_t *a, const sc_uint128_t *b, sc_uint128_t *result)
Calculates the bitwise or of the uint128_t a and b.
void sc_uint128_add(const sc_uint128_t *a, const sc_uint128_t *b, sc_uint128_t *result)
Adds the uint128_t b to the uint128_t a.
void sc_uint128_shift_right(const sc_uint128_t *input, int shift_count, sc_uint128_t *result)
Calculates the bit right shift of uint128_t input by shift_count bits.
void sc_uint128_shift_left(const sc_uint128_t *input, int shift_count, sc_uint128_t *result)
Calculates the bit left shift of uint128_t input by shift_count bits.
struct sc_uint128 sc_uint128_t
An unsigned 128 bit integer represented as two uint64_t.
void sc_uint128_bitwise_and(const sc_uint128_t *a, const sc_uint128_t *b, sc_uint128_t *result)
Calculates the bitwise and of the uint128_t a and the uint128_t b.
void sc_uint128_bitwise_or_inplace(sc_uint128_t *a, const sc_uint128_t *b)
Calculates the bitwise or of the uint128_t a and the uint128_t b.
void sc_uint128_sub_inplace(sc_uint128_t *a, const sc_uint128_t *b)
Subtracts the uint128_t b from the uint128_t a.
int sc_uint128_chk_bit(const sc_uint128_t *input, int exponent)
Returns the bit_number-th bit of input.
void sc_uint128_set_bit(sc_uint128_t *a, int exponent)
Sets the exponent-th bit of a to one and keep all other bits.
void sc_uint128_sub(const sc_uint128_t *a, const sc_uint128_t *b, sc_uint128_t *result)
Subtracts the uint128_t b from the uint128_t a.
int sc_uint128_is_equal(const sc_uint128_t *a, const sc_uint128_t *b)
Checks if the sc_uint128_t a and the sc_uint128_t b are equal.
void sc_uint128_init(sc_uint128_t *a, uint64_t high, uint64_t low)
Initializes an unsigned 128 bit integer to a given value.
An unsigned 128 bit integer represented as two uint64_t.
Definition: sc_uint128.h:43
uint64_t high_bits
The more significant 64 bits.
Definition: sc_uint128.h:44
uint64_t low_bits
The less significant 64 bits.
Definition: sc_uint128.h:45