tate_bilinear_pairing.f3m
index
/home/ds/workspace/tate_bilinear_pairing/tate_bilinear_pairing/f3m.py

This module provides operations over the Galois Field $GF(3^m)$, where $m$ is a user-specified parameter.
$GF(3^m)$ is an extension field of $GF(3)$, and the degree of the extension is $m$.
In this module, an element of $GF(3^m)$ is a list of length $m$, where each element is in $GF(3)$.

 
Modules
       
random
tate_bilinear_pairing.it

 
Functions
       
add(a, b, c)
doing addition
The function sets the value of $c$ as $a+b$, and returns nothing.
$ln$ equals the number of native integers of $a$.
cubic(a)
computing the cubic of an element $a$ in GF(3^m), and returning $a^3$
inverse(a)
computing the inversion of an element $a$ in GF(3^m).
The algorithm is by Tim Kerins, Emanuel Popovici and William Marnane
in the paper of "Algorithms and Architectures for use in FPGA",
Lecture Notes in Computer Science, 2004, Volume 3203/2004, 74-83.
Note that $U$ must have an extra bit, i.e, (_m + _W - 1) // _W == (_m + _W) // _W
mult(a, b)
doing multiplication in GF(3^m)
The function returns $a*b \in GF(3^m)$
neg(a, c)
doing negation
The functions sets the value of $c$ as $-a$ and returns nothing.
one()
returning the element with value of one in $GF(3^m)$, which is $[1]+[0]*(m-1)$
random()
returning a random element in $GF(3^m)$
reduct(ln, a)
doing reduction
The function returns the value of $a$ modulo $the irreducible trinomial$.
$ln$ equals the degree of $a$.
set_degree(m)
choose another irreducible polynomial whose degree is $m$
sub(a, b, c)
doing subtraction
note that $add$, $neg$, $sub$ are performed element-wisely.
The function sets the value of $c$ as $a-b$, and returns nothing.
$ln$ equals the number of native integers of $a$.
two()
returning the element with value of two in $GF(3^m)$, which is $[2]+[0]*(m-1)$
zero()
returning the zero element in $GF(3^m)$, which is $[0]*m$