mcxn547_crypto_pkc.h
Go to the documentation of this file.
1 /**
2  * @file mcxn547_crypto_pkc.h
3  * @brief NXP MCX N547 public-key hardware accelerator (PKA)
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 _MCXN547_CRYPTO_PKC_H
32 #define _MCXN547_CRYPTO_PKC_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 #include <mcuxClEcc.h>
37 
38 //Public-key hardware accelerator
39 #ifndef MCXN547_CRYPTO_PKC_SUPPORT
40  #define MCXN547_CRYPTO_PKC_SUPPORT DISABLED
41 #elif (MCXN547_CRYPTO_PKC_SUPPORT != ENABLED && MCXN547_CRYPTO_PKC_SUPPORT != DISABLED)
42  #error MCXN547_CRYPTO_PKC_SUPPORT parameter is not valid
43 #endif
44 
45 //C++ guard
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 
51 /**
52  * @brief RSA primitive arguments
53  **/
54 
55 typedef struct
56 {
57  uint8_t n[512];
58  uint8_t e[512];
59  uint8_t d[512];
60  uint8_t p[512];
61  uint8_t q[512];
62  uint8_t dp[512];
63  uint8_t dq[512];
64  uint8_t qinv[512];
65  uint8_t m[512];
66  uint8_t c[512];
67 } ElsRsaArgs;
68 
69 
70 /**
71  * @brief ELS ECC primitive arguments
72  **/
73 
74 typedef struct
75 {
76  uint8_t p[66];
77  uint8_t a[66];
78  uint8_t b[66];
79  uint8_t g[132];
80  uint8_t q[66];
81  uint8_t d[66];
82  uint8_t input[132];
83  uint8_t output[132];
84 } ElsEccArgs;
85 
86 
87 /**
88  * @brief ELS ECDSA primitive arguments
89  **/
90 
91 typedef struct
92 {
93  uint8_t p[66];
94  uint8_t a[66];
95  uint8_t b[66];
96  uint8_t g[132];
97  uint8_t q[66];
98  uint8_t privateKey[66];
99  uint8_t publicKey[132];
100  uint8_t signature[132];
101  uint8_t r[66];
102 } ElsEcdsaArgs;
103 
104 
105 /**
106  * @brief ELS MontDH primitive arguments
107  **/
108 
109 typedef struct
110 {
111  uint32_t privKeyDesc[MCUXCLKEY_DESCRIPTOR_SIZE_IN_WORDS];
112  uint32_t pubKeyDesc[MCUXCLKEY_DESCRIPTOR_SIZE_IN_WORDS];
113  uint8_t sharedSecret[MCUXCLECC_MONTDH_CURVE448_SIZE_SHAREDSECRET];
114 } ElsMontDhArgs;
115 
116 
117 /**
118  * @brief ELS EdDSA primitive arguments
119  **/
120 
121 typedef struct
122 {
123  uint32_t privKeyDesc[MCUXCLKEY_DESCRIPTOR_SIZE_IN_WORDS];
124  uint8_t privKeyData[MCUXCLECC_EDDSA_ED25519_SIZE_PRIVATEKEYDATA];
125  uint32_t pubKeyDesc[MCUXCLKEY_DESCRIPTOR_SIZE_IN_WORDS];
126  uint8_t pubKeyData[MCUXCLECC_EDDSA_ED25519_SIZE_PUBLICKEY];
127  uint32_t keyPairDesc[MCUXCLECC_EDDSA_GENERATEKEYPAIR_DESCRIPTOR_SIZE_IN_WORDS];
128  uint32_t protocolDesc[MCUXCLECC_EDDSA_ED25519_SIGNATURE_PROTOCOL_DESCRIPTOR_SIZE_IN_WORD(256)];
129  uint8_t signature[MCUXCLECC_EDDSA_ED25519_SIZE_SIGNATURE];
130 } ElsEddsaArgs;
131 
132 
133 //C++ guard
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif
ELS ECC primitive arguments.
uint8_t b
Definition: nbns_common.h:122
uint8_t a
Definition: ndp.h:411
uint8_t p
Definition: ndp.h:300
uint8_t r
Definition: ndp.h:346
ELS MontDH primitive arguments.
ELS ECDSA primitive arguments.
ELS EdDSA primitive arguments.
General definitions for cryptographic algorithms.
uint8_t m
Definition: ndp.h:304
uint8_t n
RSA primitive arguments.
uint8_t c
Definition: ndp.h:514