|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.flexiprovider.common.math.finitefields.GFPElement
This class implements an element of the finite field GF(p), where p is a large prime.
GF2nElement,
GFPElement| Constructor Summary | |
GFPElement(byte[] encValue,
FlexiBigInt p)
Create a new GFPElement from the given encoded value and field order. |
|
GFPElement(FlexiBigInt value,
FlexiBigInt p)
Create a new GFPElement from the given value and field order. |
|
GFPElement(GFPElement other)
Copy constructor. |
|
| 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()
|
boolean |
equals(java.lang.Object other)
Compare this element with another object. |
int |
hashCode()
|
GFElement |
invert()
Compute the multiplicative inverse of this element. |
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). |
GFPElement |
negate()
Compute the additive inverse of this element. |
static GFPElement |
ONE(FlexiBigInt p)
Create the one element. |
GFElement |
subtract(GFElement minuend)
Compute the difference of this element and minuend. |
void |
subtractFromThis(GFElement minuend)
Compute the difference of this element and minuend, overwriting this element. |
byte[] |
toByteArray()
Returns this element as byte array. |
FlexiBigInt |
toFlexiBigInt()
Returns this element as FlexiBigInt. |
java.lang.String |
toString()
Return a String representation of this element. |
java.lang.String |
toString(int radix)
Return a String representation of this element. |
static GFPElement |
ZERO(FlexiBigInt p)
Create the zero element. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public GFPElement(FlexiBigInt value,
FlexiBigInt p)
value - the valuep - the order of the field
public GFPElement(byte[] encValue,
FlexiBigInt p)
encValue - the encoded valuep - the order of the fieldpublic GFPElement(GFPElement other)
other - another GFPElement| Method Detail |
public java.lang.Object clone()
clone in interface GFElementclone in class java.lang.Objectpublic static GFPElement ZERO(FlexiBigInt p)
p - the moduluspublic static GFPElement ONE(FlexiBigInt p)
p - the moduluspublic boolean isZero()
isZero in interface GFElementpublic boolean isOne()
isOne in interface GFElementpublic boolean equals(java.lang.Object other)
equals in interface GFElementequals in class java.lang.Objectother - the other objectpublic int hashCode()
hashCode in interface GFElementhashCode in class java.lang.Object
public GFElement add(GFElement addend)
throws DifferentFieldsException
add in interface GFElementaddend - the addendDifferentFieldsException - if the elements are of different fields.
public void addToThis(GFElement addend)
throws DifferentFieldsException
addToThis in interface GFElementaddend - the addendDifferentFieldsException - if the elements are of different fields.
public GFElement subtract(GFElement minuend)
throws DifferentFieldsException
subtract in interface GFElementminuend - the minuendDifferentFieldsException - if the elements are of different fields.
public void subtractFromThis(GFElement minuend)
throws DifferentFieldsException
subtractFromThis in interface GFElementminuend - the minuendDifferentFieldsException - if the elements are of different fields.public GFPElement negate()
public GFElement multiply(GFElement factor)
throws DifferentFieldsException
multiply in interface GFElementfactor - the factorDifferentFieldsException - if the elements are of different fields.
public void multiplyThisBy(GFElement factor)
throws DifferentFieldsException
multiplyThisBy in interface GFElementfactor - the factorDifferentFieldsException - if the elements are of different fields.
public GFElement invert()
throws java.lang.ArithmeticException
invert in interface GFElementjava.lang.ArithmeticException - if this is the zero element.public byte[] toByteArray()
GFElementtoByteArray in interface GFElementpublic FlexiBigInt toFlexiBigInt()
GFElementtoFlexiBigInt in interface GFElementpublic java.lang.String toString()
GFElementtoString in interface GFElementtoString in class java.lang.Objectpublic java.lang.String toString(int radix)
GFElementtoString in interface GFElementde.flexiprovider.common.math.finitefields.GFElementradix - specifies the radix of the String representation
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||