|
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.GF2nElement | +--org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nONBElement
This class implements an element of the finite field GF(2 n ). It is represented in an optimal normal basis representation and holds the pointer mField to its corresponding field.
GF2nField
,
GF2nElement
Fields inherited from class org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement |
mDegree, mField |
Constructor Summary | |
GF2nONBElement(GF2nONBElement gf2n)
Copy constructor. |
|
GF2nONBElement(GF2nONBField gf2n,
java.math.BigInteger val)
Construct the element of the field gf2n with the specified value val. |
|
GF2nONBElement(GF2nONBField gf2n,
byte[] e)
Construct a new GF2nONBElement from its encoding. |
|
GF2nONBElement(GF2nONBField gf2n,
java.security.SecureRandom rand)
Construct a random element over the field gf2n, using the specified source of randomness. |
Method Summary | |
GFElement |
add(GFElement addend)
Compute the sum of this element and addend. |
void |
addToThis(GFElement addend)
Compute this + addend (overwrite this). |
java.lang.Object |
clone()
Create a new GF2nONBElement by cloning this GF2nPolynomialElement. |
boolean |
equals(java.lang.Object other)
Compare this element with another object. |
int |
hashCode()
|
GF2nElement |
increase()
returns this element + 1. |
void |
increaseThis()
increases this element. |
GFElement |
invert()
Compute the multiplicative inverse of this element. |
void |
invertThis()
Multiplicatively invert of this element (overwrite this). |
boolean |
isOne()
Checks whether this element is one. |
boolean |
isZero()
Checks whether this element is zero. |
GFElement |
multiply(GFElement factor)
Compute the product of this element and factor. |
void |
multiplyThisBy(GFElement factor)
Compute this * factor (overwrite this). |
static GF2nONBElement |
ONE(GF2nONBField gf2n)
Create the one element. |
GF2nElement |
solveQuadraticEquation()
Solves a quadratic equation. |
GF2nElement |
square()
returns this element to the power of 2. |
GF2nElement |
squareRoot()
returns the root of this element. |
void |
squareRootThis()
square roots this element. |
void |
squareThis()
squares this element. |
boolean |
testRightmostBit()
Returns whether the highest bit of the bit representation is set |
byte[] |
toByteArray()
Returns this element as byte array. |
java.math.BigInteger |
toFlexiBigInt()
Returns this element as FlexiBigInt. |
java.lang.String |
toString()
Returns a String representation of this element. |
java.lang.String |
toString(int radix)
Returns a String representation of this element. |
int |
trace()
Returns the trace of this element. |
static GF2nONBElement |
ZERO(GF2nONBField gf2n)
Create the zero element. |
Methods inherited from class org.bouncycastle.pqc.legacy.math.linearalgebra.GF2nElement |
convert, getField, subtract, subtractFromThis |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GF2nONBElement(GF2nONBField gf2n, java.security.SecureRandom rand)
gf2n
- the fieldrand
- the source of randomnesspublic GF2nONBElement(GF2nONBField gf2n, byte[] e)
gf2n
- the fielde
- the encoded elementpublic GF2nONBElement(GF2nONBField gf2n, java.math.BigInteger val)
gf2n
- the fieldval
- the value represented by a BigIntegerpublic GF2nONBElement(GF2nONBElement gf2n)
gf2n
- the fieldMethod Detail |
public java.lang.Object clone()
clone
in class GF2nElement
public static GF2nONBElement ZERO(GF2nONBField gf2n)
gf2n
- the finite fieldpublic static GF2nONBElement ONE(GF2nONBField gf2n)
gf2n
- the finite fieldpublic boolean isZero()
public boolean isOne()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other objectpublic int hashCode()
hashCode
in class java.lang.Object
public boolean testRightmostBit()
testRightmostBit
in class GF2nElement
public GFElement add(GFElement addend) throws java.lang.RuntimeException
addend
- the addendpublic void addToThis(GFElement addend) throws java.lang.RuntimeException
addend
- the addendpublic GF2nElement increase()
increase
in class GF2nElement
public void increaseThis()
increaseThis
in class GF2nElement
public GFElement multiply(GFElement factor) throws java.lang.RuntimeException
factor
- the factorpublic void multiplyThisBy(GFElement factor) throws java.lang.RuntimeException
factor
- the factorpublic GF2nElement square()
square
in class GF2nElement
public void squareThis()
squareThis
in class GF2nElement
public GFElement invert() throws java.lang.ArithmeticException
java.lang.ArithmeticException
- if this is the zero element.public void invertThis() throws java.lang.ArithmeticException
java.lang.ArithmeticException
- if this is the zero element.public GF2nElement squareRoot()
squareRoot
in class GF2nElement
public void squareRootThis()
squareRootThis
in class GF2nElement
public int trace()
trace
in class GF2nElement
public GF2nElement solveQuadraticEquation() throws java.lang.RuntimeException
solveQuadraticEquation
in class GF2nElement
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int radix)
radix
- specifies the radix of the String representationpublic java.math.BigInteger toFlexiBigInt()
public byte[] toByteArray()
|
Bouncy Castle Cryptography Library 1.79 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |