Digital signatures

ECDSA-P-521

Elliptic Curve Digital Signature Algorithm on NIST curves and secp256k1

standard Safe API Specified in a FIPS standard

About ECDSA-P-521

ECDSA-P-521 is one of 13 ECDSA variants in the NextSSL registry, a digital signature scheme. It uses a 133-byte public key, a 66-byte secret key, a 132-byte signature and a 66-byte seed. It takes the parameter deterministic (default 0). Its registry entry cites FIPS 186-5, RFC 6979 and SEC 1 and others. It is also known as ecdsa-secp521r1. NextSSL lists it in the standard tier and exposes it through the safe API.

Overview

ECDSA is the elliptic-curve version of the Digital Signature Algorithm and the most widely deployed signature scheme on the internet. It provides compact, fast classical signatures but is not secure against large quantum computers.

A key pair is a secret scalar d and a public point Q = dG on an elliptic curve. To sign, the signer picks a per-signature secret nonce k, computes the x-coordinate r of kG, and combines r, the message hash and d into the value s. Verification uses only Q, the hash and (r, s). Security relies on the elliptic curve discrete logarithm problem.

The nonce is the scheme's weak point. Reusing k, or leaking even a few bits of it across many signatures, allows recovery of the private key, as happened with the Sony PlayStation 3 signing key and several cryptocurrency wallets. RFC 6979 deterministic nonce generation removes the dependence on a random number generator, and FIPS 186-5 permits it. ECDSA signatures are also malleable: (r, -s) is a valid signature when (r, s) is.

Four curves are present: NIST P-256, P-384 and P-521, as specified in FIPS 186-5 and SEC 2, and secp256k1, the Koblitz curve used by Bitcoin and Ethereum and registered for JOSE and COSE in RFC 8812. Hashes are normally SHA-256 for P-256 and secp256k1, SHA-384 for P-384 and SHA-512 for P-521. Signatures are commonly encoded either as a DER sequence or as fixed-length r and s concatenated.

History

1992–2023
  1. ECDSA proposed by Scott Vanstone

  2. Standardised in ANSI X9.62

  3. Added to FIPS 186-2

  4. Deterministic nonces specified in RFC 6979

  5. FIPS 186-5 published

How it works

  1. KeyGen picks a random scalar d and computes Q = dG.
  2. Sign hashes the message to e, chooses a nonce k (random or per RFC 6979), and sets r = x(kG) mod n.
  3. It computes s = k^-1 (e + r*d) mod n and outputs (r, s).
  4. Verify computes u1 = e/s and u2 = r/s and checks that x(u1*G + u2*Q) equals r.

Security notes

Broken by a large quantum computer running Shor's algorithm, so migration to ML-DSA or hybrid signatures is advised for long-lived keys. Nonce reuse or bias leaks the private key; use RFC 6979 or hedged nonces and constant-time scalar multiplication.

Typical uses

TLS certificates and WebPKICryptocurrency transactions on secp256k1JWT/JOSE and COSE token signingCode and document signing

Sizes

FieldBytesMeaning
pk133Public key
sk66Secret key
sig132Signature
seed66Seed
ctx0Context string

Parameters

NameTypeRangeDefaultRequired
deterministic u32 0 – 1 0 no

Parameters are passed as a string, for example nextssl_mac("hmac", "hash=sha512", …). Omitted parameters take their declared default.

Use it

from nextssl_demo import NextSSL

ns = NextSSL()              # safe API: safe and standard tiers
pk, sk = ns.call("sign_keygen", "ecdsa-p521", None, outs=2)
sig = ns.call("sign_detached", "ecdsa-p521", None, sk, b"message", b"")[0]
ok  = ns.check("verify_detached", "ecdsa-p521", None, pk, b"message", b"", sig)

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Frequently asked questions

What is ECDSA-P-521?

ECDSA-P-521 is a signature in the ECDSA family. ECDSA is the elliptic-curve version of the Digital Signature Algorithm and the most widely deployed signature scheme on the internet. It is also known as ecdsa-secp521r1.

What are the ECDSA-P-521 sizes?

In NextSSL, ECDSA-P-521 uses: public key 133 bytes, signature 132 bytes.

Is ECDSA-P-521 post-quantum?

No. ECDSA-P-521 is a classical signature based on elliptic curves or discrete logarithms, which a large quantum computer running Shor's algorithm could break. For post-quantum use, look at ML-DSA or SLH-DSA.

Who designed ECDSA-P-521 and when?

ECDSA-P-521 belongs to the ECDSA family, first published in 1992 by Scott Vanstone (proposal); standardised by ANSI and NIST. Its origin: FIPS 186-5, ANSI X9.62, SEC 1.

Which standards define ECDSA-P-521?

ECDSA-P-521 is referenced by FIPS 186-5, RFC 6979, SEC 1, RFC 9864. It is specified in a FIPS standard.

Is ECDSA-P-521 safe to use?

ECDSA-P-521 is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.

What other ECDSA variants are there?

NextSSL also registers ecdsa-p256, ecdsa-p384, ecdsa-secp256k1, libecc-ecdsa-brainpoolp256r1-sha256, libecc-ecdsa-brainpoolp320r1-sha384, libecc-ecdsa-brainpoolp384r1-sha384 and more in the ECDSA family.