|
purify
C++ Purify implementation with native circuit and BPP support
|
Fixed-width unsigned integer helpers implemented in C for Purify. More...
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | PURIFY_DECLARE_UINT_FUNCS(width, words) |
Functions | |
| PURIFY_DECLARE_UINT_FUNCS (256, 4) | |
| PURIFY_DECLARE_UINT_FUNCS (320, 5) | |
| PURIFY_DECLARE_UINT_FUNCS (512, 8) | |
| 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]) |
| #define PURIFY_DECLARE_UINT_FUNCS | ( | width, | |
| words | |||
| ) |
| PURIFY_DECLARE_UINT_FUNCS | ( | 256 | , |
| 4 | |||
| ) |
| PURIFY_DECLARE_UINT_FUNCS | ( | 320 | , |
| 5 | |||
| ) |
| PURIFY_DECLARE_UINT_FUNCS | ( | 512 | , |
| 8 | |||
| ) |
| 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().
| 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().
| 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().