core/crypto/mlkem

mlkem

Types

3

Parameters

Parameters :: enum int { Invalid = 0, ML_KEM_512 = 1, ML_KEM_768 = 2, ML_KEM_1024 = 3, }Source

Parameters are the supported ML-KEM parameter sets.

Constants

2

Variables

3

Procedures

15

decaps

decaps :: proc(dk: ^Decapsulation_Key, ciphertext: []u8, shared_secret: []u8) -> (bool)Source

decaps uses the decapsulation key to generate a shared secret from a ciphertext. Due to ML-KEM's implicit rejection mechanism, this function will only return false if and only if (⟺) the lengths of the inputs are invalid or the decapsulation key is uninitialized.

This routine returning true does not guarantee that the shared secret matches that generated by the peer.

encaps_ek

encaps_ek :: proc(ek: ^Encapsulation_Key, shared_secret: []u8, ciphertext: []u8) -> (bool)Source

encaps_ek uses the encapsulation key to generate a shared secret and an associated ciphertext. This routine will fail if the system entropy source is unavailable.

encaps_ek_raw_bytes

encaps_ek_raw_bytes :: proc(params: Parameters, raw_ek: []u8, shared_secret: []u8, ciphertext: []u8) -> (bool)Source

encaps_raw_ek_bytes uses the byte encoded encapsulation key to generate a shared secret and an associated ciphertext. This routine will fail if the system entropy source is unavailable, or of the encapsulation key is invalid.

key_size

key_size :: proc(k: ^T) -> (int)Source

key_size returns the key size of a Decapsulation_Key or Encapsulation_Key in bytes.

Procedure Groups

1

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.