Expand description
NIST P-192 Elliptic Curve Primitives
This module implements NIST P-192 elliptic curve operations in constant time. Curve equation: y² = x³ - 3x + b over 𝔽ₚ, where
- p = 2¹⁹² − 2⁶⁴ − 1,
- Curve order n = 0xFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF. (NIST P-192 order).
Implements:
- Mersenne reduction for 𝔽ₚ (2¹⁹² ≡ 2⁶⁴ + 1),
- Jacobian projective coordinates for point operations,
- Constant‐time scalar multiplication, addition, etc.
Structs§
- Field
Element - P-192 field element representing values in 𝔽ₚ, where p = 2¹⁹² − 2⁶⁴ − 1. Internally stored as 6 little‐endian 32‐bit limbs.
- Point
- Affine coordinates (x, y) or identity; 𝔽ₚ is built from FieldElement
- Scalar
- P-192 scalar: integers mod n, where n = 0xFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF (curve order).
Enums§
- Point
Format - Format of a serialized elliptic‐curve point
Constants§
- P192_
FIELD_ ELEMENT_ SIZE - Size of a P-192 field element in bytes (24 bytes = 192 bits)
- P192_
KEM_ SHARED_ SECRET_ KDF_ OUTPUT_ SIZE - Size of the KDF output for P-192 ECDH‐KEM shared secret derivation
- P192_
POINT_ COMPRESSED_ SIZE - Size of a compressed P-192 point in bytes: format byte (0x02/0x03) + x-coordinate
- P192_
POINT_ UNCOMPRESSED_ SIZE - Size of an uncompressed P-192 point in bytes: format byte (0x04) + x-coordinate + y-coordinate
- P192_
SCALAR_ SIZE - Size of a P-192 scalar in bytes (24 bytes = 192 bits)
Functions§
- base_
point_ g - Get the standard base point G of the P-192 curve
- generate_
keypair - Generate a cryptographically secure ECDH keypair
- kdf_
hkdf_ sha256_ for_ ecdh_ kem - Key derivation for ECDH shared secret using HKDF-SHA256
- scalar_
mult - General scalar multiplication: compute scalar * arbitrary point
- scalar_
mult_ base_ g - Scalar multiplication with the base point: scalar * G