Class HashToEllipticCurve
Steps: 1. u = hash_to_field(msg, 2) 2. Q0 = map_to_curve(u[0]) 3. Q1 = map_to_curve(u[1]) 4. R = Q0 + Q1
# Point addition 5. P = clear_cofactor(R) 6. return P
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CurveProcessorprotected final HashToFieldprotected final MapToCurve -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHashToEllipticCurve(HashToField hashToField, MapToCurve mapToCurve, CurveProcessor curveProcessor) -
Method Summary
Modifier and TypeMethodDescriptionencodeToCurve(byte[] message) Encode a message to an elliptic curve point using the RFC 9380 encode_to_curve function.getAffineXY(ECPoint point) Converts an elliptic-curve point into the affine (x, y) coordinate representation defined by the hash-to-curve suite.static HashToEllipticCurvegetInstance(HashToCurveProfile profile, String dst) hashToCurve(byte[] message) Hashes a message to an elliptic curve point using the RFC 9380 hash_to_curve function.
-
Field Details
-
hashToField
-
mapToCurve
-
curveProcessor
-
-
Constructor Details
-
HashToEllipticCurve
protected HashToEllipticCurve(HashToField hashToField, MapToCurve mapToCurve, CurveProcessor curveProcessor)
-
-
Method Details
-
getInstance
-
hashToCurve
Hashes a message to an elliptic curve point using the RFC 9380 hash_to_curve function. This function provides a uniform distribution of resulting points.- Parameters:
message- the message to be hashed- Returns:
- the resulting elliptic curve point P
-
encodeToCurve
Encode a message to an elliptic curve point using the RFC 9380 encode_to_curve function. This function does not provide a uniform distribution of resulting points. This function MUST NOT be used when uniform distribution is a security requirement.- Parameters:
message- the message to be hashed- Returns:
- the resulting elliptic curve point P
-
getAffineXY
Converts an elliptic-curve point into the affine (x, y) coordinate representation defined by the hash-to-curve suite.The 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.
- Parameters:
point- point on the chosen ECCurve for the selected hash2Curve profile- Returns:
- AffineXY coordinates for the point on the curve defined in RFC 9380 for the selected profile
-