Module p192

Module p192 

Source
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§

FieldElement
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§

PointFormat
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