Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
cx_mlkem_sample.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_SAMPLE_H
18#define CX_MLKEM_SAMPLE_H
19
20#include <stdint.h>
21#include "cx_errors.h"
22#include "lcx_mlkem.h"
23
30void MLKEM_SAMPLE_cbd2(poly *r, const uint8_t *buf);
31
38void MLKEM_SAMPLE_cbd3(poly *r, const uint8_t *buf);
39
48void MLKEM_SAMPLE_getnoise(poly *r, const uint8_t *seed, uint8_t nonce, uint8_t eta);
49
58void MLKEM_SAMPLE_rej_uniform(poly *r, const uint8_t *seed, uint8_t x, uint8_t y);
59#endif // CX_MLKEM_SAMPLE_H
void MLKEM_SAMPLE_cbd2(poly *r, const uint8_t *buf)
Samples a polynomial using the centered binomial distribution with eta=2.
void MLKEM_SAMPLE_getnoise(poly *r, const uint8_t *seed, uint8_t nonce, uint8_t eta)
Samples a noise polynomial using PRF and CBD.
void MLKEM_SAMPLE_cbd3(poly *r, const uint8_t *buf)
Samples a polynomial using the centered binomial distribution with eta=3.
void MLKEM_SAMPLE_rej_uniform(poly *r, const uint8_t *seed, uint8_t x, uint8_t y)
Samples a polynomial using rejection sampling from a uniform distribution.
ML-KEM (Module-Lattice Key Encapsulation Mechanism) public API.
Polynomial with MLKEM_N coefficients.