Returns the security level of this key.
The bytes (a view; do not mutate).
Number of bytes.
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticfromCreate an MLKEMPublicKey from raw bytes.
The ML-KEM security level
The public key bytes
Encapsulate a new shared secret.
This creates a random shared secret and encapsulates it, returning both the shared secret (to be used as a symmetric key) and the ciphertext (to be sent to the private key holder for decapsulation).
Object containing sharedSecret and ciphertext
The reference: the digest of the tagged CBOR, as the reference computes it.
The first four bytes of reference() in hex, the reference's ref_hex_short.
The reference's Display: the type name over the short reference.
The CBOR tags this type decodes from; the first one is used to encode.
Returns the untagged CBOR encoding.
Format: [level, key_bytes]
The tagged CBOR form.
As a UR, typed by the first tag's name.
Staticfrom
MLKEMPublicKey - Post-quantum key encapsulation public key using ML-KEM.