Wire Sysio Wire Sysion 1.0.0
|
#include <bigint.hpp>
Public Member Functions | |
bigint ()=default | |
bigint (const unsigned long x) | |
bigint (const char *s) | |
Initalize from a small integer. | |
bigint (const mpz_t r) | |
Initialize from a string containing an integer in decimal notation. | |
void | print () const |
Initialize from MPZ element. | |
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 | max_bits () const |
size_t | num_bits () const |
Returns the number of bits representable by this bigint type. | |
unsigned long | as_ulong () const |
Returns the number of bits in this specific bigint value, i.e., position of the most-significant 1. | |
void | to_mpz (mpz_t r) const |
Return the last limb of the integer. | |
bool | test_bit (const std::size_t bitno) const |
bigint & | randomize () |
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 31 of file bigint.hpp.
|
default |
libff::bigint< n >::bigint | ( | const unsigned long | x | ) |
libff::bigint< n >::bigint | ( | const char * | s | ) |
libff::bigint< n >::bigint | ( | const mpz_t | r | ) |
unsigned long libff::bigint< n >::as_ulong | ( | ) | const |
void libff::bigint< n >::clear | ( | ) |
bool libff::bigint< n >::is_zero | ( | ) | const |
|
inline |
Definition at line 48 of file bigint.hpp.
size_t libff::bigint< n >::num_bits | ( | ) | const |
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 |
|
friend |
|
friend |
mp_limb_t libff::bigint< n >::data[n] = {0} |
Definition at line 35 of file bigint.hpp.
|
static |
Definition at line 33 of file bigint.hpp.