java.lang.Object
net.i2p.crypto.eddsa.math.Field
- All Implemented Interfaces:
Serializable
An EdDSA finite field. Includes several pre-computed values.
- See Also:
Field Summary
Modifier and TypeFieldDescriptionprivate final intThe bit length of field elements.final FieldElementThe field element eight.private final EncodingThe encoding for field elements.final FieldElementThe field element five.final FieldElementThe field element four.final FieldElementThe field's multiplicative identity.private final FieldElementThe field prime q.private final FieldElementThe value q - 2.private final FieldElement(q-5) / 8.private static final longPinned for serialized-form compatibility.final FieldElementThe field element two.final FieldElementThe field's additive identity.Constructor Summary
Method Summary
All MethodsModifier and TypeMethodDescriptionbooleanCompare for equality.final FieldElementfromByteArray(byte[] x) Create a field element from a byte array.intgetb()Return the bit length.Return the encoding for field elements, which converts them to and from bytes.getQ()Return the field prime.getQm2()Return q - 2.getQm5d8()Return (q - 5) / 8.inthashCode()Return the hash code.
Field Details
serialVersionUID
private static final long serialVersionUIDPinned for serialized-form compatibility.- See Also:
ZERO
The field's additive identity.ONE
The field's multiplicative identity.TWO
The field element two.FOUR
The field element four.FIVE
The field element five.EIGHT
The field element eight.b
private final int bThe bit length of field elements.q
The field prime q.qm2
The value q - 2.qm5d8
(q-5) / 8.enc
The encoding for field elements.
Constructor Details
Field
Create a finite field.- Parameters:
b- the bit lengthq- the field primeenc- the Encoding that converts field elements to and from bytes
Method Details
fromByteArray
Create a field element from a byte array.- Parameters:
x- the byte array- Returns:
- the field element
getb
public int getb()Return the bit length.- Returns:
- the bit length
getQ
getQm2
getQm5d8
getEncoding
Return the encoding for field elements, which converts them to and from bytes.- Returns:
- the Encoding that converts field elements to and from bytes
hashCode
equals