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

public Class GF2nPolynomialElement

extends GF2nElement
Class Inheritance
Imports
java.math.BigInteger, java.util.Random

This class implements elements of finite binary fields GF(2n) using polynomial representation. For more information on the arithmetic see for example IEEE Standard 1363 or Certicom online-tutorial.
See Also
GF2nField, GF2nPolynomialField, GF2nONBElement, GF2Polynomial

Field Summary

Modifier and TypeField and Description
private static final int[]
private GF2Polynomial
Inherited from org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement:
mDegreemField

Constructor Summary

AccessConstructor and Description
public
GF2nPolynomialElement(GF2nPolynomialField
the GF2nField to use
f
,
Random
the source of randomness
rand
)

Create a new random GF2nPolynomialElement using the given field and source of randomness.

public
GF2nPolynomialElement(GF2nPolynomialField
the GF2nPolynomialField to use
f
,
GF2Polynomial
the desired value as Bitstring
bs
)

Creates a new GF2nPolynomialElement using the given field and Bitstring.

public
GF2nPolynomialElement(GF2nPolynomialField
the GF2nField to use
f
,
byte[]
the octet string to assign to this GF2nPolynomialElement
os
)

Creates a new GF2nPolynomialElement using the given field f and byte[] os as value.

public
GF2nPolynomialElement(GF2nPolynomialField
the GF2nField to use
f
,
int[]
the integer string to assign to this GF2nPolynomialElement
is
)

Creates a new GF2nPolynomialElement using the given field f and int[] is as value.

public
GF2nPolynomialElement(GF2nPolynomialElement
the GF2nPolynomialElement to clone
other
)

Creates a new GF2nPolynomialElement by cloning the given GF2nPolynomialElement b.

Method Summary

Modifier and TypeMethod and Description
public GFElement

Returns:

this + other (newly created)
add
(GFElement
the addend
addend
)

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.add.

Compute the sum of this element and addend.
public void
addToThis(GFElement
the addend
addend
)

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.addToThis.

Compute this + addend (overwrite this).
pack-priv void
assignOne()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.assignOne.

Assigns the value 'one' to this Polynomial.
pack-priv void
assignZero()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.assignZero.

Assigns the value 'zero' to this Polynomial.
public Object

Returns:

a copy of this element
clone
()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.clone.

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.clone.

Creates a new GF2nPolynomialElement by cloning this GF2nPolynomialElement.
public boolean

Returns:

true if the two objects are equal, false otherwise
equals
(Object
the other object
other
)

Overrides java.lang.Object.equals.

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.equals.

Compare this element with another object.
private GF2Polynomial

Returns:

the value of this GF2nPolynomialElement in a new Bitstring
getGF2Polynomial
()

Returns the value of this GF2nPolynomialElement in a new Bitstring.

private GF2nPolynomialElement

Returns:

a GF2nPolynomialElement representing the half-trace of this GF2nPolynomialElement.
halfTrace
()

Returns the half-trace of this GF2nPolynomialElement.

public int

Returns:

the hash code of this element
hashCode
()

Overrides java.lang.Object.hashCode.

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.hashCode.

Returns a hash code value for the object.
public GF2nElement

Returns:

this + 'one'
increase
()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.increase.

Returns this element + 'one".
public void
increaseThis()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.increaseThis.

Increases this element by 'one'.
public GFElement

Returns:

this-1 (newly created)
invert
()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.invert.

Compute the multiplicative inverse of this element.
public GF2nPolynomialElement

Returns:

this^(-1)
invertEEA
()

Calculates the multiplicative inverse of this and returns the result in a new GF2nPolynomialElement.

public GF2nPolynomialElement

Returns:

this^(-1)
invertMAIA
()

Calculates the multiplicative inverse of this using the modified almost inverse algorithm and returns the result in a new GF2nPolynomialElement.

public GF2nPolynomialElement

Returns:

this^(-1)
invertSquare
()

Calculates the multiplicative inverse of this and returns the result in a new GF2nPolynomialElement.

public boolean

Returns:

true if this equals one (this == 1)
isOne
()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.isOne.

Tests if the GF2nPolynomialElement has 'one' as value.
public boolean

Returns:

true if this is the zero element
isZero
()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.isZero.

Checks whether this element is zero.
public GFElement

Returns:

this * factor (newly created)
multiply
(GFElement
the factor
factor
)

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.multiply.

Compute the product of this element and factor.
public void
multiplyThisBy(GFElement
the factor
factor
)

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.multiplyThisBy.

Compute this * factor (overwrite this).
public static GF2nPolynomialElement

Returns:

the one element in the given finite field
ONE
(GF2nPolynomialField
the finite field
f
)

Create the one element.

public GF2nPolynomialElement

Returns:

this^k in a new GF2nPolynomialElement
power
(int
the power
k
)

Calculates this to the power of k and returns the result in a new GF2nPolynomialElement.

private void
randomize(Random
the source of randomness
rand
)

Assign a random value to this GF2nPolynomialElement using the specified source of randomness.

private void
reducePentanomialBitwise(int[] pc)

Reduce this GF2nPolynomialElement using the pentanomial x^n + x^pc[2] + x^pc[1] + x^pc[0] + 1 as fieldpolynomial.

private void
reduceThis()

Reduces this GF2nPolynomialElement modulo the field-polynomial.

private void
reduceTrinomialBitwise(int tc)

Reduce this GF2nPolynomialElement using the trinomial x^n + x^tc + 1 as fieldpolynomial.

public GF2nElement

Returns:

a GF2nPolynomialElement representing one z satisfying the equation z2 + z = this
solveQuadraticEquation
()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.solveQuadraticEquation.

Solves the quadratic equation z2 + z = this if such a solution exists.
public GF2nElement

Returns:

this2 (newly created)
square
()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.square.

This method is used internally to map the square()-calls within GF2nPolynomialElement to one of the possible squaring methods.
public GF2nPolynomialElement

Returns:

this2 (newly created)
squareBitwise
()

Squares this GF2nPolynomialElement by shifting left its Bitstring and reducing.

public GF2nPolynomialElement

Returns:

this2 (newly created)
squareMatrix
()

Squares this GF2nPolynomialElement using GF2nField's squaring matrix.

public GF2nPolynomialElement

Returns:

this2 (newly created)
squarePreCalc
()

Squares this GF2nPolynomialElement by using precalculated values and reducing.

public GF2nElement

Returns:

this1/2 (newly created)
squareRoot
()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.squareRoot.

Compute the square root of this element and return the result in a new GF2nPolynomialElement.
public void
squareRootThis()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.squareRootThis.

Compute the square root of this element.
public void
squareThis()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.squareThis.

This method is used internally to map the square()-calls within GF2nPolynomialElement to one of the possible squaring methods.
public void
squareThisBitwise()

Squares this GF2nPolynomialElement by shifting left its Bitstring and reducing.

public void
squareThisMatrix()

Squares this GF2nPolynomialElement using GF2nFields squaring matrix.

public void
squareThisPreCalc()

Squares this GF2nPolynomialElement by using precalculated values and reducing.

pack-priv boolean

Returns:

true if the indexed bit is set
testBit
(int
the index of the bit to test
index
)

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.testBit.

Checks whether the indexed bit of the bit representation is set.
public boolean

Returns:

true if the rightmost bit of this element is set
testRightmostBit
()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.testRightmostBit.

Returns whether the rightmost bit of the bit representation is set.
public byte[]

Returns:

a byte[] representing the value of this GF2nPolynomialElement
toByteArray
()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.toByteArray.

Converts this GF2nPolynomialElement to a byte[] according to 1363.
public BigInteger

Returns:

a BigInteger representing the value of this GF2nPolynomialElement
toFlexiBigInt
()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.toFlexiBigInt.

Converts this GF2nPolynomialElement to an integer according to 1363.
public String

Returns:

a String representing this Bitstrings value.
toString
()

Overrides java.lang.Object.toString.

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.toString.

Returns a string representing this Bitstrings value using hexadecimal radix in MSB-first order.
public String

Returns:

a String representing this Bitstrings value.
toString
(int
the radix to use (2 or 16, otherwise 2 is used)
radix
)

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.toString.

Returns a string representing this Bitstrings value using hexadecimal or binary radix in MSB-first order.
public int

Returns:

the trace of this GF2nPolynomialElement
trace
()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.trace.

Returns the trace of this GF2nPolynomialElement.
public static GF2nPolynomialElement

Returns:

the zero element in the given finite field
ZERO
(GF2nPolynomialField
the finite field
f
)

Create the zero element.

Inherited from org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement:
convertgetFieldsubtractsubtractFromThis

Field Detail

bitMaskback to summary
private static final int[] bitMask
polynomialback to summary
private GF2Polynomial polynomial

Constructor Detail

GF2nPolynomialElementback to summary
public GF2nPolynomialElement(GF2nPolynomialField f, Random rand)

Create a new random GF2nPolynomialElement using the given field and source of randomness.

Parameters
f:GF2nPolynomialField

the GF2nField to use

rand:Random

the source of randomness

GF2nPolynomialElementback to summary
public GF2nPolynomialElement(GF2nPolynomialField f, GF2Polynomial bs)

Creates a new GF2nPolynomialElement using the given field and Bitstring.

Parameters
f:GF2nPolynomialField

the GF2nPolynomialField to use

bs:GF2Polynomial

the desired value as Bitstring

GF2nPolynomialElementback to summary
public GF2nPolynomialElement(GF2nPolynomialField f, byte[] os)

Creates a new GF2nPolynomialElement using the given field f and byte[] os as value. The conversion is done according to 1363.

Parameters
f:GF2nPolynomialField

the GF2nField to use

os:byte[]

the octet string to assign to this GF2nPolynomialElement

See Also
P1363 5.5.5 p23, OS2FEP/OS2BSP
GF2nPolynomialElementback to summary
public GF2nPolynomialElement(GF2nPolynomialField f, int[] is)

Creates a new GF2nPolynomialElement using the given field f and int[] is as value.

Parameters
f:GF2nPolynomialField

the GF2nField to use

is:int[]

the integer string to assign to this GF2nPolynomialElement

GF2nPolynomialElementback to summary
public GF2nPolynomialElement(GF2nPolynomialElement other)

Creates a new GF2nPolynomialElement by cloning the given GF2nPolynomialElement b.

Parameters
other:GF2nPolynomialElement

the GF2nPolynomialElement to clone

Method Detail

addback to summary
public GFElement add(GFElement addend) throws RuntimeException

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.add.

Compute the sum of this element and addend.

Parameters
addend:GFElement

the addend

Returns:GFElement

this + other (newly created)

addToThisback to summary
public void addToThis(GFElement addend) throws RuntimeException

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.addToThis.

Compute this + addend (overwrite this).

Parameters
addend:GFElement

the addend

assignOneback to summary
pack-priv void assignOne()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.assignOne.

Assigns the value 'one' to this Polynomial.

assignZeroback to summary
pack-priv void assignZero()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.assignZero.

Assigns the value 'zero' to this Polynomial.

cloneback to summary
public Object clone()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.clone.

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.clone.

Creates a new GF2nPolynomialElement by cloning this GF2nPolynomialElement.

Returns:Object

a copy of this element

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.equals.

Compare this element with another object.

Parameters
other:Object

the other object

Returns:boolean

true if the two objects are equal, false otherwise

getGF2Polynomialback to summary
private GF2Polynomial getGF2Polynomial()

Returns the value of this GF2nPolynomialElement in a new Bitstring.

Returns:GF2Polynomial

the value of this GF2nPolynomialElement in a new Bitstring

halfTraceback to summary
private GF2nPolynomialElement halfTrace() throws RuntimeException

Returns the half-trace of this GF2nPolynomialElement.

Returns:GF2nPolynomialElement

a GF2nPolynomialElement representing the half-trace of this GF2nPolynomialElement.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

the hash code of this element

increaseback to summary
public GF2nElement increase()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.increase.

Returns this element + 'one".

Returns:GF2nElement

this + 'one'

increaseThisback to summary
public void increaseThis()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.increaseThis.

Increases this element by 'one'.

invertback to summary
public GFElement invert() throws ArithmeticException

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.invert.

Compute the multiplicative inverse of this element.

Returns:GFElement

this-1 (newly created)

Exceptions
ArithmeticException:
if this is the zero element.
See Also
GF2nPolynomialElement#invertMAIA, GF2nPolynomialElement#invertEEA, GF2nPolynomialElement#invertSquare
invertEEAback to summary
public GF2nPolynomialElement invertEEA() throws ArithmeticException

Calculates the multiplicative inverse of this and returns the result in a new GF2nPolynomialElement.

Returns:GF2nPolynomialElement

this^(-1)

Exceptions
ArithmeticException:
if this equals zero
invertMAIAback to summary
public GF2nPolynomialElement invertMAIA() throws ArithmeticException

Calculates the multiplicative inverse of this using the modified almost inverse algorithm and returns the result in a new GF2nPolynomialElement.

Returns:GF2nPolynomialElement

this^(-1)

Exceptions
ArithmeticException:
if this equals zero
invertSquareback to summary
public GF2nPolynomialElement invertSquare() throws ArithmeticException

Calculates the multiplicative inverse of this and returns the result in a new GF2nPolynomialElement.

Returns:GF2nPolynomialElement

this^(-1)

Exceptions
ArithmeticException:
if this equals zero
isOneback to summary
public boolean isOne()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.isOne.

Tests if the GF2nPolynomialElement has 'one' as value.

Returns:boolean

true if this equals one (this == 1)

isZeroback to summary
public boolean isZero()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.isZero.

Checks whether this element is zero.

Returns:boolean

true if this is the zero element

multiplyback to summary
public GFElement multiply(GFElement factor) throws RuntimeException

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.multiply.

Compute the product of this element and factor.

Parameters
factor:GFElement

the factor

Returns:GFElement

this * factor (newly created)

multiplyThisByback to summary
public void multiplyThisBy(GFElement factor) throws RuntimeException

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.multiplyThisBy.

Compute this * factor (overwrite this).

Parameters
factor:GFElement

the factor

ONEback to summary
public static GF2nPolynomialElement ONE(GF2nPolynomialField f)

Create the one element.

Parameters
f:GF2nPolynomialField

the finite field

Returns:GF2nPolynomialElement

the one element in the given finite field

powerback to summary
public GF2nPolynomialElement power(int k)

Calculates this to the power of k and returns the result in a new GF2nPolynomialElement.

Parameters
k:int

the power

Returns:GF2nPolynomialElement

this^k in a new GF2nPolynomialElement

randomizeback to summary
private void randomize(Random rand)

Assign a random value to this GF2nPolynomialElement using the specified source of randomness.

Parameters
rand:Random

the source of randomness

reducePentanomialBitwiseback to summary
private void reducePentanomialBitwise(int[] pc)

Reduce this GF2nPolynomialElement using the pentanomial x^n + x^pc[2] + x^pc[1] + x^pc[0] + 1 as fieldpolynomial. The coefficients are reduced bit by bit.

reduceThisback to summary
private void reduceThis()

Reduces this GF2nPolynomialElement modulo the field-polynomial.

See Also
GF2Polynomial#reduceTrinomial, GF2Polynomial#reducePentanomial
reduceTrinomialBitwiseback to summary
private void reduceTrinomialBitwise(int tc)

Reduce this GF2nPolynomialElement using the trinomial x^n + x^tc + 1 as fieldpolynomial. The coefficients are reduced bit by bit.

solveQuadraticEquationback to summary
public GF2nElement solveQuadraticEquation() throws RuntimeException

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.solveQuadraticEquation.

Solves the quadratic equation z2 + z = this if such a solution exists. This method returns one of the two possible solutions. The other solution is z + 1. Use z.increase() to compute this solution.

Returns:GF2nElement

a GF2nPolynomialElement representing one z satisfying the equation z2 + z = this

See Also
IEEE 1363, Annex A.4.7
squareback to summary
public GF2nElement square()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.square.

This method is used internally to map the square()-calls within GF2nPolynomialElement to one of the possible squaring methods.

Returns:GF2nElement

this2 (newly created)

See Also
GF2nPolynomialElement#squarePreCalc
squareBitwiseback to summary
public GF2nPolynomialElement squareBitwise()

Squares this GF2nPolynomialElement by shifting left its Bitstring and reducing. This is supposed to be the slowest method. Use squarePreCalc or squareMatrix instead.

Returns:GF2nPolynomialElement

this2 (newly created)

See Also
GF2nPolynomialElement#squareMatrix, GF2nPolynomialElement#squarePreCalc, GF2Polynomial#squareThisBitwise
squareMatrixback to summary
public GF2nPolynomialElement squareMatrix()

Squares this GF2nPolynomialElement using GF2nField's squaring matrix. This is supposed to be fast when using a polynomial (no tri- or pentanomial) as fieldpolynomial. Use squarePreCalc when using a tri- or pentanomial as fieldpolynomial instead.

Returns:GF2nPolynomialElement

this2 (newly created)

See Also
GF2Polynomial#vectorMult, GF2nPolynomialElement#squarePreCalc, GF2nPolynomialElement#squareBitwise
squarePreCalcback to summary
public GF2nPolynomialElement squarePreCalc()

Squares this GF2nPolynomialElement by using precalculated values and reducing. This is supposed to de fastest when using a trinomial or pentanomial as field polynomial. Use squareMatrix when using a ordinary polynomial as field polynomial.

Returns:GF2nPolynomialElement

this2 (newly created)

See Also
GF2nPolynomialElement#squareMatrix, GF2Polynomial#squareThisPreCalc
squareRootback to summary
public GF2nElement squareRoot()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.squareRoot.

Compute the square root of this element and return the result in a new GF2nPolynomialElement.

Returns:GF2nElement

this1/2 (newly created)

squareRootThisback to summary
public void squareRootThis()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.squareRootThis.

Compute the square root of this element.

squareThisback to summary
public void squareThis()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.squareThis.

This method is used internally to map the square()-calls within GF2nPolynomialElement to one of the possible squaring methods.

squareThisBitwiseback to summary
public void squareThisBitwise()

Squares this GF2nPolynomialElement by shifting left its Bitstring and reducing. This is supposed to be the slowest method. Use squarePreCalc or squareMatrix instead.

See Also
GF2nPolynomialElement#squareMatrix, GF2nPolynomialElement#squarePreCalc, GF2Polynomial#squareThisBitwise
squareThisMatrixback to summary
public void squareThisMatrix()

Squares this GF2nPolynomialElement using GF2nFields squaring matrix. This is supposed to be fast when using a polynomial (no tri- or pentanomial) as fieldpolynomial. Use squarePreCalc when using a tri- or pentanomial as fieldpolynomial instead.

See Also
GF2Polynomial#vectorMult, GF2nPolynomialElement#squarePreCalc, GF2nPolynomialElement#squareBitwise
squareThisPreCalcback to summary
public void squareThisPreCalc()

Squares this GF2nPolynomialElement by using precalculated values and reducing. This is supposed to de fastest when using a tri- or pentanomial as fieldpolynomial. Use squareMatrix when using a ordinary polynomial as fieldpolynomial.

See Also
GF2nPolynomialElement#squareMatrix, GF2Polynomial#squareThisPreCalc
testBitback to summary
pack-priv boolean testBit(int index)

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.testBit.

Checks whether the indexed bit of the bit representation is set.

Parameters
index:int

the index of the bit to test

Returns:boolean

true if the indexed bit is set

testRightmostBitback to summary
public boolean testRightmostBit()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.testRightmostBit.

Returns whether the rightmost bit of the bit representation is set. This is needed for data conversion according to 1363.

Returns:boolean

true if the rightmost bit of this element is set

toByteArrayback to summary
public byte[] toByteArray()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.toByteArray.

Converts this GF2nPolynomialElement to a byte[] according to 1363.

Returns:byte[]

a byte[] representing the value of this GF2nPolynomialElement

See Also
P1363 5.5.2 p22f BS2OSP, FE2OSP
toFlexiBigIntback to summary
public BigInteger toFlexiBigInt()

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.toFlexiBigInt.

Converts this GF2nPolynomialElement to an integer according to 1363.

Returns:BigInteger

a BigInteger representing the value of this GF2nPolynomialElement

See Also
P1363 5.5.1 p22 BS2IP
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.toString.

Returns a string representing this Bitstrings value using hexadecimal radix in MSB-first order.

Returns:String

a String representing this Bitstrings value.

toStringback to summary
public String toString(int radix)

Implements org.bouncycastle.pqc.legacy.math.linearalgebra.GFElement.toString.

Returns a string representing this Bitstrings value using hexadecimal or binary radix in MSB-first order.

Parameters
radix:int

the radix to use (2 or 16, otherwise 2 is used)

Returns:String

a String representing this Bitstrings value.

traceback to summary
public int trace()

Implements abstract org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement.trace.

Returns the trace of this GF2nPolynomialElement.

Returns:int

the trace of this GF2nPolynomialElement

ZEROback to summary
public static GF2nPolynomialElement ZERO(GF2nPolynomialField f)

Create the zero element.

Parameters
f:GF2nPolynomialField

the finite field

Returns:GF2nPolynomialElement

the zero element in the given finite field