public class GF2nPolynomialField extends GF2nField
GF2nField
,
GF2nPolynomialElement
fieldPolynomial, fields, matrices, mDegree
Constructor and Description |
---|
GF2nPolynomialField(int deg)
constructs an instance of the finite field with 2deg
elements and characteristic 2.
|
GF2nPolynomialField(int deg,
boolean file)
constructs an instance of the finite field with 2deg
elements and characteristic 2.
|
GF2nPolynomialField(int deg,
GF2Polynomial polynomial)
Creates a new GF2nField of degree i and uses the given
polynomial as field polynomial.
|
Modifier and Type | Method and Description |
---|---|
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.
|
convert, equals, getDegree, getFieldPolynomial, hashCode, invertMatrix
public GF2nPolynomialField(int deg)
deg
- the extention degree of this fieldpublic GF2nPolynomialField(int deg, boolean file)
deg
- the degree of this fieldfile
- 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, GF2Polynomial polynomial) throws RuntimeException
deg
- degree of the GF2nFieldpolynomial
- the field polynomial to usePolynomialIsNotIrreducibleException
- if the given polynomial is not irreducible in GF(2^i)RuntimeException
public boolean isTrinomial()
public boolean isPentanomial()
public int getTc() throws RuntimeException
GFException
- if the field polynomial is not a trinomialRuntimeException
public int[] getPc() throws RuntimeException
GFException
- if the field polynomial is not a pentanomialRuntimeException
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()
Copyright © 2016 BouncyCastle.org. All rights reserved.