public class HashToField
extends java.lang.Object
This implementation is restricted to hashing to a field where the field being hashed to is derived from an Elliptic curve
The HashToField function can be used to hash to any field such as a scalar field (group order) This implementation is not suitable for such cases as described in more detail in the GenericOPRFHashToScalar function. Instead, this class is strictly used to implement HashToField when hashing is done to curve order as this is the way the function is used in HashToEllipticCurve operations.
| Modifier and Type | Field and Description |
|---|---|
protected ECCurve |
curve |
protected byte[] |
dst |
protected int |
L
Security parameter for the suite
|
protected int |
m |
protected MessageExpansion |
messageExpansion |
protected java.math.BigInteger |
p |
| Constructor and Description |
|---|
HashToField(byte[] dst,
ECCurve curve,
MessageExpansion messageExpansion,
int L)
Constructs a new instance of the HashToCurveField class.
|
| Modifier and Type | Method and Description |
|---|---|
java.math.BigInteger[][] |
process(byte[] message,
int count)
Processes the input message and hashes it into a multidimensional array of elements in a finite
field derived from an elliptic curve.
|
protected final byte[] dst
protected final ECCurve curve
protected final MessageExpansion messageExpansion
protected int L
protected int m
protected java.math.BigInteger p
public HashToField(byte[] dst,
ECCurve curve,
MessageExpansion messageExpansion,
int L)
This constructor allows the creation of a hash-to-field mechanism tied to an elliptic curve, with parameters specifying domain separation, message expansion mechanics, security level, and the count of resulting field elements.
dst - The domain separation tag, used to separate different domains of usage to ensure
distinct use cases do not produce the same output for the same input.curve - The elliptic curve from which the field to hash to is derived.messageExpansion - The mechanism for expanding input messages, ensuring the required
cryptographic properties for subsequent field hashing.L - The security parameter for the suite, determining the byte length of individual elements
used in the computation.public java.math.BigInteger[][] process(byte[] message,
int count)
message - The input message to be hashed into field elements.count - The number of resulting field elements to be produced during the hashing process.