public class HashToEllipticCurve
extends java.lang.Object
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
| Modifier and Type | Field and Description |
|---|---|
protected CurveProcessor |
curveProcessor |
protected HashToField |
hashToField |
protected MapToCurve |
mapToCurve |
| Modifier | Constructor and Description |
|---|---|
protected |
HashToEllipticCurve(HashToField hashToField,
MapToCurve mapToCurve,
CurveProcessor curveProcessor) |
| Modifier and Type | Method and Description |
|---|---|
ECPoint |
encodeToCurve(byte[] message)
Encode a message to an elliptic curve point using the RFC 9380 encode_to_curve function.
|
AffineXY |
getAffineXY(ECPoint point)
Converts an elliptic-curve point into the affine (x, y) coordinate representation defined by the
hash-to-curve suite.
|
static HashToEllipticCurve |
getInstance(HashToCurveProfile profile,
java.lang.String dst) |
ECPoint |
hashToCurve(byte[] message)
Hashes a message to an elliptic curve point using the RFC 9380 hash_to_curve function.
|
protected final HashToField hashToField
protected final MapToCurve mapToCurve
protected final CurveProcessor curveProcessor
protected HashToEllipticCurve(HashToField hashToField, MapToCurve mapToCurve, CurveProcessor curveProcessor)
public static HashToEllipticCurve getInstance(HashToCurveProfile profile, java.lang.String dst)
public ECPoint hashToCurve(byte[] message)
message - the message to be hashedpublic ECPoint encodeToCurve(byte[] message)
message - the message to be hashedpublic AffineXY getAffineXY(ECPoint point)
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.
point - point on the chosen ECCurve for the selected hash2Curve profile