Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
cx_ram.h
Go to the documentation of this file.
1
2/*******************************************************************************
3 * Ledger Nano S - Secure firmware
4 * (c) 2022 Ledger
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 ********************************************************************************/
18
19#ifndef CX_RAM_H
20#define CX_RAM_H
21
22#include "lcx_hash.h"
23#include "cx_pbkdf2.h"
24#include "lcx_ecfp.h"
25#include "lcx_rng.h"
26#include "lcx_hmac.h"
27#include "cx_blake2b.h"
28#include "cx_groestl.h"
29#include "cx_rsa.h"
30#include "lcx_sha3.h"
31#include "lcx_sha256.h"
32#include "lcx_sha512.h"
33#include "lcx_ripemd160.h"
34#include "lcx_blake3.h"
35#include "lcx_poly1305.h"
36#include "lcx_chacha.h"
37#include "lcx_cipher.h"
38
40union cx_u {
41/* PBKDF internal hash */
42#ifdef HAVE_PBKDF2
43 cx_pbkdf2_t pbkdf2;
44#endif
45
46 /* RSA internal PKCS1 */
47#ifdef HAVE_RSA
48 cx_pkcs1_t pkcs1;
49#endif
50
51/* hash & hmac */
52#ifdef HAVE_HASH
53 cx_hash_t hash_ctx;
54
55#if defined(HAVE_SHA256) || defined(HAVE_SHA224)
56 cx_sha256_t sha256;
57#endif
58
59#if defined(HAVE_SHA512) || defined(HAVE_SHA384)
60 cx_sha512_t sha512;
61#endif
62
63#if defined(HAVE_SHA3)
64 cx_sha3_t sha3;
65#endif
66
67#if defined(HAVE_BLAKE2)
68 cx_xblake_t blake;
69#endif
70
71#if defined(HAVE_GROESTL)
72 cx_xgroestl_t groestl;
73#endif
74
75#if defined(HAVE_RIPEMD160)
76 cx_ripemd160_t ripemd160;
77#endif // HAVE_RIPEMD160
78#endif
79
80#if defined(HAVE_BLAKE3)
81 cx_blake3_t blake3;
82#endif // HAVE_BLAKE3
83
84#ifdef HAVE_HMAC
85 cx_hmac_t hmac;
86
87#if defined(HAVE_HMAC) && (defined(HAVE_SHA512) || defined(HAVE_SHA384))
88 cx_hmac_sha512_t hmac_sha512;
89#endif
90
91#if defined(HAVE_HMAC) && (defined(HAVE_SHA256) || defined(HAVE_SHA224))
92 cx_hmac_sha256_t hmac_sha256;
93#endif
94#endif
95
96#ifdef HAVE_RNG_RFC6979
97 cx_rnd_rfc6979_ctx_t rfc6979;
98#endif
99
100#ifdef HAVE_POLY1305
101 cx_poly1305_context_t poly1305;
102#endif // HAVE_POLY1305
103
104#ifdef HAVE_CHACHA
105 cx_chacha_context_t chacha;
106#endif // HAVE_CHACHA
108
109#ifdef HAVE_CMAC
110 cx_cmac_context_t cmac;
111#endif // HAVE_CMAC
112};
113extern union cx_u G_cx;
114
115#endif
union cx_u G_cx
Definition cx_ram.c:21
BLAKE3 hash function.
Chacha cipher.
API for block ciphers.
Key pair generation based on elliptic curves.
Hash functions.
HMAC (Keyed-Hash Message Authentication Code)
POLY1305 Message Authentication Code.
RIPEMD-160 hash function.
Random Number Generation.
SHA-2 (Secure Hash Algorithm 2)
SHA-3 (Secure Hash Algorithm 3)
SHA-2 (Secure Hash Algorithm 2)
Definition cx_ram.h:40
cx_cipher_context_t cipher
Definition cx_ram.h:107