|
Bouncy Castle Cryptography Library 1.79 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nField | +--org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nPolynomialField
This class implements the abstract class GF2nField for polynomial representation. It computes the field polynomial and the squaring matrix. GF2nField is used by GF2nPolynomialElement which implements the elements of this field.
GF2nField
,
GF2nPolynomialElement
Fields inherited from class org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nField |
fieldPolynomial, fields, matrices, mDegree, random |
Constructor Summary | |
GF2nPolynomialField(int deg,
java.security.SecureRandom random)
constructs an instance of the finite field with 2 deg elements and characteristic 2. |
|
GF2nPolynomialField(int deg,
java.security.SecureRandom random,
boolean file)
constructs an instance of the finite field with 2 deg elements and characteristic 2. |
|
GF2nPolynomialField(int deg,
java.security.SecureRandom random,
GF2Polynomial polynomial)
Creates a new GF2nField of degree i and uses the given polynomial as field polynomial. |
Method Summary | |
protected void |
computeCOBMatrix(GF2nField B1)
Computes the change-of-basis matrix for basis conversion according to 1363. |
protected void |
computeFieldPolynomial()
Computes the field polynomial. |
protected void |
computeFieldPolynomial2()
Computes the field polynomial. |
int[] |
getPc()
Returns the degree of the middle coefficients of the used field pentanomial (x^n + x^(getPc()[2]) + x^(getPc()[1]) + x^(getPc()[0]) + 1). |
protected GF2nElement |
getRandomRoot(GF2Polynomial polynomial)
Compute a random root of the given GF2Polynomial. |
GF2Polynomial |
getSquaringVector(int i)
Return row vector i of the squaring matrix. |
int |
getTc()
Returns the degree of the middle coefficient of the used field trinomial (x^n + x^(getTc()) + 1). |
boolean |
isPentanomial()
Returns true if the field polynomial is a pentanomial. |
boolean |
isTrinomial()
Returns true if the field polynomial is a trinomial. |
Methods inherited from class org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nField |
convert, equals, getDegree, getFieldPolynomial, hashCode, invertMatrix |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GF2nPolynomialField(int deg, java.security.SecureRandom random)
deg
- the extention degree of this fieldrandom
- source of randomness for generating new polynomials.public GF2nPolynomialField(int deg, java.security.SecureRandom random, boolean file)
deg
- the degree of this fieldrandom
- source of randomness for generating new polynomials.file
- true if you want to read the field polynomial from the
file false if you want to use a random fielpolynomial
(this can take very long for huge degrees)public GF2nPolynomialField(int deg, java.security.SecureRandom random, GF2Polynomial polynomial) throws java.lang.RuntimeException
deg
- degree of the GF2nFieldrandom
- source of randomness for generating new polynomials.polynomial
- the field polynomial to useMethod Detail |
public boolean isTrinomial()
public boolean isPentanomial()
public int getTc() throws java.lang.RuntimeException
public int[] getPc() throws java.lang.RuntimeException
public GF2Polynomial getSquaringVector(int i)
i
- the index of the row vector to returnGF2nPolynomialElement.squareMatrix()
protected GF2nElement getRandomRoot(GF2Polynomial polynomial)
getRandomRoot
in class GF2nField
polynomial
- the polynomialprotected void computeCOBMatrix(GF2nField B1)
computeCOBMatrix
in class GF2nField
B1
- the GF2nField to convert toprotected void computeFieldPolynomial()
computeFieldPolynomial
in class GF2nField
protected void computeFieldPolynomial2()
|
Bouncy Castle Cryptography Library 1.79 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |