MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClRsa_ModeConstructors.h
1/*--------------------------------------------------------------------------*/
2/* Copyright 2022-2026 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#include <mcuxClSignature_Types.h>
41
42#if defined(MCUXCL_FEATURE_CIPHER_RSA_ENCRYPT) || defined(MCUXCL_FEATURE_CIPHER_RSA_DECRYPT)
43#include <mcuxClCipher_Types.h>
44#endif /* defined(MCUXCL_FEATURE_CIPHER_RSA_ENCRYPT) || defined(MCUXCL_FEATURE_CIPHER_RSA_DECRYPT) */
45
46#include <mcuxClKey_Types.h>
47#include <mcuxClHash_Types.h>
48#include <mcuxClBuffer.h>
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
54/**********************************************************/
55/* Descriptors of mcuxClRsa APIs */
56/**********************************************************/
69
76struct mcuxClRsa_Signature_ProtocolDescriptor;
77typedef struct mcuxClRsa_Signature_ProtocolDescriptor mcuxClRsa_SignatureProtocolDescriptor_t;
78
96 mcuxClSignature_ModeDescriptor_t * pSignatureMode,
97 mcuxClRsa_SignatureProtocolDescriptor_t * pProtocolDescriptor,
98 mcuxClHash_Algo_t hashAlgorithm,
99 uint32_t saltLength,
100 uint32_t options
101);
102
116 mcuxClSignature_ModeDescriptor_t * pSignatureMode,
117 mcuxClRsa_SignatureProtocolDescriptor_t * pProtocolDescriptor,
118 mcuxClHash_Algo_t hashAlgorithm,
119 uint32_t options
120);
121
122
124
125#if defined(MCUXCL_FEATURE_CIPHER_RSA_ENCRYPT) || defined(MCUXCL_FEATURE_CIPHER_RSA_DECRYPT)
132
133#ifdef MCUXCL_FEATURE_RSA_RSAES_OAEP
147MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_CipherModeConstructor_RSAES_OAEP)
148MCUX_CSSL_FP_PROTECTED_TYPE (void) mcuxClRsa_CipherModeConstructor_RSAES_OAEP(
149 mcuxClCipher_ModeDescriptor_t * pCipherMode,
150 mcuxClHash_Algo_t hashAlgorithm
151);
152#endif /* MCUXCL_FEATURE_RSA_RSAES_OAEP */
153
166MCUX_CSSL_FP_FUNCTION_DECL(mcuxClRsa_CipherModeConstructor_RSAES_PKCS1_v1_5)
167MCUX_CSSL_FP_PROTECTED_TYPE (void) mcuxClRsa_CipherModeConstructor_RSAES_PKCS1_v1_5(
169);
170
171
173#endif /* defined(MCUXCL_FEATURE_CIPHER_RSA_ENCRYPT) || defined(MCUXCL_FEATURE_CIPHER_RSA_DECRYPT) */
174
183
184MCUX_CSSL_ANALYSIS_START_PATTERN_URL_IN_COMMENTS()
258MCUX_CSSL_ANALYSIS_STOP_PATTERN_URL_IN_COMMENTS()
262 const uint8_t * pE,
263 uint32_t eLength
264);
267
268#ifdef __cplusplus
269} /* extern "C" */
270#endif
271
272#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
struct mcuxClKey_GenerationDescriptor mcuxClKey_GenerationDescriptor_t
Key generation descriptor type.
Definition mcuxClKey_Types.h:239
void mcuxClRsa_SignatureModeConstructor_RSASSA_PSS(mcuxClSignature_ModeDescriptor_t *pSignatureMode, mcuxClRsa_SignatureProtocolDescriptor_t *pProtocolDescriptor, mcuxClHash_Algo_t hashAlgorithm, uint32_t saltLength, uint32_t options)
Mode constructor for RSASSA-PSS signature generation and verification.
void mcuxClRsa_SignatureModeConstructor_RSASSA_PKCS1_v1_5(mcuxClSignature_ModeDescriptor_t *pSignatureMode, mcuxClRsa_SignatureProtocolDescriptor_t *pProtocolDescriptor, mcuxClHash_Algo_t hashAlgorithm, uint32_t options)
Mode constructor for RSASSA-PKCS1-v1_5 signature generation and verification.
void mcuxClRsa_KeyGeneration_ModeConstructor(mcuxClKey_GenerationDescriptor_t *pKeyGenMode, const uint8_t *pE, uint32_t eLength)
Mode constructor for RSA key generation algorithm.
struct mcuxClSignature_ModeDescriptor mcuxClSignature_ModeDescriptor_t
Signature mode/algorithm descriptor type.
Definition mcuxClSignature_Types.h:65
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:186
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:158