|
Bouncy Castle Cryptography 1.50 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bouncycastle.pqc.math.linearalgebra.GF2nElement
org.bouncycastle.pqc.math.linearalgebra.GF2nONBElement
public class GF2nONBElement
This class implements an element of the finite field GF(2n ). It is represented in an optimal normal basis representation and holds the pointer mField to its corresponding field.
GF2nField,
GF2nElement| Field Summary |
|---|
| Fields inherited from class org.bouncycastle.pqc.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.util.Random 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. Let z2 + z = this. |
GF2nElement |
square()
returns this element to the power of 2. |
GF2nElement |
squareRoot()
returns the root ofthis 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.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.util.Random rand)
gf2n - the fieldrand - the source of randomness
public GF2nONBElement(GF2nONBField gf2n,
byte[] e)
gf2n - the fielde - the encoded element
public GF2nONBElement(GF2nONBField gf2n,
java.math.BigInteger val)
gf2n - the fieldval - the value represented by a BigIntegerpublic GF2nONBElement(GF2nONBElement gf2n)
gf2n - the field| Method Detail |
|---|
public java.lang.Object clone()
clone in interface GFElementclone in class GF2nElementpublic static GF2nONBElement ZERO(GF2nONBField gf2n)
gf2n - the finite field
public static GF2nONBElement ONE(GF2nONBField gf2n)
gf2n - the finite field
public boolean isZero()
public boolean isOne()
public boolean equals(java.lang.Object other)
equals in interface GFElementequals in class java.lang.Objectother - the other object
public int hashCode()
hashCode in interface GFElementhashCode in class java.lang.Objectpublic boolean testRightmostBit()
testRightmostBit in class GF2nElement
public GFElement add(GFElement addend)
throws java.lang.RuntimeException
addend - the addend
DifferentFieldsException - if the elements are of different fields.
java.lang.RuntimeException
public void addToThis(GFElement addend)
throws java.lang.RuntimeException
addend - the addend
DifferentFieldsException - if the elements are of different fields.
java.lang.RuntimeExceptionpublic GF2nElement increase()
increase in class GF2nElementpublic void increaseThis()
increaseThis in class GF2nElement
public GFElement multiply(GFElement factor)
throws java.lang.RuntimeException
factor - the factor
DifferentFieldsException - if the elements are of different fields.
java.lang.RuntimeException
public void multiplyThisBy(GFElement factor)
throws java.lang.RuntimeException
factor - the factor
DifferentFieldsException - if the elements are of different fields.
java.lang.RuntimeExceptionpublic GF2nElement square()
square in class GF2nElementpublic 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 GF2nElementpublic void squareRootThis()
squareRootThis in class GF2nElementpublic int trace()
trace in class GF2nElement
public GF2nElement solveQuadraticEquation()
throws java.lang.RuntimeException
solveQuadraticEquation in class GF2nElementNoSolutionException - if z2 + z = this does not have a
solution
java.lang.RuntimeExceptionpublic java.lang.String toString()
toString in interface GFElementtoString in class java.lang.Objectpublic java.lang.String toString(int radix)
radix - specifies the radix of the String representation
public java.math.BigInteger toFlexiBigInt()
public byte[] toByteArray()
|
Bouncy Castle Cryptography 1.50 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||