Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
cx_mldsa_smallpoly.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 *****************************************************************************/
26#ifndef CX_MLDSA_SMALLPOLY_H
27#define CX_MLDSA_SMALLPOLY_H
28
29#ifdef HAVE_MLDSA_OPTIMIZATION
30
31#include <stdint.h>
32#include "lcx_mldsa.h"
33#include "cx_mldsa_poly.h"
34
36#define MLDSA_SMALL_Q 3329
38#define MLDSA_SMALL_QINV (-3327)
39
46typedef struct {
47 int16_t coeffs[MLDSA_N];
48} mldsa_smallpoly;
49
55void MLDSA_SMALLPOLY_ntt(int16_t r[MLDSA_N]);
56
62void MLDSA_SMALLPOLY_invntt_tomont(int16_t r[MLDSA_N]);
63
73void MLDSA_SMALLPOLY_ntt_copy(mldsa_smallpoly *out, const mldsa_poly *in);
74
85void MLDSA_SMALLPOLY_basemul_invntt(mldsa_poly *r,
86 const mldsa_smallpoly *a,
87 const mldsa_smallpoly *b);
88
96void MLDSA_SMALLPOLY_unpack_eta(mldsa_smallpoly *r, const uint8_t *a, uint8_t eta);
97
98#endif /* HAVE_MLDSA_OPTIMIZATION */
99#endif /* CX_MLDSA_SMALLPOLY_H */
#define MLDSA_N
Definition lcx_mldsa.h:37
ML-DSA (Module-Lattice Digital Signature Algorithm) public API.
Polynomial with MLDSA_N int32_t coefficients.