#include <bigint.h>
class RInteger : public TInteger |
Public Member Functions | |
---|---|
RInteger(void) | |
RInteger(const RInteger &) | |
IMPORT_C void | CallClose(TAny *) |
IMPORT_C void | Close(void) |
IMPORT_C RInteger | NewEmptyL(TUint) |
IMPORT_C RInteger | NewL(void) |
IMPORT_C RInteger | NewL(const TDesC8 &) |
IMPORT_C RInteger | NewL(const TInteger &) |
IMPORT_C RInteger | NewL(TInt) |
IMPORT_C RInteger | NewL(TUint) |
IMPORT_C RInteger | NewPrimeL(TUint, TRandomAttribute) |
IMPORT_C RInteger | NewRandomL(TUint, TRandomAttribute) |
IMPORT_C RInteger | NewRandomL(const TInteger &, const TInteger &) |
IMPORT_C | operator TCleanupItem() |
IMPORT_C RInteger & | operator=(const RInteger &) |
Inherited Attributes | |
---|---|
TInteger::iPtr | |
TInteger::iSize |
Inherited Enumerations | |
---|---|
TInteger:TRandomAttribute | |
TInteger:TSign |
A TInteger derived class allowing the construction of variable length big integers. See the Cryptography API guide for further information.
See also: TInteger
IMPORT_C | RInteger | ( | void | ) |
Creates an RInteger object with no associated internal (heap) storage.
All data members are initialised to zero. It is safe (although not strictly necessary) to push such an RInteger object onto the CleanupStack. This is useful, for example, if you want to pass an RInteger object by reference into a function and have it create the representation of the actual integer for you.
Note that performing any operation on such an RInteger object other than the default assignment operator or copy constructor will panic your code.
IMPORT_C | RInteger | ( | const RInteger & | aInteger | ) |
Copy constructor
This function performs a shallow copy, i.e. the memory holding the integer is not copied.
IMPORT_C void | Close | ( | void | ) |
Zeros and then frees any memory owned by this RInteger object.
An RInteger object that has been closed can safely fall off the stack.
Creates a new integer with a preallocated internal storage of aNumWords all initialised to zero.
The resulting RInteger object is logically equivalent to RInteger::NewL(0). The only difference is that the internal storage requirements have been specified to be larger than the default. This is useful if you are about to perform an operation on this integer, that you know the resulting size requirements of, and wish to avoid a heap resize.
Parameters | |
---|---|
aNumWords | The number of words for to preallocated and zero fill. |
IMPORT_C RInteger | NewL | ( | void | ) | [static] |
Creates a new integer representing 0.
IMPORT_C RInteger | NewPrimeL | ( | TUint | aBits, |
TRandomAttribute | aAttr = EAllBitsRandom | |||
) | [static] |
Finds a random prime integer in the range of [2, 2^aBits].
This is done by picking a random integer and using that as a starting point for a sequential search for a prime. To verify the primality of number, this algorithm uses a probablistic primality test. This means that it is possible, although extremely improbable, that the number returned is a pseudoprime.
Parameters | |
---|---|
aBits | The number of bits you wish to randomly select your prime from. |
aAttr | Enum specifying whether specific bits in the random number should be set. See TRandomAttribute for more information. |
IMPORT_C RInteger | NewRandomL | ( | TUint | aBits, |
TRandomAttribute | aAttr = EAllBitsRandom | |||
) | [static] |
Creates a random integer uniformly distributed over [0, 2^aBits].
Parameters | |
---|---|
aBits | The number of bits you wish to randomly select. |
aAttr | Enum specifying whether specific bits in the random number should be set. See TRandomAttribute for more information. |
Creates a random integer uniformly distributed over [x | min <= x <= max].
Parameters | |
---|---|
aMin | The smallest possible value for the random integer (inclusive). |
aMax | The largest possible value for the random integer (inclusive). |
IMPORT_C | operator TCleanupItem | ( | ) |
An overloaded TCleanupItem() allowing the RIntegers to be pushed, popped, and destroyed via the CleanupStack like any other CBase derived object.