package hpke

  1. Overview
  2. Docs

Module Hpke.Public_keySource

Sourcetype t

A validated public key tagged with its KEM.

Sourceval of_bytes : kem:Kem.id -> string -> (t, Error.t) result

Parse an exact-length canonical encoding. NIST keys must use uncompressed SEC1 form. X25519 and X448 low-order rejection occurs when the key is used. An ML-KEM encapsulation key must pass the modulus check of FIPS 203, Section 7.2: every coefficient reduced. Parsing one expands its public matrix, so parse a key once for everything sealed to it.

Sourceval to_bytes : t -> string
Sourceval kem : t -> Kem.id