Hash-to-curve family

Hash-to-curve (RFC 9380)

Deterministic hashing of byte strings to elliptic curve points with the SSWU map

unverified 1 variant IRTF CFRG, RFC 9380

Overview

Hash-to-curve maps arbitrary input to a point on an elliptic curve so that the discrete logarithm of the result is unknown to everyone. RFC 9380 standardises these encodings, which are required by OPRFs, PAKEs, BLS-style signatures and verifiable random functions.

Naive approaches, such as multiplying the generator by a hash, reveal the discrete logarithm of the output and break protocols that rely on it being unknown. Try-and-increment approaches leak timing. RFC 9380 instead first expands the input with a domain separation tag using expand_message_xmd, reduces the result to field elements, and applies a deterministic, constant-time map to the curve. For short Weierstrass curves the map is the simplified Shallue-van de Woestijne-Ulas (SSWU) method.

Two variants exist per suite. The random-oracle (RO) encoding hashes to two field elements, maps both and adds the points, giving an output indistinguishable from a random oracle. The nonuniform (NU) encoding maps a single field element and is cheaper but not uniformly distributed, so it suits only protocols that tolerate this. Both variants are constant time when implemented as specified.

Four suites are present: P256_XMD:SHA-256_SSWU, P384_XMD:SHA-384_SSWU, P521_XMD:SHA-512_SSWU and secp256k1_XMD:SHA-256_SSWU. Because secp256k1 has curve coefficient a = 0, SSWU cannot be applied directly; the suite maps to an isogenous curve and then applies a 3-isogeny back to secp256k1. Applications choose the suite matching the curve and hash used elsewhere in their protocol. The cofactor of each of these curves is one, so no cofactor clearing is needed.

History

2023–2023
  1. Specified in RFC 9380 secp256k1_XMD:SHA-256_SSWU_RO_ / _NU_

How it works

  1. Expand the message and a domain separation tag to a uniform byte string with expand_message_xmd.
  2. Interpret the bytes as one (NU) or two (RO) field elements.
  3. Apply the simplified SSWU map to each, via an isogenous curve for secp256k1.
  4. For RO, add the two points; finally clear the cofactor (trivial for these prime-order curves).

Security notes

Each protocol must use a unique domain separation tag; reusing tags across protocols breaks the independence assumptions. Using the NU encoding where a random oracle is required can undermine security proofs. NextSSL has not yet verified these suites against the RFC test vectors.

Typical uses

Oblivious PRFs and Privacy Pass on NIST curvesPAKEs such as CPace and OPAQUE variantsVerifiable random functions and hash-to-point signaturesDeriving nothing-up-my-sleeve generators

Variants in NextSSL

1
AlgorithmTierSizes (bytes)StandardsAPI
H2c-secp256k1-SHA-256-Sswu
h2c-secp256k1-sha256-sswu
unverified out 33 RFC 9380 secp256k1_XMD:SHA-256_SSWU_RO_ / _NU_ root

Frequently asked questions

Which Hash-to-curve (RFC 9380) variants does NextSSL include?

NextSSL registers 1 Hash-to-curve (RFC 9380) variant: h2c-secp256k1-sha256-sswu.