Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::runtime::BigInteger Class Reference

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.

Detailed Description

Arbitrary-precision unsigned integer backed by Mbed TLS MPI.

Constructor & Destructor Documentation

◆ BigInteger() [1/4]

pulp::runtime::BigInteger::BigInteger ( )

◆ BigInteger() [2/4]

pulp::runtime::BigInteger::BigInteger ( uint64_t value)

◆ BigInteger() [3/4]

pulp::runtime::BigInteger::BigInteger ( const BigInteger & other)

◆ BigInteger() [4/4]

pulp::runtime::BigInteger::BigInteger ( BigInteger && other)
noexcept

◆ ~BigInteger()

pulp::runtime::BigInteger::~BigInteger ( )

Member Function Documentation

◆ bit_count()

size_t pulp::runtime::BigInteger::bit_count ( ) const

Number of bits needed to represent this value.

◆ from_hex()

BigInteger pulp::runtime::BigInteger::from_hex ( std::string_view hex)
static

Parse from hex string.

◆ from_string()

BigInteger pulp::runtime::BigInteger::from_string ( std::string_view decimal)
static

Parse from decimal string.

◆ is_zero()

bool pulp::runtime::BigInteger::is_zero ( ) const

Whether this is zero.

◆ mod_pow()

BigInteger pulp::runtime::BigInteger::mod_pow ( const BigInteger & exp,
const BigInteger & modulus ) const

Modular exponentiation: (this^exp) mod modulus Used for RSA encrypt/decrypt.

◆ operator!=()

bool pulp::runtime::BigInteger::operator!= ( const BigInteger & other) const

◆ operator%()

BigInteger pulp::runtime::BigInteger::operator% ( const BigInteger & other) const

◆ operator*()

BigInteger pulp::runtime::BigInteger::operator* ( const BigInteger & other) const

◆ operator+()

BigInteger pulp::runtime::BigInteger::operator+ ( const BigInteger & other) const

Arithmetic operations.

◆ operator<()

bool pulp::runtime::BigInteger::operator< ( const BigInteger & other) const

◆ operator=() [1/2]

BigInteger & pulp::runtime::BigInteger::operator= ( BigInteger && other)
noexcept

◆ operator=() [2/2]

BigInteger & pulp::runtime::BigInteger::operator= ( const BigInteger & other)

◆ operator==()

bool pulp::runtime::BigInteger::operator== ( const BigInteger & other) const

Comparison.

◆ to_hex()

std::string pulp::runtime::BigInteger::to_hex ( ) const

Convert to hex string.

◆ to_string()

std::string pulp::runtime::BigInteger::to_string ( ) const

Convert to decimal string.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/runtime/include/pulp/runtime/big_integer.hpp