![]() |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
C++ wrapper for BIGNUM (OpenSSL bignum) More...
#include <bignum.h>
Public Member Functions | |
| CBigNum () | |
| CBigNum (const std::string &str) | |
| CBigNum (const CBigNum &b) | |
| CBigNum & | operator= (const CBigNum &b) |
| ~CBigNum () | |
| CBigNum (signed char n) | |
| CBigNum (short n) | |
| CBigNum (int n) | |
| CBigNum (long n) | |
| CBigNum (unsigned char n) | |
| CBigNum (unsigned short n) | |
| CBigNum (unsigned int n) | |
| CBigNum (unsigned long n) | |
| CBigNum (uint256 n) | |
| CBigNum (const std::vector< unsigned char > &vch) | |
| int | bitSize () const |
| Returns the size in bits of the underlying bignum. More... | |
| void | setulong (unsigned long n) |
| unsigned long | getulong () const |
| unsigned int | getuint () const |
| int | getint () const |
| void | setint64 (int64_t sn) |
| void | setuint64 (uint64_t n) |
| void | setuint256 (uint256 n) |
| uint256 | getuint256 () const |
| void | setvch (const std::vector< unsigned char > &vch) |
| std::vector< unsigned char > | getvch () const |
| CBigNum & | SetCompact (unsigned int nCompact) |
| unsigned int | GetCompact () const |
| void | SetHex (const std::string &str) |
| bool | SetHexBool (const std::string &str) |
| std::string | ToString (int nBase=10) const |
| std::string | GetHex () const |
| unsigned int | GetSerializeSize (int nType=0, int nVersion=PROTOCOL_VERSION) const |
| template<typename Stream > | |
| void | Serialize (Stream &s, int nType=0, int nVersion=PROTOCOL_VERSION) const |
| template<typename Stream > | |
| void | Unserialize (Stream &s, int nType=0, int nVersion=PROTOCOL_VERSION) |
| CBigNum | pow (const int e) const |
| exponentiation with an int. More... | |
| CBigNum | pow (const CBigNum &e) const |
| exponentiation this^e More... | |
| CBigNum | mul_mod (const CBigNum &b, const CBigNum &m) const |
| modular multiplication: (this * b) mod m More... | |
| CBigNum | pow_mod (const CBigNum &e, const CBigNum &m) const |
| modular exponentiation: this^e mod n More... | |
| CBigNum | inverse (const CBigNum &m) const |
| Calculates the inverse of this element mod m. More... | |
| CBigNum | gcd (const CBigNum &b) const |
| Calculates the greatest common divisor (GCD) of two numbers. More... | |
| bool | isPrime (const int checks=BN_prime_checks) const |
| Miller-Rabin primality test on this element. More... | |
| bool | isOne () const |
| bool | operator! () const |
| CBigNum & | operator+= (const CBigNum &b) |
| CBigNum & | operator-= (const CBigNum &b) |
| CBigNum & | operator*= (const CBigNum &b) |
| CBigNum & | operator/= (const CBigNum &b) |
| CBigNum & | operator%= (const CBigNum &b) |
| CBigNum & | operator<<= (unsigned int shift) |
| CBigNum & | operator>>= (unsigned int shift) |
| CBigNum & | operator++ () |
| const CBigNum | operator++ (int) |
| CBigNum & | operator-- () |
| const CBigNum | operator-- (int) |
Static Public Member Functions | |
| static CBigNum | randBignum (const CBigNum &range) |
| Generates a cryptographically secure random number between zero and range exclusive i.e. More... | |
| static CBigNum | RandKBitBigum (const uint32_t k) |
| Generates a cryptographically secure random k-bit number. More... | |
| static CBigNum | generatePrime (const unsigned int numBits, bool safe=false) |
| Generates a random (safe) prime of numBits bits. More... | |
Private Attributes | |
| BIGNUM * | bn |
Friends | |
| const friend CBigNum | operator+ (const CBigNum &a, const CBigNum &b) |
| const friend CBigNum | operator- (const CBigNum &a, const CBigNum &b) |
| const friend CBigNum | operator/ (const CBigNum &a, const CBigNum &b) |
| const friend CBigNum | operator% (const CBigNum &a, const CBigNum &b) |
| const friend CBigNum | operator* (const CBigNum &a, const CBigNum &b) |
| const friend CBigNum | operator<< (const CBigNum &a, unsigned int shift) |
| const friend CBigNum | operator- (const CBigNum &a) |
| bool | operator== (const CBigNum &a, const CBigNum &b) |
| bool | operator!= (const CBigNum &a, const CBigNum &b) |
| bool | operator<= (const CBigNum &a, const CBigNum &b) |
| bool | operator>= (const CBigNum &a, const CBigNum &b) |
| bool | operator< (const CBigNum &a, const CBigNum &b) |
| bool | operator> (const CBigNum &a, const CBigNum &b) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
1.8.17