Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Functions
cx_mlkem_internal.h File Reference

Internal ML-KEM deterministic routines (not part of the public API). More...

#include <stdint.h>
#include "cx_errors.h"
#include "lcx_mlkem.h"
Include dependency graph for cx_mlkem_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

cx_err_t MLKEM_crypto_kem_keypair_derand (uint8_t *pk, size_t pk_len, uint8_t *sk, size_t sk_len, const uint8_t coins[2 *MLKEM_SYMBYTES], MLKEM_param_t param)
 Deterministic ML-KEM key pair generation.
 
cx_err_t MLKEM_crypto_kem_enc_derand (uint8_t *ct, size_t ct_len, uint8_t *ss, size_t ss_len, const uint8_t *pk, size_t pk_len, const uint8_t coins[2 *MLKEM_SYMBYTES], MLKEM_param_t param)
 Deterministic ML-KEM encapsulation.
 

Detailed Description

Internal ML-KEM deterministic routines (not part of the public API).

These functions are exposed only for internal testing. They must NOT be declared in lcx_mlkem.h.

Definition in file cx_mlkem_internal.h.

Function Documentation

◆ MLKEM_crypto_kem_enc_derand()

cx_err_t MLKEM_crypto_kem_enc_derand ( uint8_t *  ct,
size_t  ct_len,
uint8_t *  ss,
size_t  ss_len,
const uint8_t *  pk,
size_t  pk_len,
const uint8_t  coins[2 *MLKEM_SYMBYTES],
MLKEM_param_t  param 
)

Deterministic ML-KEM encapsulation.

Produces a ciphertext and a shared secret from a public key using caller-supplied random coins.

Parameters
[out]ctCiphertext output buffer.
[in]ct_lenSize of the ciphertext buffer in bytes.
[out]ssShared secret output buffer.
[in]ss_lenSize of the shared secret buffer in bytes.
[in]pkPublic key.
[in]pk_lenSize of the public key in bytes.
[in]coinsRandom coins of 2 * MLKEM_SYMBYTES bytes.
[in]paramML-KEM parameter set selector.
Returns
CX_OK on success, error code otherwise.

Definition at line 77 of file cx_mlkem_internal.c.

◆ MLKEM_crypto_kem_keypair_derand()

cx_err_t MLKEM_crypto_kem_keypair_derand ( uint8_t *  pk,
size_t  pk_len,
uint8_t *  sk,
size_t  sk_len,
const uint8_t  coins[2 *MLKEM_SYMBYTES],
MLKEM_param_t  param 
)

Deterministic ML-KEM key pair generation.

Generates a key pair from caller-supplied random coins.

Parameters
[out]pkPublic key output buffer.
[in]pk_lenSize of the public key buffer in bytes.
[out]skSecret key output buffer.
[in]sk_lenSize of the secret key buffer in bytes.
[in]coinsRandom coins of 2 * MLKEM_SYMBYTES bytes.
[in]paramML-KEM parameter set selector.
Returns
CX_OK on success, error code otherwise.

Definition at line 31 of file cx_mlkem_internal.c.