Definition of Fq math. More...
Functions | |
int | FqInField (FqElem const *in) |
Test if an element is in Fq. More... | |
void | FqAdd (FqElem *result, FqElem const *left, FqElem const *right) |
Add two elements of Fq. More... | |
void | FqSub (FqElem *result, FqElem const *left, FqElem const *right) |
Subtract two elements of Fq. More... | |
void | FqMul (FqElem *result, FqElem const *left, FqElem const *right) |
Multiply two elements of Fq. More... | |
void | FqExp (FqElem *result, FqElem const *base, VeryLargeInt const *exp) |
Exponentiate an element of Fq by a large integer. More... | |
void | FqCp (FqElem *result, FqElem const *in) |
Copy an element's value. More... | |
int | FqIsZero (FqElem const *value) |
Test if an element is zero. More... | |
void | FqInv (FqElem *result, FqElem const *in) |
Invert an element of Fq. More... | |
void | FqNeg (FqElem *result, FqElem const *in) |
Negate an element of Fq. More... | |
void | FqSquare (FqElem *result, FqElem const *in) |
Square an element of Fq. More... | |
void | FqClear (FqElem *result) |
Clear an element's value. More... | |
void | FqSet (FqElem *result, uint32_t in) |
Set an element's value. More... | |
int | FqEq (FqElem const *left, FqElem const *right) |
Test if two elements in Fq are equal. More... | |
void | FqCondSet (FqElem *result, FqElem const *true_val, FqElem const *false_val, int truth_val) |
Conditionally Set an element's value to one of two values. More... | |
int | FqSqrt (FqElem *result, FqElem const *in) |
Compute the Square root of an element of Fq. More... | |
int | FqRand (FqElem *result, BitSupplier rnd_func, void *rnd_param) |
Generate a random element of Fq. More... | |
void | FqFromHash (FqElem *result, unsigned char const *hash, size_t len) |
Reinterpret a buffer as an element of Fq. More... | |
Definition of Fq math.
Add two elements of Fq.
[out] | result | of adding left and right. |
[in] | left | The first operand to be added. |
[in] | right | The second operand to be added. |
void FqClear | ( | FqElem * | result | ) |
Clear an element's value.
[out] | result | element to clear. |
void FqCondSet | ( | FqElem * | result, |
FqElem const * | true_val, | ||
FqElem const * | false_val, | ||
int | truth_val | ||
) |
Conditionally Set an element'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. |
Copy an element's value.
[out] | result | copy target. |
[in] | in | copy source. |
Test if two elements in Fq are equal.
[in] | left | The first operand to be tested. |
[in] | right | The second operand to be tested. |
void FqExp | ( | FqElem * | result, |
FqElem const * | base, | ||
VeryLargeInt const * | exp | ||
) |
Exponentiate an element of Fq by a large integer.
[out] | result | target. |
[in] | base | the base. |
[in] | exp | the exponent. |
void FqFromHash | ( | FqElem * | result, |
unsigned char const * | hash, | ||
size_t | len | ||
) |
Reinterpret a buffer as an element of Fq.
[out] | result | target. |
[in] | hash | buffer to reinterpret. |
[in] | len | length of hash in bytes. |
int FqInField | ( | FqElem const * | in | ) |
Test if an element is in Fq.
[in] | in | the element to test. |
Invert an element of Fq.
[out] | result | the inverse of the element. |
[in] | in | the element to invert. |
int FqIsZero | ( | FqElem const * | value | ) |
Test if an element is zero.
[in] | value | the element to test. |
Multiply two elements of Fq.
[out] | result | of multiplying left and right. |
[in] | left | The first operand to be multiplied. |
[in] | right | The second operand to be multiplied. |
Negate an element of Fq.
This function was formerly called as FqConst.
[out] | result | the negative of the element. |
[in] | in | the element to negate. |
int FqRand | ( | FqElem * | result, |
BitSupplier | rnd_func, | ||
void * | rnd_param | ||
) |
Generate a random element of Fq.
[in] | result | the random value. |
[in] | rnd_func | Random number generator. |
[in] | rnd_param | Pass through context data for rnd_func. |
void FqSet | ( | FqElem * | result, |
uint32_t | in | ||
) |
Set an element's value.
[out] | result | target. |
[in] | in | value to set. |
Compute the Square root of an element of Fq.
[out] | result | the square root of the element. |
[in] | in | the element to find the square root of. |
Square an element of Fq.
[out] | result | the square of the element. |
[in] | in | the element to square. |