|
Embedded SDK
Embedded SDK
|
ML-KEM key encapsulation mechanism (FIPS 203). More...
#include <string.h>#include "cx_mlkem_internal.h"#include "cx_mlkem_indcpa.h"#include "cx_mlkem_util.h"#include "cx_utils.h"#include "lcx_rng.h"
Go to the source code of this file.
Functions | |
| cx_err_t | MLKEM_crypto_kem_keypair (uint8_t *pk, size_t pk_len, uint8_t *sk, size_t sk_len, MLKEM_param_t param) |
| Generates an ML-KEM key pair. | |
| cx_err_t | MLKEM_crypto_kem_enc (uint8_t *ct, size_t ct_len, uint8_t *ss, size_t ss_len, const uint8_t *pk, size_t pk_len, MLKEM_param_t param) |
| ML-KEM encapsulation. | |
| cx_err_t | MLKEM_crypto_kem_dec (uint8_t *ss, size_t ss_len, const uint8_t *ct, size_t ct_len, const uint8_t *sk, size_t sk_len, MLKEM_param_t param) |
| ML-KEM decapsulation. | |
ML-KEM key encapsulation mechanism (FIPS 203).
Implements the top-level ML-KEM key generation, encapsulation, and decapsulation routines, including both randomized and derandomized variants.
Definition in file cx_mlkem.c.
| cx_err_t MLKEM_crypto_kem_dec | ( | uint8_t * | ss, |
| size_t | ss_len, | ||
| const uint8_t * | ct, | ||
| size_t | ct_len, | ||
| const uint8_t * | sk, | ||
| size_t | sk_len, | ||
| MLKEM_param_t | param | ||
| ) |
ML-KEM decapsulation.
Recovers the shared secret from a ciphertext and a secret key.
| [out] | ss | Shared secret output buffer. |
| [in] | ss_len | Size of the shared secret buffer in bytes. |
| [in] | ct | Ciphertext. |
| [in] | ct_len | Size of the ciphertext in bytes. |
| [in] | sk | Secret key. |
| [in] | sk_len | Size of the secret key in bytes. |
| [in] | param | ML-KEM parameter set selector. |
Definition at line 88 of file cx_mlkem.c.
| cx_err_t MLKEM_crypto_kem_enc | ( | uint8_t * | ct, |
| size_t | ct_len, | ||
| uint8_t * | ss, | ||
| size_t | ss_len, | ||
| const uint8_t * | pk, | ||
| size_t | pk_len, | ||
| MLKEM_param_t | param | ||
| ) |
ML-KEM encapsulation.
Produces a ciphertext and a shared secret from a public key using internal randomness.
| [out] | ct | Ciphertext output buffer. |
| [in] | ct_len | Size of the ciphertext buffer in bytes. |
| [out] | ss | Shared secret output buffer. |
| [in] | ss_len | Size of the shared secret buffer in bytes. |
| [in] | pk | Public key. |
| [in] | pk_len | Size of the public key in bytes. |
| [in] | param | ML-KEM parameter set selector. |
Definition at line 59 of file cx_mlkem.c.
| cx_err_t MLKEM_crypto_kem_keypair | ( | uint8_t * | pk, |
| size_t | pk_len, | ||
| uint8_t * | sk, | ||
| size_t | sk_len, | ||
| MLKEM_param_t | param | ||
| ) |
Generates an ML-KEM key pair.
Uses internal randomness to produce the key pair.
| [out] | pk | Public key output buffer. |
| [in] | pk_len | Size of the public key buffer in bytes. |
| [out] | sk | Secret key output buffer. |
| [in] | sk_len | Size of the secret key buffer in bytes. |
| [in] | param | ML-KEM parameter set selector. |
Definition at line 32 of file cx_mlkem.c.