#include <BigNumber.h>
struct bignum_st * _bn
Definition: BigNumber.h:98
struct bignum_st * _bn
Definition: BigNumber.h:98
BigNumber::BigNumber |
( |
uint32 |
val | ) |
|
37 BN_set_word(
_bn, val);
struct bignum_st * _bn
Definition: BigNumber.h:98
BigNumber::~BigNumber |
( |
| ) |
|
struct bignum_st * _bn
Definition: BigNumber.h:98
std::unique_ptr< uint8[]> BigNumber::AsByteArray |
( |
int32 |
minSize = 0 , |
|
|
bool |
littleEndian = true |
|
) |
| |
180 int length = (minSize >= numBytes) ? minSize : numBytes;
185 if (length > numBytes)
186 memset((
void*)array, 0, length);
188 BN_bn2bin(
_bn, (
unsigned char *)array);
192 std::reverse(array, array + numBytes);
194 std::unique_ptr<uint8[]> ret(array);
int32 GetNumBytes(void)
Definition: BigNumber.cpp:157
float length(float v)
Definition: vectorMath.h:208
struct bignum_st * _bn
Definition: BigNumber.h:98
uint8_t uint8
Definition: Define.h:152
std::string BigNumber::AsDecStr |
( |
| ) |
const |
208 char* ch = BN_bn2dec(
_bn);
209 std::string ret = ch;
struct bignum_st * _bn
Definition: BigNumber.h:98
uint32_t uint32
Definition: Define.h:150
struct bignum_st * _bn
Definition: BigNumber.h:98
std::string BigNumber::AsHexStr |
( |
| ) |
const |
200 char* ch = BN_bn2hex(
_bn);
201 std::string ret = ch;
struct bignum_st * _bn
Definition: BigNumber.h:98
struct bignum_st* BigNumber::BN |
( |
| ) |
|
|
inline |
struct bignum_st * _bn
Definition: BigNumber.h:98
138 bnctx = BN_CTX_new();
139 BN_exp(ret.
_bn,
_bn, bn._bn, bnctx);
Definition: BigNumber.h:28
struct bignum_st * _bn
Definition: BigNumber.h:98
int32 BigNumber::GetNumBytes |
( |
void |
| ) |
|
159 return BN_num_bytes(
_bn);
struct bignum_st * _bn
Definition: BigNumber.h:98
bool BigNumber::IsNegative |
( |
| ) |
const |
174 return BN_is_negative(
_bn);
struct bignum_st * _bn
Definition: BigNumber.h:98
bool BigNumber::IsZero |
( |
| ) |
const |
169 return BN_is_zero(
_bn);
struct bignum_st * _bn
Definition: BigNumber.h:98
150 bnctx = BN_CTX_new();
151 BN_mod_exp(ret.
_bn,
_bn, bn1._bn, bn2._bn, bnctx);
Definition: BigNumber.h:28
struct bignum_st * _bn
Definition: BigNumber.h:98
Definition: BigNumber.h:28
126 bnctx = BN_CTX_new();
127 BN_mod(
_bn,
_bn, bn._bn, bnctx);
struct bignum_st * _bn
Definition: BigNumber.h:98
Definition: BigNumber.h:28
104 bnctx = BN_CTX_new();
105 BN_mul(
_bn,
_bn, bn._bn, bnctx);
struct bignum_st * _bn
Definition: BigNumber.h:98
Definition: BigNumber.h:28
struct bignum_st * _bn
Definition: BigNumber.h:98
Definition: BigNumber.h:28
struct bignum_st * _bn
Definition: BigNumber.h:98
Definition: BigNumber.h:28
115 bnctx = BN_CTX_new();
arena_t NULL
Definition: jemalloc_internal.h:624
struct bignum_st * _bn
Definition: BigNumber.h:98
struct bignum_st * _bn
Definition: BigNumber.h:98
61 for (
int i = 0; i < len; i++)
62 array[i] = bytes[len - 1 - i];
64 BN_bin2bn(array, len,
_bn);
struct bignum_st * _bn
Definition: BigNumber.h:98
uint8_t uint8
Definition: Define.h:152
void BigNumber::SetDword |
( |
uint32 |
val | ) |
|
47 BN_set_word(
_bn, val);
struct bignum_st * _bn
Definition: BigNumber.h:98
void BigNumber::SetHexStr |
( |
char const * |
str | ) |
|
struct bignum_st * _bn
Definition: BigNumber.h:98
void BigNumber::SetQword |
( |
uint64 |
val | ) |
|
54 BN_add_word(
_bn, (
uint32)(val & 0xFFFFFFFF));
uint32_t uint32
Definition: Define.h:150
struct bignum_st * _bn
Definition: BigNumber.h:98
void BigNumber::SetRand |
( |
int32 |
numbits | ) |
|
76 BN_rand(
_bn, numbits, 0, 1);
struct bignum_st * _bn
Definition: BigNumber.h:98
struct bignum_st* BigNumber::_bn |
|
private |
The documentation for this class was generated from the following files: