Ported from http://www.bouncycastle.org/csharp/index.html. More...
#include <BigInteger.h>
Public Member Functions | |
| BigInteger (Array< byte > &bytes) | |
| BigInteger (Array< byte > &bytes, int offset, int length) | |
| BigInteger (int sign, Array< byte > &bytes, int offset, int length) | |
| BigInteger (int sign, Array< byte > &bytes) | |
| BigInteger (int sizeInBits, Random &random) | |
| BigInteger (int bitLength, int certainty, Random &random) | |
| BigInteger (const BigInteger &toCopy) | |
| BigInteger & | operator= (const BigInteger &toAssign) |
| BigInteger & | operator= (const int64 i) |
| bool | TestBit (int n) const |
| int | GetBitLength () const |
| int | GetLowestSetBit () const |
| BigIntegerPtr | Abs () const |
| BigIntegerPtr | Not () const |
| BigIntegerPtr | And (const BigInteger &value) const |
| BigIntegerPtr | Or (const BigInteger &value) const |
| BigIntegerPtr | Xor (const BigInteger &value) const |
| BigIntegerPtr | SetBit (int n) const |
| BigIntegerPtr | ClearBit (int n) const |
| BigIntegerPtr | FlipBit (int n) const |
| BigIntegerPtr | Negate () const |
| BigIntegerPtr | ShiftRight (int n) const |
| BigIntegerPtr | ShiftLeft (int n) const |
| BigIntegerPtr | Remainder (const BigInteger &n) const |
| BigIntegerPtr | ModPow (const BigInteger &exponent, BigInteger &m) |
| BigIntegerPtr | Mod (const BigInteger &m) const |
| BigIntegerPtr | ModInverse (const BigInteger &m) const |
| BigIntegerPtr | Multiply (const BigInteger &val) const |
| BigIntegerPtr | Divide (const BigInteger &val) const |
| Array< BigIntegerPtr > | DivideAndRemainder (const BigInteger &val) const |
| BigIntegerPtr | Add (const BigInteger &value) const |
| BigIntegerPtr | Subtract (const BigInteger &n) const |
| BigIntegerPtr | Gcd (const BigInteger &value) const |
| bool | IsProbablePrime (int certainty) const |
| BigInteger & | operator+= (const BigInteger &bi) |
| BigInteger & | operator-= (const BigInteger &bi) |
| BigInteger & | operator*= (const BigInteger &bi) |
| BigInteger & | operator/= (const BigInteger &bi) |
| BigInteger & | operator<<= (int shiftVal) |
| BigInteger & | operator>>= (int shiftVal) |
| BigInteger & | operator%= (const BigInteger &bi) |
| BigInteger & | operator&= (const BigInteger &bi) |
| BigInteger & | operator|= (const BigInteger &bi) |
| BigInteger & | operator^= (const BigInteger &bi) |
| BigInteger | operator<< (int shiftVal) const |
| BigInteger | operator>> (int shiftVal) const |
| String | ToString () const |
| Array< byte > | ToByteArrayUnsigned () const |
| void | ToByteArrayUnsigned (Array< byte > &a) const |
| Array< byte > | ToByteArray () const |
| void | ToByteArray (Array< byte > &a) const |
| int32 | ToInt () const |
| int64 | ToInt64 () const |
| uint32 | ToUInt () const |
| virtual bool | Equals (const IComparable *a) const |
| virtual int | Compare (const IComparable *a) const |
| virtual bool | Equals (const IComparable &a) const |
| virtual int | Compare (const IComparable &a) const |
| bool | Equals (int64 i) const |
| virtual int32 | MajicNumber () const |
| Class instances with the same majic number are of the same type (can be casted). Majic numbers above 0xFFFF are available for user applications. | |
| virtual int32 | HashCode () const |
| virtual void | CheckMem () const |
| virtual void | ValidateMem () const |
Static Public Member Functions | |
| static BigIntegerPtr | ValueOf (int64 i) |
| static const BigInteger & | Zero () |
| static BigIntegerPtr | ZeroPtr () |
| static const BigInteger & | One () |
| static BigIntegerPtr | OnePtr () |
| static void | CheckMemStatics () |
| static void | DebugClearStatics () |
Friends | |
| BigInteger | operator+ (const BigInteger &bi1, const BigInteger &bi2) |
| BigInteger | operator- (const BigInteger &bi1, const BigInteger &bi2) |
| BigInteger | operator* (const BigInteger &bi1, const BigInteger &bi2) |
| BigInteger | operator/ (const BigInteger &bi1, const BigInteger &bi2) |
| BigInteger | operator% (const BigInteger &bi1, const BigInteger &bi2) |
| BigInteger | operator+ (const BigInteger &bi1, int64 i) |
| BigInteger | operator- (const BigInteger &bi1, int64 i) |
| BigInteger | operator* (const BigInteger &bi1, int64 i) |
| BigInteger | operator/ (const BigInteger &bi1, int64 i) |
| BigInteger | operator% (const BigInteger &bi1, int64 i) |
| BigInteger | operator& (const BigInteger &bi1, const BigInteger &bi2) |
| BigInteger | operator| (const BigInteger &bi1, const BigInteger &bi2) |
| BigInteger | operator^ (const BigInteger &bi1, const BigInteger &bi2) |
| BigInteger | operator- (const BigInteger &bi) |
| BigInteger | operator~ (const BigInteger &bi) |
| BigInteger | operator! (const BigInteger &bi) |
| bool | operator== (const BigInteger &bi1, const BigInteger &bi2) |
| bool | operator== (const BigInteger &bi1, int64 i) |
| bool | operator!= (const BigInteger &bi1, const BigInteger &bi2) |
| bool | operator!= (const BigInteger &bi1, int64 i) |
| bool | operator> (const BigInteger &bi1, const BigInteger &bi2) |
| bool | operator< (const BigInteger &bi1, const BigInteger &bi2) |
| bool | operator>= (const BigInteger &bi1, const BigInteger &bi2) |
| bool | operator<= (const BigInteger &bi1, const BigInteger &bi2) |
| bool | operator&& (const BigInteger &bi1, const BigInteger &bi2) |
| bool | operator|| (const BigInteger &bi1, const BigInteger &bi2) |
Ported from http://www.bouncycastle.org/csharp/index.html.
Definition at line 42 of file BigInteger.h.
| bool BigInteger::IsProbablePrime | ( | int | certainty | ) | const |
return whether or not a BigInteger is probably prime with a probability of 1 - (1/2)**certainty.
From Knuth Vol 2, pg 395.
Definition at line 2361 of file BigInteger.cpp.
| BigIntegerPtr BigInteger::OnePtr | ( | ) | [static] |
BUG: Not thread safe
Definition at line 713 of file BigInteger.cpp.
| BigIntegerPtr BigInteger::ZeroPtr | ( | ) | [static] |
BUG: Not thread safe
Definition at line 744 of file BigInteger.cpp.