|
|||||||||
| 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.GF2nPolynomialElement
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.
GF2nPolynomialField,
GF2nONBElement,
GF2Polynomial| Fields inherited from class de.flexiprovider.common.math.finitefields.GF2nElement |
mDegree, mField |
| Constructor Summary | |
GF2nPolynomialElement(GF2nPolynomialElement other)
Creates a new GF2nPolynomialElement by cloning the given GF2nPolynomialElement b. |
|
GF2nPolynomialElement(GF2nPolynomialField f,
byte[] os)
Creates a new GF2nPolynomialElement using the given field f and byte[] os as value. |
|
GF2nPolynomialElement(GF2nPolynomialField f,
GF2Polynomial bs)
Creates a new GF2nPolynomialElement using the given field and Bitstring. |
|
GF2nPolynomialElement(GF2nPolynomialField f,
int[] is)
Creates a new GF2nPolynomialElement using the given field f and int[] is as value. |
|
GF2nPolynomialElement(GF2nPolynomialField f,
java.util.Random rand)
Create a new random GF2nPolynomialElement using the given field and 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 the value 'one' to this Polynomial. |
(package private) void |
assignZero()
Assigns the value 'zero' to this Polynomial. |
java.lang.Object |
clone()
Creates a new GF2nPolynomialElement by cloning this GF2nPolynomialElement. |
boolean |
equals(java.lang.Object other)
Compare this element with another object. |
int |
hashCode()
|
GF2nElement |
increase()
Returns this element + 'one". |
void |
increaseThis()
Increases this element by 'one'. |
GFElement |
invert()
Compute the multiplicative inverse of this element. |
GF2nPolynomialElement |
invertEEA()
Calculates the multiplicative inverse of this and returns the result in a new GF2nPolynomialElement. |
GF2nPolynomialElement |
invertMAIA()
Calculates the multiplicative inverse of this using the modified almost inverse algorithm and returns the result in a new GF2nPolynomialElement. |
GF2nPolynomialElement |
invertSquare()
Calculates the multiplicative inverse of this and returns the result in a new GF2nPolynomialElement. |
boolean |
isOne()
Tests if the GF2nPolynomialElement has 'one' as value. |
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 GF2nPolynomialElement |
ONE(GF2nPolynomialField f)
Create the one element. |
GF2nPolynomialElement |
power(int k)
Calculates this to the power of k and returns the result in a new GF2nPolynomialElement. |
GF2nElement |
solveQuadraticEquation()
Solves the quadratic equation z2 + z = this if such a solution exists. |
GF2nElement |
square()
This method is used internally to map the square()-calls within GF2nPolynomialElement to one of the possible squaring methods. |
GF2nPolynomialElement |
squareBitwise()
Squares this GF2nPolynomialElement by shifting left its Bitstring and reducing. |
GF2nPolynomialElement |
squareMatrix()
Squares this GF2nPolynomialElement using GF2nField's squaring matrix. |
GF2nPolynomialElement |
squarePreCalc()
Squares this GF2nPolynomialElement by using precalculated values and reducing. |
GF2nElement |
squareRoot()
Compute the square root of this element and return the result in a new GF2nPolynomialElement. |
void |
squareRootThis()
Compute the square root of this element. |
void |
squareThis()
This method is used internally to map the square()-calls within GF2nPolynomialElement to one of the possible squaring methods. |
void |
squareThisBitwise()
Squares this GF2nPolynomialElement by shifting left its Bitstring and reducing. |
void |
squareThisMatrix()
Squares this GF2nPolynomialElement using GF2nFields squaring matrix. |
void |
squareThisPreCalc()
Squares this GF2nPolynomialElement by using precalculated values and reducing. |
(package private) boolean |
testBit(int index)
Checks whether the indexed bit of the bit representation is set. |
boolean |
testRightmostBit()
Returns whether the rightmost bit of the bit representation is set. |
byte[] |
toByteArray()
Converts this GF2nPolynomialElement to a byte[] according to 1363. |
FlexiBigInt |
toFlexiBigInt()
Converts this GF2nPolynomialElement to an integer according to 1363. |
java.lang.String |
toString()
Returns a string representing this Bitstrings value using hexadecimal radix in MSB-first order. |
java.lang.String |
toString(int radix)
Returns a string representing this Bitstrings value using hexadecimal or binary radix in MSB-first order. |
int |
trace()
Returns the trace of this GF2nPolynomialElement. |
static GF2nPolynomialElement |
ZERO(GF2nPolynomialField f)
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 GF2nPolynomialElement(GF2nPolynomialField f,
java.util.Random rand)
f - the GF2nField to userand - the source of randomness
public GF2nPolynomialElement(GF2nPolynomialField f,
GF2Polynomial bs)
f - the GF2nPolynomialField to usebs - the desired value as Bitstring
public GF2nPolynomialElement(GF2nPolynomialField f,
byte[] os)
f - the GF2nField to useos - the octet string to assign to this GF2nPolynomialElement
public GF2nPolynomialElement(GF2nPolynomialField f,
int[] is)
f - the GF2nField to useis - the integer string to assign to this GF2nPolynomialElementpublic GF2nPolynomialElement(GF2nPolynomialElement other)
other - the GF2nPolynomialElement to clone| Method Detail |
public java.lang.Object clone()
clone in class GF2nElementvoid assignZero()
assignZero in class GF2nElementpublic static GF2nPolynomialElement ZERO(GF2nPolynomialField f)
f - the finite fieldpublic static GF2nPolynomialElement ONE(GF2nPolynomialField f)
f - the finite fieldvoid 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.Objectboolean testBit(int index)
testBit in class GF2nElementindex - the index of the bit to testpublic boolean testRightmostBit()
testRightmostBit in class GF2nElement
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 GFElement invert()
throws java.lang.ArithmeticException
java.lang.ArithmeticException - if this is the zero element.invertMAIA(),
invertEEA(),
invertSquare()
public GF2nPolynomialElement invertEEA()
throws java.lang.ArithmeticException
java.lang.ArithmeticException - if this equals zero
public GF2nPolynomialElement invertSquare()
throws java.lang.ArithmeticException
java.lang.ArithmeticException - if this equals zero
public GF2nPolynomialElement invertMAIA()
throws java.lang.ArithmeticException
java.lang.ArithmeticException - if this equals zeropublic GF2nElement square()
square in class GF2nElementsquarePreCalc()public void squareThis()
squareThis in class GF2nElementpublic GF2nPolynomialElement squareMatrix()
GF2Polynomial.vectorMult(de.flexiprovider.common.math.finitefields.GF2Polynomial),
squarePreCalc(),
squareBitwise()public void squareThisMatrix()
GF2Polynomial.vectorMult(de.flexiprovider.common.math.finitefields.GF2Polynomial),
squarePreCalc(),
squareBitwise()public GF2nPolynomialElement squareBitwise()
squareMatrix(),
squarePreCalc(),
GF2Polynomial.squareThisBitwise()public void squareThisBitwise()
squareMatrix(),
squarePreCalc(),
GF2Polynomial.squareThisBitwise()public GF2nPolynomialElement squarePreCalc()
squareMatrix(),
GF2Polynomial.squareThisPreCalc()public void squareThisPreCalc()
squareMatrix(),
GF2Polynomial.squareThisPreCalc()public GF2nPolynomialElement power(int k)
k - the powerpublic GF2nElement squareRoot()
GF2nPolynomialElement.squareRoot in class GF2nElementpublic void squareRootThis()
squareRootThis in class GF2nElement
public GF2nElement solveQuadraticEquation()
throws NoSolutionException
solveQuadraticEquation in class GF2nElementNoSolutionException - if no solution existspublic int trace()
trace in class GF2nElementpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(int radix)
radix - the radix to use (2 or 16, otherwise 2 is used)public byte[] toByteArray()
public FlexiBigInt toFlexiBigInt()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||