Interface GFElement
- All Known Implementing Classes:
GF2nElement
,GF2nONBElement
,GF2nPolynomialElement
public interface GFElement
This interface defines a finite field element. It is implemented by the
class
GF2nElement
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCompute the sum of this element and the addend.void
Compute the sum of this element and the addend, overwriting this element.clone()
boolean
Compare this curve with another object.int
hashCode()
invert()
Compute the multiplicative inverse of this element.boolean
isOne()
Checks whether this element is one.boolean
isZero()
Checks whether this element is zero.Compute the product of this element and factor.void
multiplyThisBy
(GFElement factor) Compute this * factor (overwrite this).Compute the difference of this element and minuend.void
subtractFromThis
(GFElement minuend) Compute the difference of this element and minuend, overwriting this element.byte[]
Returns this element as byte array.Returns this element as FlexiBigInt.toString()
Return a String representation of this element.toString
(int radix) Return a String representation of this element.
-
Method Details
-
clone
Object clone()- Returns:
- a copy of this GFElement
-
equals
Compare this curve with another object. -
hashCode
int hashCode() -
isZero
boolean isZero()Checks whether this element is zero.- Returns:
- true if this is the zero element
-
isOne
boolean isOne()Checks whether this element is one.- Returns:
- true if this is the one element
-
add
Compute the sum of this element and the addend.- Parameters:
addend
- the addend- Returns:
- this + other (newly created)
- Throws:
RuntimeException
-
addToThis
Compute the sum of this element and the addend, overwriting this element.- Parameters:
addend
- the addend- Throws:
RuntimeException
-
subtract
Compute the difference of this element and minuend.- Parameters:
minuend
- the minuend- Returns:
- this - minuend (newly created)
- Throws:
RuntimeException
-
subtractFromThis
Compute the difference of this element and minuend, overwriting this element.- Parameters:
minuend
- the minuend
-
multiply
Compute the product of this element and factor.- Parameters:
factor
- the factor- Returns:
- this * factor (newly created)
- Throws:
RuntimeException
-
multiplyThisBy
Compute this * factor (overwrite this).- Parameters:
factor
- the factor- Throws:
RuntimeException
-
invert
Compute the multiplicative inverse of this element.- Returns:
- this-1 (newly created)
- Throws:
ArithmeticException
- if this is the zero element.
-
toFlexiBigInt
BigInteger toFlexiBigInt()Returns this element as FlexiBigInt. The conversion is P1363-conform.- Returns:
- this element as BigInt
-
toByteArray
byte[] toByteArray()Returns this element as byte array. The conversion is P1363-conform.- Returns:
- this element as byte array
-
toString
String toString()Return a String representation of this element. -
toString
Return a String representation of this element. radix specifies the radix of the String representation.- Parameters:
radix
- specifies the radix of the String representation- Returns:
- String representation of this element with the specified radix
-