Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
cx_mldsa_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_MLDSA_SAMPLE_H
18#define CX_MLDSA_SAMPLE_H
19
20#include "cx_mldsa_poly.h"
21#include "lcx_mldsa.h"
22
31void MLDSA_SAMPLE_uniform(mldsa_poly *a, const uint8_t seed[MLDSA_SEEDBYTES], uint16_t nonce);
32
43 const uint8_t seed[MLDSA_CRHBYTES],
44 uint16_t nonce,
45 uint8_t eta);
46
57 const uint8_t seed[MLDSA_CRHBYTES],
58 uint16_t nonce,
59 int32_t gamma1);
60
69void MLDSA_SAMPLE_challenge(mldsa_poly *c, const uint8_t *seed, size_t seedlen, uint8_t tau);
70
71#endif /* CX_MLDSA_SAMPLE_H */
void MLDSA_SAMPLE_eta(mldsa_poly *a, const uint8_t seed[MLDSA_CRHBYTES], uint16_t nonce, uint8_t eta)
Sample polynomial with coefficients in [-eta, eta] from SHAKE256(seed||nonce).
void MLDSA_SAMPLE_uniform(mldsa_poly *a, const uint8_t seed[MLDSA_SEEDBYTES], uint16_t nonce)
Sample polynomial with uniformly random coefficients in [0, q-1] by performing rejection sampling on ...
void MLDSA_SAMPLE_challenge(mldsa_poly *c, const uint8_t *seed, size_t seedlen, uint8_t tau)
Sample challenge polynomial with TAU coefficients in {-1, +1}.
void MLDSA_SAMPLE_gamma1(mldsa_poly *a, const uint8_t seed[MLDSA_CRHBYTES], uint16_t nonce, int32_t gamma1)
Sample polynomial with coefficients in [-(gamma1-1), gamma1] from SHAKE256(seed||nonce).
#define MLDSA_SEEDBYTES
Definition lcx_mldsa.h:40
#define MLDSA_CRHBYTES
Definition lcx_mldsa.h:41
ML-DSA (Module-Lattice Digital Signature Algorithm) public API.
Polynomial with MLDSA_N int32_t coefficients.