P-256, also called secp256r1, is a standardized elliptic curve widely used for internet cryptography. It commonly supports ECDH key exchange with approximately 128-bit security. section 5.3.3 section 5.5
Key points:
- NIST FIPS 186-4 specifies P-256, while SEC 2 v2 specifies the same curve under the name secp256r1. section 5.3.3
- Its short Weierstrass equation is y² = x³ + ax + b mod p, with a = −3 and standardized constants. section 5.3.3
- ECDH implementations must verify received public keys; invalid keys are a recurring source of bugs. section 5.5
Choosing a curve for ECDH
For 128-bit security, ECDH commonly uses 256-bit parameters such as P-256 or Curve25519. Applications targeting 256-bit security can instead use P-521 or Curve448. section 5.5


