MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClRsa_ModeConstructors.h
1/*--------------------------------------------------------------------------*/
2/* Copyright 2022-2024 NXP */
3/* */
4/* SPDX-License-Identifier: BSD-3-Clause */
5/* */
6/* Redistribution and use in source and binary forms, with or without */
7/* modification, are permitted provided that the following conditions are */
8/* met: */
9/* */
10/* 1. Redistributions of source code must retain the above copyright */
11/* notice, this list of conditions and the following disclaimer. */
12/* */
13/* 2. Redistributions in binary form must reproduce the above copyright */
14/* notice, this list of conditions and the following disclaimer in the */
15/* documentation and/or other materials provided with the distribution. */
16/* */
17/* 3. Neither the name of the copyright holder nor the names of its */
18/* contributors may be used to endorse or promote products derived from */
19/* this software without specific prior written permission. */
20/* */
21/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS */
22/* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED */
23/* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A */
24/* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
25/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
26/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
27/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR */
28/* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
29/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
30/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
31/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
32/*--------------------------------------------------------------------------*/
33
34#ifndef MCUXCLRSA_MODECONSTRUCTORS_H_
35#define MCUXCLRSA_MODECONSTRUCTORS_H_
36
37#include <mcuxClConfig.h> // Exported features flags header
39
40
41#if defined(MCUXCL_FEATURE_CIPHER_RSA_ENCRYPT) || defined(MCUXCL_FEATURE_CIPHER_RSA_DECRYPT)
42#include <mcuxClCipher_Types.h>
43#endif /* defined(MCUXCL_FEATURE_CIPHER_RSA_ENCRYPT) || defined(MCUXCL_FEATURE_CIPHER_RSA_DECRYPT) */
44
45#include <mcuxClKey_Types.h>
46#include <mcuxClHash_Types.h>
47#include <mcuxClBuffer.h>
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53/**********************************************************/
54/* Descriptors of mcuxClRsa APIs */
55/**********************************************************/
62
63#if defined(MCUXCL_FEATURE_CIPHER_RSA_ENCRYPT) || defined(MCUXCL_FEATURE_CIPHER_RSA_DECRYPT)
70
71#ifdef MCUXCL_FEATURE_RSA_RSAES_OAEP
80MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_CipherModeConstructor_RSAES_OAEP_Encrypt)
81void mcuxClRsa_CipherModeConstructor_RSAES_OAEP_Encrypt(
83 mcuxClHash_Algo_t hashAlgorithm
84);
85
94MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_CipherModeConstructor_RSAES_OAEP_Decrypt)
95void mcuxClRsa_CipherModeConstructor_RSAES_OAEP_Decrypt(
97 mcuxClHash_Algo_t hashAlgorithm
98);
99
100#endif /* MCUXCL_FEATURE_RSA_RSAES_OAEP */
101
102#ifdef MCUXCL_FEATURE_RSA_RSAES_PKCS1v15
110MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_CipherModeConstructor_RSAES_PKCS1_v1_5_Encrypt)
111void mcuxClRsa_CipherModeConstructor_RSAES_PKCS1_v1_5_Encrypt(
113);
114
122MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_CipherModeConstructor_RSAES_PKCS1_v1_5_Decrypt)
123void mcuxClRsa_CipherModeConstructor_RSAES_PKCS1_v1_5_Decrypt(
125);
126
127#endif /* MCUXCL_FEATURE_RSA_RSAES_PKCS1v15 */
128
130#endif /* defined(MCUXCL_FEATURE_CIPHER_RSA_ENCRYPT) || defined(MCUXCL_FEATURE_CIPHER_RSA_DECRYPT) */
131
133
145MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_Public_KeyType_ModeConstructor)
146MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClRsa_Status_t) mcuxClRsa_Public_KeyType_ModeConstructor(
148 mcuxClKey_Size_t keySize
149);
151
163MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_PrivatePlain_KeyType_ModeConstructor)
164MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClRsa_Status_t) mcuxClRsa_PrivatePlain_KeyType_ModeConstructor(
166 mcuxClKey_Size_t keySize
167);
169
181MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_PrivateCRT_KeyType_ModeConstructor)
182MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClRsa_Status_t) mcuxClRsa_PrivateCRT_KeyType_ModeConstructor(
184 mcuxClKey_Size_t keySize
185);
187
199MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_PrivateCRT_DFA_KeyType_ModeConstructor)
200MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClRsa_Status_t) mcuxClRsa_PrivateCRT_DFA_KeyType_ModeConstructor(
202 mcuxClKey_Size_t keySize
203);
205
206#ifdef __cplusplus
207} /* extern "C" */
208#endif
209
210#endif /* MCUXCLRSA_MODECONSTRUCTORS_H_ */
Top-level include file for the mcuxClBuffer component.
Type definitions for the mcuxClCipher component.
Type definitions for the mcuxClHash component.
Type definitions for the mcuxClKey component.
Provides the API for the CSSL flow protection mechanism.
struct mcuxClCipher_ModeDescriptor mcuxClCipher_ModeDescriptor_t
Cipher mode/algorithm descriptor type.
Definition mcuxClCipher_Types.h:74
const mcuxClHash_AlgorithmDescriptor_t *const mcuxClHash_Algo_t
Hash mode/algorithm type.
Definition mcuxClHash_Types.h:70
uint32_t mcuxClKey_Size_t
Type for algorithm based key size.
Definition mcuxClKey_Types.h:77
struct mcuxClKey_TypeDescriptor mcuxClKey_TypeDescriptor_t
Key type descriptor type.
Definition mcuxClKey_Types.h:124
uint32_t mcuxClRsa_Status_t
Type for RSA status codes.
Definition mcuxClRsa_Types.h:138
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:145
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:101