-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBigNum.h
35 lines (24 loc) · 781 Bytes
/
BigNum.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "core/variant.h"
#include <openssl/bn.h>
class BigNum{
public:
BigNum();
BigNum(const char* data);
BigNum from_hex(const char* data);
BigNum from_dec(const char* data);
BigNum from_bin(const unsigned char* data, int length);
unsigned char* to_rev_bytearray(int length) const;
unsigned char* to_bytearray(int length) const;
PoolByteArray to_poolbytearray(int length) const;
char* to_hex_string() const;
BigNum operator+(const BigNum& b);
BigNum operator-(const BigNum& b);
BigNum operator*(const BigNum& b);
BigNum operator/(const BigNum& b);
BigNum operator=(const BigNum& b);
BigNum exp(const BigNum& b);
BigNum mod_exp(const BigNum& b, const BigNum& d);
BIGNUM* bn;
private:
};