public abstract class Encoding extends Object implements Serializable
| Constructor and Description |
|---|
Encoding() |
| Modifier and Type | Method and Description |
|---|---|
abstract FieldElement | decode(byte[] in)Decode a FieldElement from its $(b-1)$-bit encoding. |
abstract byte[] | encode(FieldElement x)Encode a FieldElement in its $(b-1)$-bit encoding. |
abstract boolean | isNegative(FieldElement x)From the Ed25519 paper: $x$ is negative if the $(b-1)$-bit encoding of $x$ is lexicographically larger than the $(b-1)$-bit encoding of -x. |
void | setField(Field f)Set the field. |
protected Field f
public abstract FieldElement decode(byte[] in)
in - the $(b-1)$-bit encoding of a FieldElement.public abstract byte[] encode(FieldElement x)
x - the FieldElement to encodepublic abstract boolean isNegative(FieldElement x)
x - the FieldElement to checkpublic void setField(Field f)
f - the field to set