wire / wire-format / ecc
ECC is a public-key cryptosystem based on the discrete logarithm problem on elliptic curves. Curve: y^2 = x^3 + ax + b (mod p) for prime curves, or y^2 + xy = x^3 + ax^2 + b (binary curves). Key pair: private key d (random scalar), public key Q = d*G (point multiplication). ECDH: shared secret = d_A * Q_B = d_B * Q_A. ECDSA: signature (r, s) where r = (k*G)_x mod n, s = k^(-1)(z + r*d) mod n.
aka: Elliptic Curve Cryptography (ECC)
spec: SEC 2 / RFC 6090
ECC is a public-key cryptosystem based on the discrete logarithm problem on elliptic curves. Curve: y^2 = x^3 + ax + b (mod p) for prime curves, or y^2 + xy = x^3 + ax^2 + b (binary curves). Key pair: private key d (random scalar), public key Q = d*G (point multiplication). ECDH: shared secret = d_A * Q_B = d_B * Q_A. ECDSA: signature (r, s) where r = (k*G)_x mod n, s = k^(-1)(z + r*d) mod n.
| field | size | meaning |
|---|---|---|
| Curve equation (prime) | parameters | y^2 = x^3 + ax + b (mod p). p = prime, a, b = curve coefficients. |
| Base point (G) | 2 coordinates | Generator point on the curve. Order n (prime). |
| Private key (d) | n bits | Random scalar in [1, n-1]. |
| Public key (Q) | 2 coordinates | Q = d * G (scalar multiplication). (x, y) on the curve. |
| ECDH shared secret | operation | Shared = d_A * Q_B = d_B * Q_A (point on curve). Use x-coordinate as key material. |
| ECDSA signature | 2 scalars (r, s) | r = (k*G)_x mod n. s = k^(-1)(z + r*d) mod n. (k = random nonce, z = hash of message.) |
| ECDSA verify | operation | u1 = z * s^(-1) mod n. u2 = r * s^(-1) mod n. R = u1*G + u2*Q. Verify R_x == r mod n. |
| Common curves | names | P-256 (secp256r1), P-384, P-521 (NIST). Curve25519 (X25519 for ECDH, Ed25519 for signatures). secp256k1 (Bitcoin). |
example:
00 00 00 00
ECC (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/ecc
or /wire-format/ecc.json