|
Clearmatics Libff
0.1
C++ library for Finite Fields and Elliptic Curves
|
#include <bigint.hpp>
Public Member Functions | |
| bigint ()=default | |
| bigint (const unsigned long x) | |
| Initalize from a small integer. More... | |
| bigint (const char *s) | |
| Initialize from a string containing an integer in decimal notation. More... | |
| bigint (const mpz_t r) | |
| Initialize from MPZ element. More... | |
| void | print () const |
| void | print_hex () const |
| bool | operator== (const bigint< n > &other) const |
| bool | operator!= (const bigint< n > &other) const |
| void | clear () |
| bool | is_zero () const |
| size_t | num_bits () const |
| unsigned long | as_ulong () const |
| void | to_mpz (mpz_t r) const |
| Return the last limb of the integer. More... | |
| bool | test_bit (const std::size_t bitno) const |
| bigint & | randomize () |
Static Public Member Functions | |
| static constexpr size_t | max_bits () |
| The number of bits representable by this bigint type. More... | |
Public Attributes | |
| mp_limb_t | data [n] = {0} |
Static Public Attributes | |
| static const mp_size_t | N = n |
Friends | |
| std::ostream & | operator (std::ostream &out, const bigint< n > &b) |
| std::istream & | operator>> (std::istream &in, bigint< n > &b) |
Wrapper class around GMP's MPZ long integers. It supports arithmetic operations, serialization and randomization. Serialization is fragile, see common/serialization.hpp.
Definition at line 20 of file bigint.hpp.
|
default |
| libff::bigint< n >::bigint | ( | const unsigned long | x | ) |
Initalize from a small integer.
| libff::bigint< n >::bigint | ( | const char * | s | ) |
Initialize from a string containing an integer in decimal notation.
| libff::bigint< n >::bigint | ( | const mpz_t | r | ) |
Initialize from MPZ element.
| unsigned long libff::bigint< n >::as_ulong | ( | ) | const |
| void libff::bigint< n >::clear | ( | ) |
| bool libff::bigint< n >::is_zero | ( | ) | const |
|
inlinestaticconstexpr |
The number of bits representable by this bigint type.
Definition at line 51 of file bigint.hpp.

| size_t libff::bigint< n >::num_bits | ( | ) | const |
The number of bits in this specific bigint value, i.e., position of the most-significant 1
| bool libff::bigint< n >::operator!= | ( | const bigint< n > & | other | ) | const |
| bool libff::bigint< n >::operator== | ( | const bigint< n > & | other | ) | const |
| void libff::bigint< n >::print | ( | ) | const |
| void libff::bigint< n >::print_hex | ( | ) | const |
| bigint& libff::bigint< n >::randomize | ( | ) |
| bool libff::bigint< n >::test_bit | ( | const std::size_t | bitno | ) | const |

| void libff::bigint< n >::to_mpz | ( | mpz_t | r | ) | const |
Return the last limb of the integer.
|
friend |
| mp_limb_t libff::bigint< n >::data[n] = {0} |
Definition at line 33 of file bigint.hpp.
|
static |
Definition at line 31 of file bigint.hpp.
1.8.17