Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Friends | List of all members
CBigNum Class Reference

C++ wrapper for BIGNUM (OpenSSL bignum) More...

#include <bignum.h>

+ Inheritance diagram for CBigNum:
+ Collaboration diagram for CBigNum:

Public Member Functions

 CBigNum ()
 
 CBigNum (const CBigNum &b)
 
CBigNumoperator= (const CBigNum &b)
 
 ~CBigNum ()
 
 CBigNum (signed char n)
 
 CBigNum (short n)
 
 CBigNum (int n)
 
 CBigNum (long n)
 
 CBigNum (long long n)
 
 CBigNum (unsigned char n)
 
 CBigNum (unsigned short n)
 
 CBigNum (unsigned int n)
 
 CBigNum (unsigned long n)
 
 CBigNum (unsigned long long n)
 
 CBigNum (uint256 n)
 
 CBigNum (const std::vector< unsigned char > &vch)
 
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
 
CBigNumSetCompact (unsigned int nCompact)
 
unsigned int GetCompact () const
 
void SetHex (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)
 
bool operator! () const
 
CBigNumoperator+= (const CBigNum &b)
 
CBigNumoperator-= (const CBigNum &b)
 
CBigNumoperator*= (const CBigNum &b)
 
CBigNumoperator/= (const CBigNum &b)
 
CBigNumoperator%= (const CBigNum &b)
 
CBigNumoperator<<= (unsigned int shift)
 
CBigNumoperator>>= (unsigned int shift)
 
CBigNumoperator++ ()
 
const CBigNum operator++ (int)
 
CBigNumoperator-- ()
 
const CBigNum operator-- (int)
 

Friends

const CBigNum operator- (const CBigNum &a, const CBigNum &b)
 
const CBigNum operator/ (const CBigNum &a, const CBigNum &b)
 
const CBigNum operator% (const CBigNum &a, const CBigNum &b)
 

Detailed Description

C++ wrapper for BIGNUM (OpenSSL bignum)

Definition at line 57 of file bignum.h.

Constructor & Destructor Documentation

CBigNum::CBigNum ( )
inline

Definition at line 60 of file bignum.h.

CBigNum::CBigNum ( const CBigNum b)
inline

Definition at line 65 of file bignum.h.

CBigNum::~CBigNum ( )
inline

Definition at line 82 of file bignum.h.

CBigNum::CBigNum ( signed char  n)
inline

Definition at line 88 of file bignum.h.

References setint64(), and setulong().

+ Here is the call graph for this function:

CBigNum::CBigNum ( short  n)
inline

Definition at line 89 of file bignum.h.

References setint64(), and setulong().

+ Here is the call graph for this function:

CBigNum::CBigNum ( int  n)
inline

Definition at line 90 of file bignum.h.

References setint64(), and setulong().

+ Here is the call graph for this function:

CBigNum::CBigNum ( long  n)
inline

Definition at line 91 of file bignum.h.

References setint64(), and setulong().

+ Here is the call graph for this function:

CBigNum::CBigNum ( long long  n)
inline

Definition at line 92 of file bignum.h.

References setint64().

+ Here is the call graph for this function:

CBigNum::CBigNum ( unsigned char  n)
inline

Definition at line 93 of file bignum.h.

References setulong().

+ Here is the call graph for this function:

CBigNum::CBigNum ( unsigned short  n)
inline

Definition at line 94 of file bignum.h.

References setulong().

+ Here is the call graph for this function:

CBigNum::CBigNum ( unsigned int  n)
inline

Definition at line 95 of file bignum.h.

References setulong().

+ Here is the call graph for this function:

CBigNum::CBigNum ( unsigned long  n)
inline

Definition at line 96 of file bignum.h.

References setulong().

+ Here is the call graph for this function:

CBigNum::CBigNum ( unsigned long long  n)
inline

Definition at line 97 of file bignum.h.

References setuint64().

+ Here is the call graph for this function:

CBigNum::CBigNum ( uint256  n)
inlineexplicit

Definition at line 98 of file bignum.h.

References setuint256().

+ Here is the call graph for this function:

CBigNum::CBigNum ( const std::vector< unsigned char > &  vch)
inlineexplicit

Definition at line 100 of file bignum.h.

References setvch().

+ Here is the call graph for this function:

Member Function Documentation

unsigned int CBigNum::GetCompact ( ) const
inline

Definition at line 314 of file bignum.h.

Referenced by ComputeMinWork(), and GetNextWorkRequired().

+ Here is the caller graph for this function:

std::string CBigNum::GetHex ( ) const
inline

Definition at line 394 of file bignum.h.

References ToString().

+ Here is the call graph for this function:

int CBigNum::getint ( ) const
inline

Definition at line 122 of file bignum.h.

unsigned int CBigNum::GetSerializeSize ( int  nType = 0,
int  nVersion = PROTOCOL_VERSION 
) const
inline

Definition at line 399 of file bignum.h.

References GetSerializeSize(), and getvch().

+ Here is the call graph for this function:

unsigned int CBigNum::getuint ( ) const
inline

Definition at line 117 of file bignum.h.

uint256 CBigNum::getuint256 ( ) const
inline

Definition at line 231 of file bignum.h.

Referenced by AddToBlockIndex(), CheckProofOfWork(), getblocktemplate(), GetNextWorkRequired(), and LoadBlockIndexDB().

+ Here is the caller graph for this function:

unsigned long CBigNum::getulong ( ) const
inline

Definition at line 112 of file bignum.h.

Referenced by ToString().

+ Here is the caller graph for this function:

std::vector<unsigned char> CBigNum::getvch ( ) const
inline

Definition at line 261 of file bignum.h.

Referenced by GetSerializeSize(), and Serialize().

+ Here is the caller graph for this function:

bool CBigNum::operator! ( ) const
inline

Definition at line 419 of file bignum.h.

CBigNum& CBigNum::operator%= ( const CBigNum b)
inline

Definition at line 451 of file bignum.h.

CBigNum& CBigNum::operator*= ( const CBigNum b)
inline

Definition at line 437 of file bignum.h.

CBigNum& CBigNum::operator++ ( )
inline

Definition at line 482 of file bignum.h.

const CBigNum CBigNum::operator++ ( int  )
inline

Definition at line 490 of file bignum.h.

CBigNum& CBigNum::operator+= ( const CBigNum b)
inline

Definition at line 424 of file bignum.h.

CBigNum& CBigNum::operator-- ( )
inline

Definition at line 498 of file bignum.h.

const CBigNum CBigNum::operator-- ( int  )
inline

Definition at line 508 of file bignum.h.

CBigNum& CBigNum::operator-= ( const CBigNum b)
inline

Definition at line 431 of file bignum.h.

CBigNum& CBigNum::operator/= ( const CBigNum b)
inline

Definition at line 445 of file bignum.h.

CBigNum& CBigNum::operator<<= ( unsigned int  shift)
inline

Definition at line 457 of file bignum.h.

CBigNum& CBigNum::operator= ( const CBigNum b)
inline

Definition at line 75 of file bignum.h.

CBigNum& CBigNum::operator>>= ( unsigned int  shift)
inline

Definition at line 464 of file bignum.h.

template<typename Stream >
void CBigNum::Serialize ( Stream &  s,
int  nType = 0,
int  nVersion = PROTOCOL_VERSION 
) const
inline

Definition at line 405 of file bignum.h.

References getvch().

+ Here is the call graph for this function:

CBigNum& CBigNum::SetCompact ( unsigned int  nCompact)
inline

Definition at line 295 of file bignum.h.

Referenced by CheckProofOfWork(), ComputeMinWork(), getblocktemplate(), CBlockIndex::GetBlockWork(), GetNextWorkRequired(), and ProcessBlock().

+ Here is the caller graph for this function:

void CBigNum::SetHex ( const std::string &  str)
inline

Definition at line 338 of file bignum.h.

References HexDigit().

+ Here is the call graph for this function:

void CBigNum::setint64 ( int64_t  sn)
inline

Definition at line 131 of file bignum.h.

Referenced by CBigNum().

+ Here is the caller graph for this function:

void CBigNum::setuint256 ( uint256  n)
inline

Definition at line 203 of file bignum.h.

Referenced by CBigNum().

+ Here is the caller graph for this function:

void CBigNum::setuint64 ( uint64_t  n)
inline

Definition at line 176 of file bignum.h.

Referenced by CBigNum().

+ Here is the caller graph for this function:

void CBigNum::setulong ( unsigned long  n)
inline

Definition at line 106 of file bignum.h.

Referenced by CBigNum().

+ Here is the caller graph for this function:

void CBigNum::setvch ( const std::vector< unsigned char > &  vch)
inline

Definition at line 246 of file bignum.h.

Referenced by CBigNum(), and Unserialize().

+ Here is the caller graph for this function:

std::string CBigNum::ToString ( int  nBase = 10) const
inline

Definition at line 368 of file bignum.h.

References getulong().

Referenced by GetHex().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename Stream >
void CBigNum::Unserialize ( Stream &  s,
int  nType = 0,
int  nVersion = PROTOCOL_VERSION 
)
inline

Definition at line 411 of file bignum.h.

References setvch().

+ Here is the call graph for this function:

Friends And Related Function Documentation

const CBigNum operator% ( const CBigNum a,
const CBigNum b 
)
friend

Definition at line 565 of file bignum.h.

const CBigNum operator- ( const CBigNum a,
const CBigNum b 
)
friend

Definition at line 532 of file bignum.h.

const CBigNum operator/ ( const CBigNum a,
const CBigNum b 
)
friend

Definition at line 556 of file bignum.h.


The documentation for this class was generated from the following file: