|
purify
C++ Purify implementation with native circuit and BPP support
|
Go to the source code of this file.
Macros | |
| #define | PURIFY_UINT_FN(name) purify_u256_##name |
| #define | PURIFY_UINT_WORDS 4 |
| #define | PURIFY_UINT_FN(name) purify_u320_##name |
| #define | PURIFY_UINT_WORDS 5 |
| #define | PURIFY_UINT_FN(name) purify_u512_##name |
| #define | PURIFY_UINT_WORDS 8 |
Functions | |
| static size_t | purify_uint_bit_length_u64 (uint64_t value) |
| static uint64_t | purify_uint_mul_u64 (uint64_t lhs, uint64_t rhs, uint64_t *hi) |
| static uint64_t | purify_uint_add_u64_carry (uint64_t value, uint64_t addend, uint64_t *hi) |
| static uint64_t | purify_uint_mask_u64 (int flag) |
| static int | purify_u512_is_nonzero_ct (const uint64_t value[8]) |
| static void | purify_u512_shift_left_one_or_bit (uint64_t value[8], uint64_t bit) |
| static uint64_t | purify_u512_sub_with_borrow_ct (uint64_t out[8], const uint64_t lhs[8], const uint64_t rhs[8]) |
| static void | purify_u512_cmov_words (uint64_t dst[8], const uint64_t src[8], uint64_t mask) |
| static uint64_t | purify_uint_divmod_u32 (uint64_t hi, uint64_t lo, uint32_t divisor, uint32_t *rem_out) |
| void | purify_u320_widen_u256 (uint64_t out[5], const uint64_t value[4]) |
| void | purify_u512_widen_u256 (uint64_t out[8], const uint64_t value[4]) |
| int | purify_u256_try_narrow_u320 (uint64_t out[4], const uint64_t value[5]) |
| int | purify_u256_try_narrow_u512 (uint64_t out[4], const uint64_t value[8]) |
| int | purify_u512_try_divmod_same (uint64_t quotient[8], uint64_t remainder[8], const uint64_t numerator[8], const uint64_t denominator[8]) |
| int | purify_u512_try_divmod_same_consttime (uint64_t quotient[8], uint64_t remainder[8], const uint64_t numerator[8], const uint64_t denominator[8]) |
| void | purify_u512_multiply_u256 (uint64_t out[8], const uint64_t lhs[4], const uint64_t rhs[4]) |
| int purify_u256_try_narrow_u320 | ( | uint64_t | out[4], |
| const uint64_t | value[5] | ||
| ) |
Definition at line 175 of file uint.c.
Referenced by purify_curve_hash_to_curve(), and purify::try_narrow().
| int purify_u256_try_narrow_u512 | ( | uint64_t | out[4], |
| const uint64_t | value[8] | ||
| ) |
Definition at line 183 of file uint.c.
Referenced by purify_curve_unpack_public(), and purify::try_narrow().
| void purify_u320_widen_u256 | ( | uint64_t | out[5], |
| const uint64_t | value[4] | ||
| ) |
Definition at line 165 of file uint.c.
Referenced by purify_curve_two_p(), and purify::widen().
|
static |
Definition at line 103 of file uint.c.
Referenced by purify_u512_try_divmod_same_consttime().
|
static |
Definition at line 70 of file uint.c.
Referenced by purify_u512_try_divmod_same_consttime().
| void purify_u512_multiply_u256 | ( | uint64_t | out[8], |
| const uint64_t | lhs[4], | ||
| const uint64_t | rhs[4] | ||
| ) |
Definition at line 263 of file uint.c.
References purify_uint_add_u64_carry(), and purify_uint_mul_u64().
Referenced by purify::multiply(), purify_curve_pack_public(), purify_curve_packed_public_key_space_size(), and purify_curve_packed_secret_key_space_size().
|
static |
Definition at line 79 of file uint.c.
References bit().
Referenced by purify_u512_try_divmod_same_consttime().
|
static |
Definition at line 89 of file uint.c.
Referenced by purify_u512_try_divmod_same_consttime().
| int purify_u512_try_divmod_same | ( | uint64_t | quotient[8], |
| uint64_t | remainder[8], | ||
| const uint64_t | numerator[8], | ||
| const uint64_t | denominator[8] | ||
| ) |
Definition at line 194 of file uint.c.
Referenced by purify_curve_unpack_public(), and purify::try_divmod_same().
| int purify_u512_try_divmod_same_consttime | ( | uint64_t | quotient[8], |
| uint64_t | remainder[8], | ||
| const uint64_t | numerator[8], | ||
| const uint64_t | denominator[8] | ||
| ) |
Definition at line 235 of file uint.c.
References purify_u512_cmov_words(), purify_u512_is_nonzero_ct(), purify_u512_shift_left_one_or_bit(), purify_u512_sub_with_borrow_ct(), and purify_uint_mask_u64().
Referenced by purify_curve_unpack_secret_from_valid().
| void purify_u512_widen_u256 | ( | uint64_t | out[8], |
| const uint64_t | value[4] | ||
| ) |
Definition at line 170 of file uint.c.
Referenced by purify_curve_pack_public(), purify_curve_unpack_public(), purify_curve_unpack_secret_from_valid(), and purify::widen().
|
static |
Definition at line 54 of file uint.c.
Referenced by purify_u512_multiply_u256(), and try_mul_small().
|
static |
Definition at line 17 of file uint.c.
Referenced by bit_length().
|
static |
Definition at line 110 of file uint.c.
Referenced by divmod_small().
|
static |
Definition at line 66 of file uint.c.
Referenced by purify_u512_try_divmod_same_consttime().
|
static |
Definition at line 33 of file uint.c.
Referenced by purify_u512_multiply_u256(), and try_mul_small().