Definition of EFq math. More...
Functions | |
void | EFqMulSSCM (EccPointJacobiFq *result, EccPointJacobiFq const *base, FpElem const *exp) |
Multiply two points in EFq. More... | |
int | EFqAffineExp (EccPointFq *result, EccPointFq const *base, FpElem const *exp) |
Exponentiate a point in EFq by an element of Fp. More... | |
int | EFqAffineMultiExp (EccPointFq *result, EccPointFq const *base0, FpElem const *exp0, EccPointFq const *base1, FpElem const *exp1) |
Sum the results of exponentiating two points in EFq by elements of Fp. More... | |
void | EFqMultiExp (EccPointJacobiFq *result, EccPointJacobiFq const *base0, FpElem const *exp0, EccPointJacobiFq const *base1, FpElem const *exp1) |
Sum the results of exponentiating two points in EFq by elements of Fp. More... | |
int | EFqAffineAdd (EccPointFq *result, EccPointFq const *left, EccPointFq const *right) |
Add two points in EFq. More... | |
int | EFqAffineDbl (EccPointFq *result, EccPointFq const *in) |
Double a point in EFq. More... | |
void | EFqDbl (EccPointJacobiFq *result, EccPointJacobiFq const *in) |
Double a point in EFq. More... | |
void | EFqAdd (EccPointJacobiFq *result, EccPointJacobiFq const *left, EccPointJacobiFq const *right) |
Add two points in EFq. More... | |
int | EFqRand (EccPointFq *result, BitSupplier rnd_func, void *rnd_param) |
Generate a random point in EFq. More... | |
void | EFqSet (EccPointJacobiFq *result, FqElem const *x, FqElem const *y) |
Set a point's value. More... | |
int | EFqIsInf (EccPointJacobiFq const *in) |
Test if a point is infinity. More... | |
void | EFqFromAffine (EccPointJacobiFq *result, EccPointFq const *in) |
Convert a point from Affine to Jacobi representation. More... | |
int | EFqToAffine (EccPointFq *result, EccPointJacobiFq const *in) |
Convert a point from Jacobi to Affine representation. More... | |
void | EFqNeg (EccPointJacobiFq *result, EccPointJacobiFq const *in) |
Negate a point on EFq. More... | |
int | EFqEq (EccPointJacobiFq const *left, EccPointJacobiFq const *right) |
Test if two points on EFq are equal. More... | |
int | EFqHash (EccPointFq *result, unsigned char const *msg, size_t len, HashAlg hashalg) |
Hashes an arbitrary message to a point on EFq. More... | |
void | EFqCp (EccPointFq *result, EccPointFq const *in) |
Copy a point's value. More... | |
int | EFqEqAffine (EccPointFq const *left, EccPointFq const *right) |
Test if two points on EFq are equal. More... | |
void | EFqCondSet (EccPointJacobiFq *result, EccPointJacobiFq const *true_val, EccPointJacobiFq const *false_val, int truth_val) |
Conditionally Set a point's value to one of two values. More... | |
void | EFqJCp (EccPointJacobiFq *result, EccPointJacobiFq const *in) |
Copy a point's value. More... | |
void | EFqInf (EccPointJacobiFq *result) |
Set an element's value to infinity. More... | |
int | EFqOnCurve (EccPointFq const *in) |
Test if a point is on EFq. More... | |
int | EFqJOnCurve (EccPointJacobiFq const *in) |
Test if a point is on EFq. More... | |
int | EFqJRand (EccPointJacobiFq *result, BitSupplier rnd_func, void *rnd_param) |
Generate a random point in EFq. More... | |
Definition of EFq math.
void EFqAdd | ( | EccPointJacobiFq * | result, |
EccPointJacobiFq const * | left, | ||
EccPointJacobiFq const * | right | ||
) |
Add two points in EFq.
[out] | result | of adding left and right. |
[in] | left | The first operand to be added. |
[in] | right | The second operand to be added. |
int EFqAffineAdd | ( | EccPointFq * | result, |
EccPointFq const * | left, | ||
EccPointFq const * | right | ||
) |
Add two points in EFq.
[out] | result | of adding left and right. |
[in] | left | The first operand to be added. |
[in] | right | The second operand to be added. |
int EFqAffineDbl | ( | EccPointFq * | result, |
EccPointFq const * | in | ||
) |
Double a point in EFq.
[out] | result | target. |
[in] | in | the value to double. |
int EFqAffineExp | ( | EccPointFq * | result, |
EccPointFq const * | base, | ||
FpElem const * | exp | ||
) |
Exponentiate a point in EFq by an element of Fp.
[out] | result | target. |
[in] | base | the base. |
[in] | exp | the exponent. |
int EFqAffineMultiExp | ( | EccPointFq * | result, |
EccPointFq const * | base0, | ||
FpElem const * | exp0, | ||
EccPointFq const * | base1, | ||
FpElem const * | exp1 | ||
) |
Sum the results of exponentiating two points in EFq by elements of Fp.
[out] | result | target. |
[in] | base0 | the first base. |
[in] | exp0 | the first exponent. |
[in] | base1 | the second base. |
[in] | exp1 | the second exponent. |
void EFqCondSet | ( | EccPointJacobiFq * | result, |
EccPointJacobiFq const * | true_val, | ||
EccPointJacobiFq const * | false_val, | ||
int | truth_val | ||
) |
Conditionally Set a point'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. |
void EFqCp | ( | EccPointFq * | result, |
EccPointFq const * | in | ||
) |
Copy a point's value.
[out] | result | copy target. |
[in] | in | copy source. |
void EFqDbl | ( | EccPointJacobiFq * | result, |
EccPointJacobiFq const * | in | ||
) |
Double a point in EFq.
[out] | result | target. |
[in] | in | the value to double. |
int EFqEq | ( | EccPointJacobiFq const * | left, |
EccPointJacobiFq const * | right | ||
) |
Test if two points on EFq are equal.
[in] | left | The first operand to be tested. |
[in] | right | The second operand to be tested. |
int EFqEqAffine | ( | EccPointFq const * | left, |
EccPointFq const * | right | ||
) |
Test if two points on EFq are equal.
[in] | left | The first operand to be tested. |
[in] | right | The second operand to be tested. |
void EFqFromAffine | ( | EccPointJacobiFq * | result, |
EccPointFq const * | in | ||
) |
Convert a point from Affine to Jacobi representation.
[out] | result | target. |
[in] | in | value to set. |
int EFqHash | ( | EccPointFq * | result, |
unsigned char const * | msg, | ||
size_t | len, | ||
HashAlg | hashalg | ||
) |
Hashes an arbitrary message to a point on EFq.
[out] | result | target. |
[in] | msg | buffer to reinterpret. |
[in] | len | length of msg in bytes. |
[in] | hashalg | hash algorithm to use. |
void EFqInf | ( | EccPointJacobiFq * | result | ) |
Set an element's value to infinity.
[out] | result | element to set. |
int EFqIsInf | ( | EccPointJacobiFq const * | in | ) |
Test if a point is infinity.
[in] | in | the point to test. |
void EFqJCp | ( | EccPointJacobiFq * | result, |
EccPointJacobiFq const * | in | ||
) |
Copy a point's value.
[out] | result | copy target. |
[in] | in | copy source. |
int EFqJOnCurve | ( | EccPointJacobiFq const * | in | ) |
Test if a point is on EFq.
[in] | in | the point to test. |
int EFqJRand | ( | EccPointJacobiFq * | result, |
BitSupplier | rnd_func, | ||
void * | rnd_param | ||
) |
Generate a random point in EFq.
[in] | result | the random value. |
[in] | rnd_func | Random number generator. |
[in] | rnd_param | Pass through context data for rnd_func. |
void EFqMulSSCM | ( | EccPointJacobiFq * | result, |
EccPointJacobiFq const * | base, | ||
FpElem const * | exp | ||
) |
Multiply two points in EFq.
This function is mitigated against software side-channel attacks.
[out] | result | of multiplying left and right. |
[in] | base | The first operand to be multiplied. |
[in] | exp | The second operand to be multiplied. |
void EFqMultiExp | ( | EccPointJacobiFq * | result, |
EccPointJacobiFq const * | base0, | ||
FpElem const * | exp0, | ||
EccPointJacobiFq const * | base1, | ||
FpElem const * | exp1 | ||
) |
Sum the results of exponentiating two points in EFq by elements of Fp.
[out] | result | target. |
[in] | base0 | the first base. |
[in] | exp0 | the first exponent. |
[in] | base1 | the second base. |
[in] | exp1 | the second exponent. |
void EFqNeg | ( | EccPointJacobiFq * | result, |
EccPointJacobiFq const * | in | ||
) |
Negate a point on EFq.
[out] | result | the negative of the element. |
[in] | in | the element to negate. |
int EFqOnCurve | ( | EccPointFq const * | in | ) |
Test if a point is on EFq.
[in] | in | the point to test. |
int EFqRand | ( | EccPointFq * | result, |
BitSupplier | rnd_func, | ||
void * | rnd_param | ||
) |
Generate a random point in EFq.
[in] | result | the random value. |
[in] | rnd_func | Random number generator. |
[in] | rnd_param | Pass through context data for rnd_func. |
void EFqSet | ( | EccPointJacobiFq * | result, |
FqElem const * | x, | ||
FqElem const * | y | ||
) |
Set a point's value.
[out] | result | target. |
[in] | x | value to set. |
[in] | y | value to set. |
int EFqToAffine | ( | EccPointFq * | result, |
EccPointJacobiFq const * | in | ||
) |
Convert a point from Jacobi to Affine representation.
[out] | result | target. |
[in] | in | value to set. |