| |
- 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$
|