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
-
-
Constructor Summary
Constructors Constructor Description FieldElement(Field f)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods 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 Detail
-
f
protected final Field f
-
-
Constructor Detail
-
FieldElement
public FieldElement(Field f)
-
-
Method Detail
-
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
public abstract FieldElement add(FieldElement val)
-
addOne
public FieldElement addOne()
-
subtract
public abstract FieldElement subtract(FieldElement val)
-
subtractOne
public FieldElement subtractOne()
-
negate
public abstract FieldElement negate()
-
divide
public FieldElement divide(FieldElement val)
-
multiply
public abstract FieldElement multiply(FieldElement val)
-
square
public abstract FieldElement square()
-
squareAndDouble
public abstract FieldElement squareAndDouble()
-
invert
public abstract FieldElement invert()
-
pow22523
public abstract FieldElement pow22523()
-
cmov
public abstract FieldElement cmov(FieldElement val, int b)
- Since:
- 0.9.36
-
-