Packages that use FieldElement
Package
Description
Data structures that define curves and fields, and the mathematical operations on them.
Generic elliptic curve mathematical implementation using Java BigIntegers, serving as the reference implementation for curves without specialized optimizations.
Optimized mathematical implementation for Ed25519 using Radix 2^51 field representation for performance on 64-bit processors.
Uses of FieldElement in net.i2p.crypto.eddsa.math
Fields in net.i2p.crypto.eddsa.math declared as FieldElementModifier and TypeFieldDescriptionprivate final FieldElementCurve.dThe curve parameter d.private final FieldElementCurve.d2Twice the curve parameter d.final FieldElementField.EIGHTThe field element eight.final FieldElementField.FIVEThe field element five.final FieldElementField.FOURThe field element four.private final FieldElementCurve.IThe square root of -1.final FieldElementField.ONEThe field's multiplicative identity.private final FieldElementField.qThe field prime q.private final FieldElementField.qm2The value q - 2.private final FieldElementField.qm5d8(q-5) / 8.(package private) final FieldElementGroupElement.TVariable is package private only so that tests run.final FieldElementField.TWOThe field element two.(package private) final FieldElementGroupElement.XVariable is package private only so that tests run.(package private) final FieldElementGroupElement.YVariable is package private only so that tests run.(package private) final FieldElementGroupElement.ZVariable is package private only so that tests run.final FieldElementField.ZEROThe field's additive identity.Methods in net.i2p.crypto.eddsa.math that return FieldElementModifier and TypeMethodDescriptionabstract FieldElementFieldElement.add(FieldElement val) Adds another field element to this one.FieldElement.addOne()Adds one to this field element.abstract FieldElementFieldElement.cmov(FieldElement val, int b) Conditional move - sets this element to val if b is 1, otherwise leaves it unchanged.abstract FieldElementEncoding.decode(byte[] in) Decode a FieldElement from its $(b-1)$-bit encoding.FieldElement.divide(FieldElement val) Divides this field element by another one.final FieldElementField.fromByteArray(byte[] x) Create a field element from a byte array.Curve.get2D()Return twice the curve parameter d.Curve.getD()Return the curve parameter d.Curve.getI()Return the square root of -1.Field.getQ()Return the field prime.Field.getQm2()Return q - 2.Field.getQm5d8()Return (q - 5) / 8.GroupElement.getT()The $T$ value of the group element.GroupElement.getX()The $X$ value of the group element.GroupElement.getY()The $Y$ value of the group element.GroupElement.getZ()The $Z$ value of the group element.abstract FieldElementFieldElement.invert()Computes the multiplicative inverse of this field element.abstract FieldElementFieldElement.multiply(FieldElement val) Multiplies this field element by another one.abstract FieldElementFieldElement.negate()Negates this field element.abstract FieldElementFieldElement.pow22523()Raises this field element to the power of $2^{252} - 3$.abstract FieldElementFieldElement.square()Squares this field element.abstract FieldElementFieldElement.squareAndDouble()Squares this field element and doubles the result.abstract FieldElementFieldElement.subtract(FieldElement val) Subtracts another field element from this one.FieldElement.subtractOne()Subtracts one from this field element.Methods in net.i2p.crypto.eddsa.math with parameters of type FieldElementModifier and TypeMethodDescriptionabstract FieldElementFieldElement.add(FieldElement val) Adds another field element to this one.static GroupElementGroupElement.cached(Curve curve, FieldElement ypX, FieldElement ymX, FieldElement z, FieldElement t2d) Creates a new group element in CACHED representation.abstract FieldElementFieldElement.cmov(FieldElement val, int b) Conditional move - sets this element to val if b is 1, otherwise leaves it unchanged.FieldElement.divide(FieldElement val) Divides this field element by another one.abstract byte[]Encoding.encode(FieldElement x) Encode a FieldElement in its $(b-1)$-bit encoding.abstract booleanEncoding.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.abstract FieldElementFieldElement.multiply(FieldElement val) Multiplies this field element by another one.static GroupElementGroupElement.p1p1(Curve curve, FieldElement x, FieldElement y, FieldElement z, FieldElement t) Creates a new group element in P1P1 representation.static GroupElementGroupElement.p2(Curve curve, FieldElement x, FieldElement y, FieldElement z) Creates a new group element in P2 representation.static GroupElementGroupElement.p3(Curve curve, FieldElement x, FieldElement y, FieldElement z, FieldElement t) Creates a new group element in P3 representation, without pre-computation.static GroupElementGroupElement.p3(Curve curve, FieldElement x, FieldElement y, FieldElement z, FieldElement t, boolean precomputeDoubleOnly) Creates a new group element in P3 representation, potentially with pre-computation.static GroupElementGroupElement.precomp(Curve curve, FieldElement ypx, FieldElement ymx, FieldElement xy2d) Creates a new group element in PRECOMP representation.abstract FieldElementFieldElement.subtract(FieldElement val) Subtracts another field element from this one.Constructors in net.i2p.crypto.eddsa.math with parameters of type FieldElementModifierConstructorDescriptionCurve(Field f, byte[] d, FieldElement i) Create a twisted Edwards curve.GroupElement(Curve curve, GroupElement.Representation repr, FieldElement x, FieldElement y, FieldElement z, FieldElement t) Creates a group element for a curve, without any pre-computation.GroupElement(Curve curve, GroupElement.Representation repr, FieldElement x, FieldElement y, FieldElement z, FieldElement t, boolean precomputeDouble) Creates a group element for a curve, with optional pre-computation.Uses of FieldElement in net.i2p.crypto.eddsa.math.bigint
Subclasses of FieldElement in net.i2p.crypto.eddsa.math.bigintModifier and TypeClassDescriptionclassA particular element of the field \Z/(2^255-19).Methods in net.i2p.crypto.eddsa.math.bigint that return FieldElementModifier and TypeMethodDescriptionBigIntegerFieldElement.add(FieldElement val) BigIntegerFieldElement.addOne()BigIntegerFieldElement.cmov(FieldElement val, int b) Conditional move.BigIntegerLittleEndianEncoding.decode(byte[] in) Decode a FieldElement from its $(b-1)$-bit encoding.BigIntegerFieldElement.divide(BigInteger val) Divide by a BigInteger.BigIntegerFieldElement.divide(FieldElement val) BigIntegerFieldElement.invert()BigIntegerFieldElement.mod(FieldElement m) Return this field element modulo m.BigIntegerFieldElement.modPow(FieldElement e, FieldElement m) Return this field element to the power e modulo m.BigIntegerFieldElement.multiply(FieldElement val) BigIntegerFieldElement.negate()BigIntegerFieldElement.pow(FieldElement e) Return this field element to the power e.BigIntegerFieldElement.pow22523()BigIntegerFieldElement.square()BigIntegerFieldElement.squareAndDouble()BigIntegerFieldElement.subtract(FieldElement val) BigIntegerFieldElement.subtractOne()Methods in net.i2p.crypto.eddsa.math.bigint with parameters of type FieldElementModifier and TypeMethodDescriptionBigIntegerFieldElement.add(FieldElement val) BigIntegerFieldElement.cmov(FieldElement val, int b) Conditional move.BigIntegerFieldElement.divide(FieldElement val) byte[]BigIntegerLittleEndianEncoding.encode(FieldElement x) Encode a FieldElement in its $(b-1)$-bit encoding.booleanBigIntegerLittleEndianEncoding.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$.BigIntegerFieldElement.mod(FieldElement m) Return this field element modulo m.BigIntegerFieldElement.modPow(FieldElement e, FieldElement m) Return this field element to the power e modulo m.BigIntegerFieldElement.multiply(FieldElement val) BigIntegerFieldElement.pow(FieldElement e) Return this field element to the power e.BigIntegerFieldElement.subtract(FieldElement val) Uses of FieldElement in net.i2p.crypto.eddsa.math.ed25519
Subclasses of FieldElement in net.i2p.crypto.eddsa.math.ed25519Modifier and TypeClassDescriptionclassClass to represent a field element of the finite field $p = 2^{255} - 19$ elements.Methods in net.i2p.crypto.eddsa.math.ed25519 that return FieldElementModifier and TypeMethodDescriptionEd25519FieldElement.add(FieldElement val) $h = f + g$Ed25519FieldElement.cmov(FieldElement val, int b) Constant-time conditional move.Ed25519LittleEndianEncoding.decode(byte[] in) Decodes a given field element in its 10 byte $2^{25.5}$ representation.Ed25519FieldElement.invert()Invert this field element.Ed25519FieldElement.multiply(FieldElement val) $h = f * g$Ed25519FieldElement.negate()$h = -f$Ed25519FieldElement.pow22523()This field element to the power of $(2^{252} - 3)$.Ed25519FieldElement.square()$h = f * f$Ed25519FieldElement.squareAndDouble()$h = 2 * f * f$Ed25519FieldElement.subtract(FieldElement val) $h = f - g$Methods in net.i2p.crypto.eddsa.math.ed25519 with parameters of type FieldElementModifier and TypeMethodDescriptionEd25519FieldElement.add(FieldElement val) $h = f + g$Ed25519FieldElement.cmov(FieldElement val, int b) Constant-time conditional move.byte[]Ed25519LittleEndianEncoding.encode(FieldElement x) Encodes a given field element in its 32 byte representation.booleanEd25519LittleEndianEncoding.isNegative(FieldElement x) Is the FieldElement negative in this encoding?Ed25519FieldElement.multiply(FieldElement val) $h = f * g$Ed25519FieldElement.subtract(FieldElement val) $h = f - g$