public abstract class GF2nField
extends java.lang.Object
GF2nONBField
,
GF2nPolynomialField
Modifier and Type | Field and Description |
---|---|
protected GF2Polynomial |
fieldPolynomial
the irreducible fieldPolynomial stored in normal order (also for ONB)
|
protected java.util.Vector |
fields
holds a list of GF2nFields to which elements have been converted and thus
a COB-Matrix exists
|
protected java.util.Vector |
matrices
the COB matrices
|
protected int |
mDegree
the degree of this field
|
protected java.security.SecureRandom |
random |
Modifier | Constructor and Description |
---|---|
protected |
GF2nField(java.security.SecureRandom random) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
computeCOBMatrix(GF2nField B1)
Computes the change-of-basis matrix for basis conversion according to
1363.
|
protected abstract void |
computeFieldPolynomial()
Computes the fieldpolynomial.
|
GF2nElement |
convert(GF2nElement elem,
GF2nField basis)
Converts the given element in representation according to this field to a
new element in representation according to B1 using the change-of-basis
matrix calculated by computeCOBMatrix.
|
boolean |
equals(java.lang.Object other)
Decides whether the given object other is the same as this
field.
|
int |
getDegree()
Returns the degree n of this field.
|
GF2Polynomial |
getFieldPolynomial()
Returns the fieldpolynomial as a new Bitstring.
|
protected abstract GF2nElement |
getRandomRoot(GF2Polynomial B0FieldPolynomial)
Computes a random root from the given irreducible fieldpolynomial
according to IEEE 1363 algorithm A.5.6.
|
int |
hashCode() |
protected GF2Polynomial[] |
invertMatrix(GF2Polynomial[] matrix)
Inverts the given matrix represented as bitstrings.
|
protected final java.security.SecureRandom random
protected int mDegree
protected GF2Polynomial fieldPolynomial
protected java.util.Vector fields
protected java.util.Vector matrices
public final int getDegree()
public final GF2Polynomial getFieldPolynomial()
public final boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- another objectpublic int hashCode()
hashCode
in class java.lang.Object
protected abstract GF2nElement getRandomRoot(GF2Polynomial B0FieldPolynomial)
B0FieldPolynomial
- the fieldpolynomial if the other basis as a Bitstringprotected abstract void computeCOBMatrix(GF2nField B1)
B1
- the GF2nField to convert toprotected abstract void computeFieldPolynomial()
protected final GF2Polynomial[] invertMatrix(GF2Polynomial[] matrix)
matrix
- the matrix to invert as a Bitstring[]public final GF2nElement convert(GF2nElement elem, GF2nField basis) throws java.lang.RuntimeException
elem
- the GF2nElement to convertbasis
- the basis to convert elem tojava.lang.RuntimeException
computeCOBMatrix(org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nField)
,
getRandomRoot(org.bouncycastle.pqc.legacy.math.linearalgebra.GF2Polynomial)
,
GF2nPolynomial
,
"P1363 A.7 p109ff"