public class GF2Field
extends java.lang.Object
The operations are implemented using the irreducible polynomial 1+x^2+x^3+x^6+x^8 ( 1 0100 1101 = 0x14d )
This class makes use of lookup tables(exps and logs) for implementing the operations in order to increase the efficiency of Rainbow.
| Modifier and Type | Field and Description |
|---|---|
static int |
MASK |
| Constructor and Description |
|---|
GF2Field() |
| Modifier and Type | Method and Description |
|---|---|
static short |
addElem(short x,
short y)
This function calculates the sum of two elements as an operation in GF2^8
|
static short |
getExp(short x)
This function returns the values of exps-lookup table which correspond to
the input
|
static short |
getLog(short x)
This function returns the values of logs-lookup table which correspond to
the input
|
static short |
invElem(short x)
This function computes the multiplicative inverse of a given element in
GF2^8 The 0 has no multiplicative inverse and in this case 0 is returned.
|
static short |
multElem(short x,
short y)
This function multiplies two elements in GF2^8.
|
public static final int MASK
public static short addElem(short x,
short y)
x - the first element that is to be addedy - the second element that should be addpublic static short invElem(short x)
x - the element which multiplicative inverse is to be computedpublic static short multElem(short x,
short y)
x - the first element to be multiplied.y - the second element to be multiplied.public static short getExp(short x)
x - the index in the lookup table expspublic static short getLog(short x)
x - the index in the lookup table logs