Package net.i2p.crypto.eddsa.math
Class FieldElement
java.lang.Object
net.i2p.crypto.eddsa.math.FieldElement
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BigIntegerFieldElement
,Ed25519FieldElement
public abstract class FieldElement extends Object implements Serializable
Note: concrete subclasses must implement hashCode() and equals()
- Since:
- 0.9.15
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FieldElement(Field f)
-
Method Summary
Modifier and Type Method Description abstract FieldElement
add(FieldElement val)
FieldElement
addOne()
abstract FieldElement
cmov(FieldElement val, int b)
FieldElement
divide(FieldElement val)
abstract FieldElement
invert()
boolean
isNegative()
abstract boolean
isNonZero()
abstract FieldElement
multiply(FieldElement val)
abstract FieldElement
negate()
abstract FieldElement
pow22523()
abstract FieldElement
square()
abstract FieldElement
squareAndDouble()
abstract FieldElement
subtract(FieldElement val)
FieldElement
subtractOne()
byte[]
toByteArray()
Encode a FieldElement in its $(b-1)$-bit encoding.
-
Field Details
-
Constructor Details
-
Method Details
-
toByteArray
public byte[] toByteArray()Encode a FieldElement in its $(b-1)$-bit encoding.- Returns:
- the $(b-1)$-bit encoding of this FieldElement.
-
isNonZero
public abstract boolean isNonZero() -
isNegative
public boolean isNegative() -
add
-
addOne
-
subtract
-
subtractOne
-
negate
-
divide
-
multiply
-
square
-
squareAndDouble
-
invert
-
pow22523
-
cmov
- Since:
- 0.9.36
-