Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
cx_mldsa_util.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#ifndef CX_MLDSA_UTIL_H
17#define CX_MLDSA_UTIL_H
18
19#include <stdint.h>
20#include <stddef.h>
21#include "lcx_sha3.h"
22
26void MLDSA_UTIL_shake256(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen);
27
31void MLDSA_UTIL_shake128(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen);
32
36void MLDSA_UTIL_shake256_two(uint8_t *out,
37 size_t outlen,
38 const uint8_t *in1,
39 size_t in1len,
40 const uint8_t *in2,
41 size_t in2len);
42
46void MLDSA_UTIL_shake256_three(uint8_t *out,
47 size_t outlen,
48 const uint8_t *in1,
49 size_t in1len,
50 const uint8_t *in2,
51 size_t in2len,
52 const uint8_t *in3,
53 size_t in3len);
54
58void MLDSA_UTIL_shake128_seed_nonce(uint8_t *out,
59 size_t outlen,
60 const uint8_t *seed,
61 size_t seedlen,
62 uint16_t nonce);
63
67void MLDSA_UTIL_shake256_seed_nonce(uint8_t *out,
68 size_t outlen,
69 const uint8_t *seed,
70 size_t seedlen,
71 uint16_t nonce);
72
73#endif /* CX_MLDSA_UTIL_H */
void MLDSA_UTIL_shake256(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen)
SHAKE256 hash wrapper.
void MLDSA_UTIL_shake128(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen)
SHAKE128 hash wrapper.
void MLDSA_UTIL_shake256_seed_nonce(uint8_t *out, size_t outlen, const uint8_t *seed, size_t seedlen, uint16_t nonce)
SHAKE256 with seed || uint16_t nonce.
void MLDSA_UTIL_shake128_seed_nonce(uint8_t *out, size_t outlen, const uint8_t *seed, size_t seedlen, uint16_t nonce)
SHAKE128 with seed || uint16_t nonce.
void MLDSA_UTIL_shake256_three(uint8_t *out, size_t outlen, const uint8_t *in1, size_t in1len, const uint8_t *in2, size_t in2len, const uint8_t *in3, size_t in3len)
SHAKE256 with three inputs concatenated.
void MLDSA_UTIL_shake256_two(uint8_t *out, size_t outlen, const uint8_t *in1, size_t in1len, const uint8_t *in2, size_t in2len)
SHAKE256 with two inputs concatenated.
SHA-3 (Secure Hash Algorithm 3)