public class MontgomeryCurveProcessor extends java.lang.Object implements CurveProcessor
| Constructor and Description |
|---|
MontgomeryCurveProcessor(ECCurve curve,
int J,
int K,
int hEff)
Constructs a MontgomeryCurveProcessor object for processing elliptic curves represented in the
Montgomery model.
|
| Modifier and Type | Method and Description |
|---|---|
ECPoint |
add(ECPoint P,
ECPoint Q)
Adds two elliptic curve points on the Montgomery curve model and returns the resulting point.
|
ECPoint |
clearCofactor(ECPoint P)
Clears the cofactor of the given elliptic curve point using the efficient cofactor value.
|
AffineXY |
mapToAffineXY(ECPoint p)
Converts an elliptic-curve point into the affine (x, y) coordinate representation defined by the
hash-to-curve suite.
|
public MontgomeryCurveProcessor(ECCurve curve, int J, int K, int hEff)
curve - the elliptic curve to be processed, represented using the ECCurve classJ - parameter J of the Montgomery curve equation, used for internal calculationsK - parameter K of the Montgomery curve equation, used for internal calculationshEff - the effective cofactor value for the curve, utilized in certain operationspublic ECPoint add(ECPoint P, ECPoint Q)
add in interface CurveProcessorP - the first elliptic curve point on the Montgomery curve modelQ - the second elliptic curve point on the Montgomery curve modelpublic ECPoint clearCofactor(ECPoint P)
clearCofactor in interface CurveProcessorP - the elliptic curve point on the Montgomery curve modelpublic AffineXY mapToAffineXY(ECPoint p)
CurveProcessorThe returned coordinates are intended for serialization, testing, and interoperability with the reference outputs defined in RFC 9380. For most Weierstrass curves, this is simply the affine (x, y) coordinates of the given point. For curves that use a different coordinate model in the specification (e.g. Montgomery curves such as curve25519), this method applies the appropriate coordinate transformation.
This method does not change the underlying group element represented by the point. It only changes how that point is expressed as field elements. The input point is expected to be a valid point on the curve used by the implementation.
mapToAffineXY in interface CurveProcessorp - a valid elliptic-curve point