|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--de.flexiprovider.common.math.finitefields.GF2nElement
|
+--de.flexiprovider.common.math.finitefields.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| Fields inherited from class de.flexiprovider.common.math.finitefields.GF2nElement |
mDegree, mField |
| Constructor Summary | |
GF2nONBElement(GF2nONBElement gf2n)
Copy constructor. |
|
GF2nONBElement(GF2nONBField gf2n,
byte[] e)
Construct a new GF2nONBElement from its encoding. |
|
GF2nONBElement(GF2nONBField gf2n,
FlexiBigInt val)
Construct the element of the field gf2n with the specified value val. |
|
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). |
(package private) void |
assignOne()
assigns to this element the one element |
(package private) void |
assignZero()
assigns to this element the zero element |
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. |
(package private) void |
reverseOrder()
Reverses the bit-order in this element(according to 1363). |
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. |
(package private) boolean |
testBit(int index)
Checks whether the indexed bit of the bit representation is set. |
boolean |
testRightmostBit()
Returns whether the highest bit of the bit representation is set |
byte[] |
toByteArray()
Returns this element as byte array. |
FlexiBigInt |
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 de.flexiprovider.common.math.finitefields.GF2nElement |
convert, getField, subtract, subtractFromThis |
| Methods inherited from class java.lang.Object |
|
| 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,
FlexiBigInt val)
gf2n - the fieldval - the value represented by a FlexiBigIntpublic GF2nONBElement(GF2nONBElement gf2n)
gf2n - the field| Method Detail |
public java.lang.Object clone()
clone in class GF2nElementpublic static GF2nONBElement ZERO(GF2nONBField gf2n)
gf2n - the finite fieldpublic static GF2nONBElement ONE(GF2nONBField gf2n)
gf2n - the finite fieldvoid assignZero()
assignZero in class GF2nElementvoid assignOne()
assignOne in class GF2nElementpublic boolean isZero()
public boolean isOne()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - the other objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean testRightmostBit()
testRightmostBit in class GF2nElementboolean testBit(int index)
testBit in class GF2nElementindex - the index of the bit to testvoid reverseOrder()
public GFElement add(GFElement addend)
throws DifferentFieldsException
addend - the addendDifferentFieldsException - if the elements are of different fields.
public void addToThis(GFElement addend)
throws DifferentFieldsException
addend - the addendDifferentFieldsException - if the elements are of different fields.public GF2nElement increase()
increase in class GF2nElementpublic void increaseThis()
increaseThis in class GF2nElement
public GFElement multiply(GFElement factor)
throws DifferentFieldsException
factor - the factorDifferentFieldsException - if the elements are of different fields.
public void multiplyThisBy(GFElement factor)
throws DifferentFieldsException
factor - the factorDifferentFieldsException - if the elements are of different fields.public 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 NoSolutionException
solveQuadraticEquation in class GF2nElementNoSolutionException - if z2 + z = this does not have a
solutionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(int radix)
radix - specifies the radix of the String representationpublic FlexiBigInt toFlexiBigInt()
public byte[] toByteArray()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||