Module b283k

Module b283k 

Source
Expand description

Koblitz sect283k1 Elliptic Curve Primitives

This module implements the sect283k1 binary elliptic curve operations. The curve equation is y² + xy = x³ + 1 over the binary field GF(2^283).

  • Field polynomial: x^283 + x^12 + x^7 + x^5 + 1
  • The curve order n = 0x01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE96E404282DD3232283E52623152F256011

Operations are designed to be constant-time.

Structs§

FieldElement
A field element in GF(2^283) represented by 5 u64 limbs (320 bits).
Point
A point on the sect283k1 elliptic curve
Scalar
sect283k1 scalar value for use in elliptic curve operations

Enums§

PointFormat
Format of a serialized elliptic curve point

Constants§

B283K_FIELD_ELEMENT_SIZE
Size of a sect283k1 field element in bytes (283 bits -> 36 bytes)
B283K_KEM_SHARED_SECRET_KDF_OUTPUT_SIZE
Size of the KDF output for sect283k1 ECDH-KEM (matches SHA-384 output)
B283K_POINT_COMPRESSED_SIZE
Size of a compressed sect283k1 point in bytes: format byte (0x02/0x03) + x-coordinate
B283K_POINT_UNCOMPRESSED_SIZE
Size of an uncompressed sect283k1 point in bytes: format byte (0x04) + x-coordinate + y-coordinate
B283K_SCALAR_SIZE
Size of a sect283k1 scalar in bytes (283 bits -> 36 bytes)

Functions§

base_point_g
Get the standard base point G of the sect283k1 curve
generate_keypair
Generate a cryptographically secure ECDH keypair
kdf_hkdf_sha384_for_ecdh_kem
Key derivation function for ECDH shared secret using HKDF-SHA384
scalar_mult
General scalar multiplication: compute scalar * point
scalar_mult_base_g
Scalar multiplication with the base point: scalar * G