Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
cx_mlkem_indcpa.h
Go to the documentation of this file.
1/*****************************************************************************
2 * (c) 2026 Ledger SAS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#ifndef CX_MLKEM_INDCPA_H
18#define CX_MLKEM_INDCPA_H
19
20#include <stdint.h>
21#include "cx_errors.h"
22#include "lcx_mlkem.h"
23
36cx_err_t MLKEM_INDCPA_keypair_derand(uint8_t *pk,
37 size_t pk_len,
38 uint8_t *sk,
39 size_t sk_len,
40 const uint8_t *coins,
41 const MLKEM_param_info_t *p);
42
43cx_err_t MLKEM_INDCPA_enc(uint8_t *c,
44 size_t c_len,
45 const uint8_t *m,
46 size_t m_len,
47 const uint8_t *pk,
48 size_t pk_len,
49 const uint8_t coins[2 * MLKEM_SYMBYTES],
50 const MLKEM_param_info_t *p);
51
52cx_err_t MLKEM_INDCPA_dec(uint8_t *m,
53 size_t m_len,
54 const uint8_t *c,
55 size_t c_len,
56 const uint8_t *sk,
57 size_t sk_len,
58 const MLKEM_param_info_t *p);
59
60#endif // CX_MLKEM_INDCPA_H
cx_err_t MLKEM_INDCPA_keypair_derand(uint8_t *pk, size_t pk_len, uint8_t *sk, size_t sk_len, const uint8_t *coins, const MLKEM_param_info_t *p)
Generates an IND-CPA key pair deterministically.
cx_err_t MLKEM_INDCPA_enc(uint8_t *c, size_t c_len, const uint8_t *m, size_t m_len, const uint8_t *pk, size_t pk_len, const uint8_t coins[2 *MLKEM_SYMBYTES], const MLKEM_param_info_t *p)
cx_err_t MLKEM_INDCPA_dec(uint8_t *m, size_t m_len, const uint8_t *c, size_t c_len, const uint8_t *sk, size_t sk_len, const MLKEM_param_info_t *p)
#define MLKEM_SYMBYTES
Definition lcx_mlkem.h:38
ML-KEM (Module-Lattice Key Encapsulation Mechanism) public API.
ML-KEM parameter set descriptor holding all derived sizes.
Definition lcx_mlkem.h:168