libktorrent
2.2.0
|
#include <bigint.h>
Public Member Functions | |
BigInt (const BigInt &bi) | |
BigInt (const QString &value) | |
BigInt (Uint32 num_bits=0) | |
BigInt & | operator= (const BigInt &bi) |
Uint32 | toBuffer (Uint8 *buf, Uint32 max_size) const |
Export the bigint ot a buffer. | |
Static Public Member Functions | |
static BigInt | fromBuffer (const Uint8 *buf, Uint32 size) |
Make a BigInt out of a buffer. | |
static BigInt | powerMod (const BigInt &x, const BigInt &e, const BigInt &d) |
static BigInt | random () |
Make a random BigInt. | |
Class which can hold an arbitrary large integer. This will be a very important part of our MSE implementation.
mse::BigInt::BigInt | ( | Uint32 | num_bits = 0 | ) |
Create a big integer, with num_bits bits. All bits will be set to 0.
num_bits | The number of bits |
mse::BigInt::BigInt | ( | const QString & | value | ) |
Create a big integer of a string. The string must be a hexadecimal representation of an integer. For example : 12AFFE123488BBBE123
Letters can be upper or lower case. Invalid chars will create an invalid number.
value | The hexadecimal representation of the number |
Calculates (x ^ e) mod d ^ is power