Definition of Large Integer math. More...
Functions | |
uint32_t | VliAdd (VeryLargeInt *result, VeryLargeInt const *left, VeryLargeInt const *right) |
Add two large integers. More... | |
void | VliMul (VeryLargeIntProduct *result, VeryLargeInt const *left, VeryLargeInt const *right) |
Multiply two large integers. More... | |
void | VliRShift (VeryLargeInt *result, VeryLargeInt const *in, uint32_t shift) |
Right shift a large integers. More... | |
uint32_t | VliSub (VeryLargeInt *result, VeryLargeInt const *left, VeryLargeInt const *right) |
Subtract two large integers. More... | |
void | VliSet (VeryLargeInt *result, VeryLargeInt const *in) |
Set a large integer's value. More... | |
void | VliClear (VeryLargeInt *result) |
Clear a large integer's value. More... | |
int | VliIsZero (VeryLargeInt const *in) |
Test if a large integer is zero. More... | |
void | VliCondSet (VeryLargeInt *result, VeryLargeInt const *true_val, VeryLargeInt const *false_val, int truth_val) |
Conditionally Set a large inter's value to one of two values. More... | |
uint32_t | VliTestBit (VeryLargeInt const *in, uint32_t bit) |
Test the value of a bit in a large integer. More... | |
int | VliRand (VeryLargeInt *result, BitSupplier rnd_func, void *rnd_param) |
Generate a random large integer. More... | |
int | VliCmp (VeryLargeInt const *left, VeryLargeInt const *right) |
compare two large integers. More... | |
void | VliModAdd (VeryLargeInt *result, VeryLargeInt const *left, VeryLargeInt const *right, VeryLargeInt const *mod) |
Add two large integers modulo a value. More... | |
void | VliModSub (VeryLargeInt *result, VeryLargeInt const *left, VeryLargeInt const *right, VeryLargeInt const *mod) |
Subtract two large integers modulo a value. More... | |
void | VliModMul (VeryLargeInt *result, VeryLargeInt const *left, VeryLargeInt const *right, VeryLargeInt const *mod) |
Multiply two large integers modulo a value. More... | |
void | VliModExp (VeryLargeInt *result, VeryLargeInt const *base, VeryLargeInt const *exp, VeryLargeInt const *mod) |
Exponentiate a large integer modulo a value. More... | |
void | VliModInv (VeryLargeInt *result, VeryLargeInt const *input, VeryLargeInt const *mod) |
Invert a large integer modulo a value. More... | |
void | VliModSquare (VeryLargeInt *result, VeryLargeInt const *input, VeryLargeInt const *mod) |
Square a large integer modulo a value. More... | |
void | VliModBarrett (VeryLargeInt *result, VeryLargeIntProduct const *input, VeryLargeInt const *mod) |
Reduce a value to a modulo. More... | |
Definition of Large Integer math.
uint32_t VliAdd | ( | VeryLargeInt * | result, |
VeryLargeInt const * | left, | ||
VeryLargeInt const * | right | ||
) |
Add two large integers.
[out] | result | target. |
[in] | left | The first operand to be added. |
[in] | right | The second operand to be added. |
void VliClear | ( | VeryLargeInt * | result | ) |
Clear a large integer's value.
[out] | result | value to clear. |
int VliCmp | ( | VeryLargeInt const * | left, |
VeryLargeInt const * | right | ||
) |
compare two large integers.
[in] | left | the left hand value. |
[in] | right | the right hand value. |
void VliCondSet | ( | VeryLargeInt * | result, |
VeryLargeInt const * | true_val, | ||
VeryLargeInt const * | false_val, | ||
int | truth_val | ||
) |
Conditionally Set a large inter's value to one of two values.
[out] | result | target. |
[in] | true_val | value to set if condition is true. |
[in] | false_val | value to set if condition is false. |
[in] | truth_val | value of condition. |
int VliIsZero | ( | VeryLargeInt const * | in | ) |
Test if a large integer is zero.
[in] | in | the value to test. |
void VliModAdd | ( | VeryLargeInt * | result, |
VeryLargeInt const * | left, | ||
VeryLargeInt const * | right, | ||
VeryLargeInt const * | mod | ||
) |
Add two large integers modulo a value.
[out] | result | target. |
[in] | left | The first operand to be added. |
[in] | right | The second operand to be added. |
[in] | mod | The modulo. |
void VliModBarrett | ( | VeryLargeInt * | result, |
VeryLargeIntProduct const * | input, | ||
VeryLargeInt const * | mod | ||
) |
Reduce a value to a modulo.
[out] | result | target. |
[in] | input | the base. |
[in] | mod | The modulo. |
void VliModExp | ( | VeryLargeInt * | result, |
VeryLargeInt const * | base, | ||
VeryLargeInt const * | exp, | ||
VeryLargeInt const * | mod | ||
) |
Exponentiate a large integer modulo a value.
[out] | result | target. |
[in] | base | the base. |
[in] | exp | the exponent. |
[in] | mod | The modulo. |
void VliModInv | ( | VeryLargeInt * | result, |
VeryLargeInt const * | input, | ||
VeryLargeInt const * | mod | ||
) |
Invert a large integer modulo a value.
[out] | result | target. |
[in] | input | the value to invert. |
[in] | mod | The modulo. |
void VliModMul | ( | VeryLargeInt * | result, |
VeryLargeInt const * | left, | ||
VeryLargeInt const * | right, | ||
VeryLargeInt const * | mod | ||
) |
Multiply two large integers modulo a value.
[out] | result | target. |
[in] | left | The first operand to be multiplied. |
[in] | right | The second operand to be multiplied. |
[in] | mod | The modulo. |
void VliModSquare | ( | VeryLargeInt * | result, |
VeryLargeInt const * | input, | ||
VeryLargeInt const * | mod | ||
) |
Square a large integer modulo a value.
[out] | result | target. |
[in] | input | the base. |
[in] | mod | The modulo. |
void VliModSub | ( | VeryLargeInt * | result, |
VeryLargeInt const * | left, | ||
VeryLargeInt const * | right, | ||
VeryLargeInt const * | mod | ||
) |
Subtract two large integers modulo a value.
[out] | result | target. |
[in] | left | The operand to be subtracted from. |
[in] | right | The operand to subtract. |
[in] | mod | The modulo. |
void VliMul | ( | VeryLargeIntProduct * | result, |
VeryLargeInt const * | left, | ||
VeryLargeInt const * | right | ||
) |
Multiply two large integers.
[out] | result | of multiplying left and right. |
[in] | left | The first operand to be multiplied. |
[in] | right | The second operand to be multiplied. |
int VliRand | ( | VeryLargeInt * | result, |
BitSupplier | rnd_func, | ||
void * | rnd_param | ||
) |
Generate a random large integer.
[in] | result | the random value. |
[in] | rnd_func | Random number generator. |
[in] | rnd_param | Pass through context data for rnd_func. |
void VliRShift | ( | VeryLargeInt * | result, |
VeryLargeInt const * | in, | ||
uint32_t | shift | ||
) |
Right shift a large integers.
[out] | result | target. |
[in] | in | The value to be shifted. |
[in] | shift | The number of bits to shift. |
void VliSet | ( | VeryLargeInt * | result, |
VeryLargeInt const * | in | ||
) |
Set a large integer's value.
[out] | result | target. |
[in] | in | value to set. |
uint32_t VliSub | ( | VeryLargeInt * | result, |
VeryLargeInt const * | left, | ||
VeryLargeInt const * | right | ||
) |
Subtract two large integers.
[out] | result | target. |
[in] | left | The operand to be subtracted from. |
[in] | right | The operand to subtract. |
uint32_t VliTestBit | ( | VeryLargeInt const * | in, |
uint32_t | bit | ||
) |
Test the value of a bit in a large integer.
[in] | in | the value to test. |
[in] | bit | the bit index. |