fq12.h File Reference

Definition of Fq12 math. More...

#include <stdint.h>

Functions

void Fq12Add (Fq12Elem *result, Fq12Elem const *left, Fq12Elem const *right)
 Add two elements of Fq12. More...
 
void Fq12Sub (Fq12Elem *result, Fq12Elem const *left, Fq12Elem const *right)
 Subtract two elements of Fq12. More...
 
void Fq12Square (Fq12Elem *result, Fq12Elem const *in)
 Square an element of Fq12. More...
 
void Fq12Mul (Fq12Elem *result, Fq12Elem const *left, Fq12Elem const *right)
 Multiply two elements of Fq12. More...
 
void Fq12Inv (Fq12Elem *result, Fq12Elem const *in)
 Invert an element of Fq12. More...
 
void Fq12Neg (Fq12Elem *result, Fq12Elem const *in)
 Negate an element of Fq12. More...
 
void Fq12Set (Fq12Elem *result, uint32_t val)
 Set an element's value. More...
 
void Fq12Exp (Fq12Elem *result, Fq12Elem const *base, VeryLargeInt const *exp)
 Exponentiate an element of Fq12 by a large integer. More...
 
void Fq12MultiExp (Fq12Elem *result, Fq12Elem const *base0, VeryLargeInt const *exp0, Fq12Elem const *base1, VeryLargeInt const *exp1, Fq12Elem const *base2, VeryLargeInt const *exp2, Fq12Elem const *base3, VeryLargeInt const *exp3)
 Multiply of exponentiation of elements of Fq12 by a large integers. More...
 
int Fq12Eq (Fq12Elem const *left, Fq12Elem const *right)
 Test if two elements in Fq12 are equal. More...
 
void Fq12Conj (Fq12Elem *result, Fq12Elem const *in)
 Calculate the conjugate of an element of Fq2. More...
 
void Fq12ExpCyc (Fq12Elem *result, Fq12Elem const *in, VeryLargeInt const *t)
 Calculate the cyclotomic exponentiation of an element of Fq12 by another element of Fq12. More...
 
void Fq12SqCyc (Fq12Elem *result, Fq12Elem const *in)
 Calculate the cyclotomic square of an element of fq12. More...
 
void Fq12MulSpecial (Fq12Elem *result, Fq12Elem const *left, Fq12Elem const *right)
 Multiply two elements of Fq12. More...
 
void Fq12Cp (Fq12Elem *result, Fq12Elem const *in)
 Copy an element's value. More...
 
void Fq12Clear (Fq12Elem *result)
 Clear an element's value. More...
 

Detailed Description

Definition of Fq12 math.

Function Documentation

◆ Fq12Add()

void Fq12Add ( Fq12Elem result,
Fq12Elem const *  left,
Fq12Elem const *  right 
)

Add two elements of Fq12.

Parameters
[out]resultof adding left and right.
[in]leftThe first operand to be added.
[in]rightThe second operand to be added.

◆ Fq12Clear()

void Fq12Clear ( Fq12Elem result)

Clear an element's value.

Parameters
[out]resultelement to clear.

◆ Fq12Conj()

void Fq12Conj ( Fq12Elem result,
Fq12Elem const *  in 
)

Calculate the conjugate of an element of Fq2.

Parameters
[out]resultthe conjugate of the element.
[in]inthe element.

◆ Fq12Cp()

void Fq12Cp ( Fq12Elem result,
Fq12Elem const *  in 
)

Copy an element's value.

Parameters
[out]resultcopy target.
[in]incopy source.

◆ Fq12Eq()

int Fq12Eq ( Fq12Elem const *  left,
Fq12Elem const *  right 
)

Test if two elements in Fq12 are equal.

Parameters
[in]leftThe first operand to be tested.
[in]rightThe second operand to be tested.
Returns
A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise.

◆ Fq12Exp()

void Fq12Exp ( Fq12Elem result,
Fq12Elem const *  base,
VeryLargeInt const *  exp 
)

Exponentiate an element of Fq12 by a large integer.

Parameters
[out]resulttarget.
[in]basethe base.
[in]expthe exponent.

◆ Fq12ExpCyc()

void Fq12ExpCyc ( Fq12Elem result,
Fq12Elem const *  in,
VeryLargeInt const *  t 
)

Calculate the cyclotomic exponentiation of an element of Fq12 by another element of Fq12.

Parameters
[in,out]resultthe base of the exponentiation. This will receive the result.
[in]inthe exponent.
[in]tpairing parameter t

◆ Fq12Inv()

void Fq12Inv ( Fq12Elem result,
Fq12Elem const *  in 
)

Invert an element of Fq12.

Parameters
[out]resultthe inverse of the element.
[in]inthe element to invert.

◆ Fq12Mul()

void Fq12Mul ( Fq12Elem result,
Fq12Elem const *  left,
Fq12Elem const *  right 
)

Multiply two elements of Fq12.

Parameters
[out]resultof multiplying left and right.
[in]leftThe first operand to be multiplied.
[in]rightThe second operand to be multiplied.

◆ Fq12MulSpecial()

void Fq12MulSpecial ( Fq12Elem result,
Fq12Elem const *  left,
Fq12Elem const *  right 
)

Multiply two elements of Fq12.

Requires that b[2] = b[4] = b[5] = 0. where right = ((b[0], b[2], b[4]), (b[1], b[3], b[5]))

Parameters
[out]resultof multiplying left and right.
[in]leftThe first operand to be multiplied.
[in]rightThe second operand to be multiplied.

◆ Fq12MultiExp()

void Fq12MultiExp ( Fq12Elem result,
Fq12Elem const *  base0,
VeryLargeInt const *  exp0,
Fq12Elem const *  base1,
VeryLargeInt const *  exp1,
Fq12Elem const *  base2,
VeryLargeInt const *  exp2,
Fq12Elem const *  base3,
VeryLargeInt const *  exp3 
)

Multiply of exponentiation of elements of Fq12 by a large integers.

Parameters
[out]resulttarget.
[in]base0the base.
[in]exp0the exponent.
[in]base1the base.
[in]exp1the exponent.
[in]base2the base.
[in]exp2the exponent.
[in]base3the base.
[in]exp3the exponent.

◆ Fq12Neg()

void Fq12Neg ( Fq12Elem result,
Fq12Elem const *  in 
)

Negate an element of Fq12.

Parameters
[out]resultthe negative of the element.
[in]inthe element to negate.

◆ Fq12Set()

void Fq12Set ( Fq12Elem result,
uint32_t  val 
)

Set an element's value.

Parameters
[out]resulttarget.
[in]valvalue to set.

◆ Fq12SqCyc()

void Fq12SqCyc ( Fq12Elem result,
Fq12Elem const *  in 
)

Calculate the cyclotomic square of an element of fq12.

Parameters
[in,out]resultresult of the cyclotomic square.
[in]inthe base.

◆ Fq12Square()

void Fq12Square ( Fq12Elem result,
Fq12Elem const *  in 
)

Square an element of Fq12.

Parameters
[out]resultthe square of the element.
[in]inthe element to square.

◆ Fq12Sub()

void Fq12Sub ( Fq12Elem result,
Fq12Elem const *  left,
Fq12Elem const *  right 
)

Subtract two elements of Fq12.

Parameters
[out]resultof subtracting left from right.
[in]leftThe operand to be subtracted from.
[in]rightThe operand to subtract.