Top Description Fields Constructors Methods
org.bouncycastle.pqc.legacy.math.linearalgebra

public Class PolynomialRingGF2m

extends Object
Class Inheritance

This class represents polynomial rings GF(2^m)[X]/p(X) for m<32. If p(X) is irreducible, the polynomial ring is in fact an extension field of GF(2^m).

Field Summary

Modifier and TypeField and Description
private GF2mField
field

the finite field this polynomial ring is defined over

private PolynomialGF2mSmallM
p

the reduction polynomial

protected PolynomialGF2mSmallM[]
sqMatrix

the squaring matrix for this polynomial ring (given as the array of its row vectors)

protected PolynomialGF2mSmallM[]
sqRootMatrix

the matrix for computing square roots in this polynomial ring (given as the array of its row vectors).

Constructor Summary

AccessConstructor and Description
public
PolynomialRingGF2m(GF2mField
the finite field
field
,
PolynomialGF2mSmallM
the reduction polynomial
p
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private void
computeSquareRootMatrix()

Compute the matrix for computing square roots in this polynomial ring by inverting the squaring matrix.

private void
computeSquaringMatrix()

Compute the squaring matrix for this polynomial ring, using the base field and the reduction polynomial.

public PolynomialGF2mSmallM[]

Returns:

the matrix for computing square roots for this polynomial ring
getSquareRootMatrix
()

public PolynomialGF2mSmallM[]

Returns:

the squaring matrix for this polynomial ring
getSquaringMatrix
()

private static void
swapColumns(PolynomialGF2mSmallM[] matrix, int first, int second)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fieldback to summary
private GF2mField field

the finite field this polynomial ring is defined over

pback to summary
private PolynomialGF2mSmallM p

the reduction polynomial

sqMatrixback to summary
protected PolynomialGF2mSmallM[] sqMatrix

the squaring matrix for this polynomial ring (given as the array of its row vectors)

sqRootMatrixback to summary
protected PolynomialGF2mSmallM[] sqRootMatrix

the matrix for computing square roots in this polynomial ring (given as the array of its row vectors). This matrix is computed as the inverse of the squaring matrix.

Constructor Detail

PolynomialRingGF2mback to summary
public PolynomialRingGF2m(GF2mField field, PolynomialGF2mSmallM p)

Constructor.

Parameters
field:GF2mField

the finite field

p:PolynomialGF2mSmallM

the reduction polynomial

Method Detail

computeSquareRootMatrixback to summary
private void computeSquareRootMatrix()

Compute the matrix for computing square roots in this polynomial ring by inverting the squaring matrix.

computeSquaringMatrixback to summary
private void computeSquaringMatrix()

Compute the squaring matrix for this polynomial ring, using the base field and the reduction polynomial.

getSquareRootMatrixback to summary
public PolynomialGF2mSmallM[] getSquareRootMatrix()
Returns:PolynomialGF2mSmallM[]

the matrix for computing square roots for this polynomial ring

getSquaringMatrixback to summary
public PolynomialGF2mSmallM[] getSquaringMatrix()
Returns:PolynomialGF2mSmallM[]

the squaring matrix for this polynomial ring

swapColumnsback to summary
private static void swapColumns(PolynomialGF2mSmallM[] matrix, int first, int second)