Arbitrary-precision unsigned integer backed by Mbed TLS MPI. More...
#include <big_integer.hpp>
Public Member Functions | |
| BigInteger () | |
| BigInteger (uint64_t value) | |
| BigInteger (const BigInteger &other) | |
| BigInteger (BigInteger &&other) noexcept | |
| ~BigInteger () | |
| BigInteger & | operator= (const BigInteger &other) |
| BigInteger & | operator= (BigInteger &&other) noexcept |
| std::string | to_string () const |
| Convert to decimal string. | |
| std::string | to_hex () const |
| Convert to hex string. | |
| bool | is_zero () const |
| Whether this is zero. | |
| size_t | bit_count () const |
| Number of bits needed to represent this value. | |
| BigInteger | operator+ (const BigInteger &other) const |
| Arithmetic operations. | |
| BigInteger | operator* (const BigInteger &other) const |
| BigInteger | operator% (const BigInteger &other) const |
| BigInteger | mod_pow (const BigInteger &exp, const BigInteger &modulus) const |
| Modular exponentiation: (this^exp) mod modulus Used for RSA encrypt/decrypt. | |
| bool | operator== (const BigInteger &other) const |
| Comparison. | |
| bool | operator!= (const BigInteger &other) const |
| bool | operator< (const BigInteger &other) const |
Static Public Member Functions | |
| static BigInteger | from_string (std::string_view decimal) |
| Parse from decimal string. | |
| static BigInteger | from_hex (std::string_view hex) |
| Parse from hex string. | |
Arbitrary-precision unsigned integer backed by Mbed TLS MPI.
| pulp::runtime::BigInteger::BigInteger | ( | ) |
| pulp::runtime::BigInteger::BigInteger | ( | uint64_t | value | ) |
| pulp::runtime::BigInteger::BigInteger | ( | const BigInteger & | other | ) |
|
noexcept |
| pulp::runtime::BigInteger::~BigInteger | ( | ) |
| size_t pulp::runtime::BigInteger::bit_count | ( | ) | const |
Number of bits needed to represent this value.
|
static |
Parse from hex string.
|
static |
Parse from decimal string.
| bool pulp::runtime::BigInteger::is_zero | ( | ) | const |
Whether this is zero.
| BigInteger pulp::runtime::BigInteger::mod_pow | ( | const BigInteger & | exp, |
| const BigInteger & | modulus ) const |
Modular exponentiation: (this^exp) mod modulus Used for RSA encrypt/decrypt.
| bool pulp::runtime::BigInteger::operator!= | ( | const BigInteger & | other | ) | const |
| BigInteger pulp::runtime::BigInteger::operator% | ( | const BigInteger & | other | ) | const |
| BigInteger pulp::runtime::BigInteger::operator* | ( | const BigInteger & | other | ) | const |
| BigInteger pulp::runtime::BigInteger::operator+ | ( | const BigInteger & | other | ) | const |
Arithmetic operations.
| bool pulp::runtime::BigInteger::operator< | ( | const BigInteger & | other | ) | const |
|
noexcept |
| BigInteger & pulp::runtime::BigInteger::operator= | ( | const BigInteger & | other | ) |
| bool pulp::runtime::BigInteger::operator== | ( | const BigInteger & | other | ) | const |
Comparison.
| std::string pulp::runtime::BigInteger::to_hex | ( | ) | const |
Convert to hex string.
| std::string pulp::runtime::BigInteger::to_string | ( | ) | const |
Convert to decimal string.