mcxe247_crypto.h
Go to the documentation of this file.
1 /**
2  * @file mcxe247_crypto.h
3  * @brief NXP MCX E247 hardware cryptographic accelerator (ELA_CSEC)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.5.4
29  **/
30 
31 #ifndef _MCXE247_CRYPTO_H
32 #define _MCXE247_CRYPTO_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 
37 //Commands
38 #define CSEC_CMD_ENC_ECB 0x01000000
39 #define CSEC_CMD_ENC_CBC 0x02000000
40 #define CSEC_CMD_DEC_ECB 0x03000000
41 #define CSEC_CMD_DEC_CBC 0x04000000
42 #define CSEC_CMD_GENERATE_MAC 0x05000000
43 #define CSEC_CMD_VERIFY_MAC 0x06000000
44 #define CSEC_CMD_LOAD_KEY 0x07000000
45 #define CSEC_CMD_LOAD_PLAIN_KEY 0x08000000
46 #define CSEC_CMD_EXPORT_RAM_KEY 0x09000000
47 #define CSEC_CMD_INIT_RNG 0x0A000000
48 #define CSEC_CMD_EXTEND_SEED 0x0B000000
49 #define CSEC_CMD_RND 0x0C000000
50 #define CSEC_CMD_BOOT_FAILURE 0x0E000000
51 #define CSEC_CMD_BOOT_OK 0x0F000000
52 #define CSEC_CMD_GET_ID 0x10000000
53 #define CSEC_CMD_BOOT_DEFINE 0x11000000
54 #define CSEC_CMD_DBG_CHAL 0x12000000
55 #define CSEC_CMD_DBG_AUTH 0x13000000
56 #define CSEC_CMD_MP_COMPRESS 0x16000000
57 
58 //Function format
59 #define CSEC_FORMAT_COPY 0x00000000
60 #define CSEC_FORMAT_POINTER 0x00010000
61 
62 //Call sequence
63 #define CSEC_CALL_SEQ_FIRST 0x00000000
64 #define CSEC_CALL_SEQ_SUBSEQUENT 0x00000100
65 
66 //Key identifiers
67 #define CSEC_SECRET_KEY 0x00000000
68 #define CSEC_MASTER_ECU_KEY 0x00000001
69 #define CSEC_BOOT_MAC_KEY 0x00000002
70 #define CSEC_BOOT_MAC 0x00000003
71 #define CSEC_KEY_1 0x00000004
72 #define CSEC_KEY_2 0x00000005
73 #define CSEC_KEY_3 0x00000006
74 #define CSEC_KEY_4 0x00000007
75 #define CSEC_KEY_5 0x00000008
76 #define CSEC_KEY_6 0x00000009
77 #define CSEC_KEY_7 0x0000000A
78 #define CSEC_KEY_8 0x0000000B
79 #define CSEC_KEY_9 0x0000000C
80 #define CSEC_KEY_10 0x0000000D
81 #define CSEC_RAM_KEY 0x0000000F
82 #define CSEC_KEY_11 0x00000014
83 #define CSEC_KEY_12 0x00000015
84 #define CSEC_KEY_13 0x00000016
85 #define CSEC_KEY_14 0x00000017
86 #define CSEC_KEY_15 0x00000018
87 #define CSEC_KEY_16 0x00000019
88 #define CSEC_KEY_17 0x0000001A
89 #define CSEC_KEY_18 0x0000001B
90 #define CSEC_KEY_19 0x0000001C
91 #define CSEC_KEY_20 0x0000001D
92 #define CSEC_KEY_21 0x0000001E
93 
94 //Error codes
95 #define CSEC_ERC_NO_ERROR 0x0001
96 #define CSEC_ERC_SEQUENCE_ERROR 0x0002
97 #define CSEC_ERC_KEY_NOT_AVAILABLE 0x0004
98 #define CSEC_ERC_KEY_INVALID 0x0008
99 #define CSEC_ERC_KEY_EMPTY 0x0010
100 #define CSEC_ERC_NO_SECURE_BOOT 0x0020
101 #define CSEC_ERC_KEY_WRITE_PROTECTED 0x0040
102 #define CSEC_ERC_KEY_UPDATE_ERROR 0x0080
103 #define CSEC_ERC_RNG_SEED 0x0100
104 #define CSEC_ERC_NO_DEBUGGING 0x0200
105 #define CSEC_ERC_MEMORY_FAILURE 0x0400
106 #define CSEC_ERC_GENERAL_ERROR 0x0800
107 
108 //C++ guard
109 #ifdef __cplusplus
110 extern "C" {
111 #endif
112 
113 //Global variables
115 
116 //MCX E247 hardware cryptographic accelerator related functions
118 
119 //C++ guard
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif
error_t
Error codes.
Definition: error.h:43
General definitions for cryptographic algorithms.
Mutex object.
OsMutex mcxe247CryptoMutex
error_t mcxe247CryptoInit(void)
Initialize hardware cryptographic accelerator.