Static Public Member Functions

zeus::TBigIntegerBase Class Reference

#include <BigIntegerBase.h>

List of all members.

Static Public Member Functions

static void add (const Uint8 *pui8Data1, Int iSize1, Uint8 *pui8Data2, Int iSize2)
static bool isNegative (const Uint8 *pui8Data, Int iSize)
static bool isZero (const Uint8 *pui8Data, Int iSize)
static bool isZeroEx (const Uint8 *pui8Data, Int &rLastByteChecked)
static void multiply (const Uint8 *pui8Data1, Int iSize1, const Uint8 *pui8Data2, Int iSize2, Uint8 *pui8Result)
static void negate (Uint8 *pui8Data, Int iSize)
static void shiftLeft (Uint8 *pui8Data, Int iSize, Int iShift)
static void shiftLeft8Bit (Uint8 *pui8Data, Int iSize, Int iShift)
static void shiftRight (Uint8 *pui8Data, Int iSize, Int iShift)
static void shiftRight8Bit (Uint8 *pui8Data, Int iSize, Int iShift)

Detailed Description

implements the base functionality of big integers with bit size >= 64bits


Member Function Documentation

void TBigIntegerBase::add ( const Uint8 pui8Data1,
Int  iSize1,
Uint8 pui8Data2,
Int  iSize2 
) [static]

adds two big numbers together.

Parameters:
pui8Data1: [IN] first number to add
iSize1: [IN] size of the first number
pui8Data2: [INOUT] 2nd number and result
iSize2: [IN] size of the 2nd number
bool zeus::TBigIntegerBase::isNegative ( const Uint8 pui8Data,
Int  iSize 
) [inline, static]

Checks if the number is negative. In this case the top most bit must be set to 1

Parameters:
pui8Data: number to check
iSize: size of the number
Return values:
true: number is negative
false,:number is not negative (zero or positive)
bool zeus::TBigIntegerBase::isZero ( const Uint8 pui8Data,
Int  iSize 
) [inline, static]

Checks if the number is zero

Parameters:
pui8Data: number to check
iSize: size of the number
Return values:
true: number is zero
false,:number is non zero
bool zeus::TBigIntegerBase::isZeroEx ( const Uint8 pui8Data,
Int &  rLastByteChecked 
) [inline, static]

Checks if the number is zero. This implements a left to right check and returns the last checked byte which was not zero.

Parameters:
pui8Data: number to check
rLastByteChecked: [INOUT] last byte checked
Return values:
true: number is zero
false,:number is non zero
void TBigIntegerBase::multiply ( const Uint8 pui8Data1,
Int  iSize1,
const Uint8 pui8Data2,
Int  iSize2,
Uint8 pui8Result 
) [static]

multiplies two big numbers together in a conventional way. Time complexity is O(n^2).

Parameters:
pui8Data1: [IN] first number
iSize1: [IN] size of the first number (in bytes)
pui8Data2: [IN] second number
iSize2: [IN] size of the second number (in bytes)
pui8Result: [OUT] result. make sure the allocated memory is at least iSize1*iSize2
void zeus::TBigIntegerBase::negate ( Uint8 pui8Data,
Int  iSize 
) [inline, static]

negates the number. This converts the number to the additive inverse element

Parameters:
pui8Data: [INOUT] number to negate
iSize: [IN] size of the number
void TBigIntegerBase::shiftLeft ( Uint8 pui8Data,
Int  iSize,
Int  iShift 
) [static]

shifts the big number to left

Parameters:
pui8Data: [INOUT] Number to shift
iSize: [IN] Size of the number in bytes
iShift: [IN] Number of bits to shift
void zeus::TBigIntegerBase::shiftLeft8Bit ( Uint8 pui8Data,
Int  iSize,
Int  iShift 
) [inline, static]

shifts the big number to right (max 7 bits)

Parameters:
pui8Data: [INOUT] Number to shift
iSize: [IN] Size of the number in bytes
iShift: [IN] Number of bits to shift
void TBigIntegerBase::shiftRight ( Uint8 pui8Data,
Int  iSize,
Int  iShift 
) [static]

shifts the big number to right

Parameters:
pui8Data: [INOUT] Number to shift
iSize: [IN] Size of the number in bytes
iShift: [IN] Number of bits to shift
void zeus::TBigIntegerBase::shiftRight8Bit ( Uint8 pui8Data,
Int  iSize,
Int  iShift 
) [inline, static]

shifts the big number to right (max 7 bits)

Parameters:
pui8Data: [INOUT] Number to shift
iSize: [IN] Size of the number in bytes
iShift: [IN] Number of bits to shift

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:33