H2c-P-256-SHA-256-Sswu
Deterministic hashing of byte strings to elliptic curve points with the SSWU map
Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About H2c-P-256-SHA-256-Sswu
H2c-P-256-SHA-256-Sswu is a hash-to-curve suite from the Hash-to-curve (RFC 9380) family. It uses a 33-byte (264-bit) output. Its registry entry cites RFC 9380 P256_XMD:SHA-256_SSWU_RO_ / _NU_. It is also known as hash-to-curve-p256. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
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–2023Specified in RFC 9380 P256_XMD:SHA-256_SSWU_RO_ / _NU_
How it works
- Expand the message and a domain separation tag to a uniform byte string with expand_message_xmd.
- Interpret the bytes as one (NU) or two (RO) field elements.
- Apply the simplified SSWU map to each, via an isogenous curve for secp256k1.
- 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
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 33 | Output |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'unverified' is reachable from the root API only
info = root.info("h2c-p256-sha256-sswu")
nextssl_algorithm_info_json("h2c-p256-sha256-sswu", out);
// h2c is a root-only kind: use the C ABI (nextssl_root_*)
// or the H2C trait in nextssl-core/src/traits.rs
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Similar names
Looking for something else?Frequently asked questions
What is H2c-P-256-SHA-256-Sswu?
H2c-P-256-SHA-256-Sswu is a hash-to-curve in the Hash-to-curve (RFC 9380) family. 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. It is also known as hash-to-curve-p256.
What are the H2c-P-256-SHA-256-Sswu sizes?
In NextSSL, H2c-P-256-SHA-256-Sswu uses: output 33 bytes.
Who designed H2c-P-256-SHA-256-Sswu and when?
H2c-P-256-SHA-256-Sswu belongs to the Hash-to-curve (RFC 9380) family, first published in 2023 by Armando Faz-Hernández, Sam Scott, Nick Sullivan, Riad S. Wahby, Christopher A. Wood. Its origin: IRTF CFRG, RFC 9380.
Which standards define H2c-P-256-SHA-256-Sswu?
H2c-P-256-SHA-256-Sswu is referenced by RFC 9380 P256_XMD:SHA-256_SSWU_RO_ / _NU_.
Is H2c-P-256-SHA-256-Sswu safe to use?
H2c-P-256-SHA-256-Sswu is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
Related families
The NIST Merkle–Damgård hash family behind most of today's TLS, signatures and software
ECDH (including X25519 and X448)Elliptic-curve Diffie-Hellman key agreement on NIST curves, Curve25519 and Curve448
OPRF (RFC 9497)Oblivious pseudorandom function over ristretto255 with SHA-512
OPAQUEAsymmetric PAKE: password login where the server never sees the password
ECDSAElliptic Curve Digital Signature Algorithm on NIST curves and secp256k1