public final class GF256 extends Object
This class contains utility methods for performing mathematical operations over the Galois Field GF(256). Operations use a given primitive polynomial in calculations.
Throughout this package, elements of GF(256) are represented as an int
for convenience and speed (but at the cost of memory).
Only the bottom 8 bits are really used.
Modifier and Type | Field and Description |
---|---|
static GF256 |
DATA_MATRIX_FIELD |
private int[] |
expTable |
private int[] |
logTable |
private GF256Poly |
one |
static GF256 |
QR_CODE_FIELD |
private GF256Poly |
zero |
Modifier | Constructor and Description |
---|---|
private |
GF256(int primitive)
Create a representation of GF(256) using the given primitive polynomial.
|
Modifier and Type | Method and Description |
---|---|
(package private) static int |
addOrSubtract(int a,
int b)
Implements both addition and subtraction -- they are the same in GF(256).
|
(package private) GF256Poly |
buildMonomial(int degree,
int coefficient) |
(package private) int |
exp(int a) |
(package private) GF256Poly |
getOne() |
(package private) GF256Poly |
getZero() |
(package private) int |
inverse(int a) |
(package private) int |
log(int a) |
(package private) int |
multiply(int a,
int b) |
public static final GF256 QR_CODE_FIELD
public static final GF256 DATA_MATRIX_FIELD
private final int[] expTable
private final int[] logTable
private GF256(int primitive)
primitive
- irreducible polynomial whose coefficients are represented by
the bits of an int, where the least-significant bit represents the constant
coefficientGF256Poly buildMonomial(int degree, int coefficient)
static int addOrSubtract(int a, int b)
int exp(int a)
int log(int a)
int inverse(int a)
int multiply(int a, int b)
a
- b
- WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses