MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClRsa_Functions.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2020-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
38
39#ifndef MCUXCLRSA_FUNCTIONS_H_
40#define MCUXCLRSA_FUNCTIONS_H_
41
42#include <mcuxClConfig.h> // Exported features flags header
43#include <mcuxClSession.h>
46#include <mcuxClKey_Types.h>
47#include <mcuxClRsa_Types.h>
48#include <mcuxClBuffer.h>
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
60
140 mcuxClSession_Handle_t pSession,
141 const mcuxClRsa_Key * const pKey,
142 mcuxCl_InputBuffer_t pMessageOrDigest,
143 const uint32_t messageLength,
144 const mcuxClRsa_SignVerifyMode pPaddingMode,
145 const uint32_t saltLength,
146 const uint32_t options,
147 mcuxCl_Buffer_t pSignature
148);
149
223 mcuxClSession_Handle_t pSession,
224 const mcuxClRsa_Key * const pKey,
225 mcuxCl_InputBuffer_t pMessageOrDigest,
226 const uint32_t messageLength,
227 mcuxCl_Buffer_t pSignature,
228 const mcuxClRsa_SignVerifyMode pVerifyMode,
229 const uint32_t saltLength,
230 const uint32_t options,
231 mcuxCl_Buffer_t pOutput
232);
233
234
304 mcuxClSession_Handle_t pSession,
305 mcuxClKey_Type_t type,
306 mcuxClKey_Protection_t protection,
307 mcuxClKey_Handle_t privKey,
308 uint8_t * pPrivData,
309 uint32_t * const pPrivDataLength,
310 mcuxClKey_Handle_t pubKey,
311 uint8_t * pPubData,
312 uint32_t * const pPubDataLength
313 );
314
315
385 mcuxClSession_Handle_t pSession,
386 mcuxClKey_Type_t type,
387 mcuxClKey_Protection_t protection,
388 mcuxClKey_Handle_t privKey,
389 uint8_t * pPrivData,
390 uint32_t * const pPrivDataLength,
391 mcuxClKey_Handle_t pubKey,
392 uint8_t * pPubData,
393 uint32_t * const pPubDataLength
394 );
395
411 mcuxClSession_Handle_t pSession,
412 mcuxClKey_Type_t type,
413 uint32_t *byteLenE
414);
434 mcuxClSession_Handle_t pSession,
435 uint8_t * pPrivData,
436 uint32_t * const pPrivDataLength,
437 uint32_t byteLenPrime);
438
460 mcuxClSession_Handle_t pSession,
461 uint8_t * pPrivData,
462 uint32_t * const pPrivDataLength,
463 uint8_t * pPubData,
464 uint32_t dLen);
465
466 /* mcuxClRsa_Functions */
470
471#ifdef __cplusplus
472} /* extern "C" */
473#endif
474
475#endif /* MCUXCLRSA_FUNCTIONS_H_ */
476
Top-level include file for the mcuxClBuffer component.
Definition of function identifiers for the flow protection mechanism.
Type definitions for the mcuxClKey component.
Type definitions for the mcuxClRsa component.
Top-level include file for the mcuxClSession component.
Provides the API for the CSSL flow protection mechanism.
const uint8_t * mcuxCl_InputBuffer_t
Input buffer type.
Definition mcuxClBuffer_Pointer.h:58
uint8_t * mcuxCl_Buffer_t
Input/output buffer type.
Definition mcuxClBuffer_Pointer.h:67
const mcuxClKey_TypeDescriptor_t * mcuxClKey_Type_t
Key type handle type.
Definition mcuxClKey_Types.h:131
const mcuxClKey_ProtectionDescriptor_t * mcuxClKey_Protection_t
Key protection mechanism type.
Definition mcuxClKey_Types.h:161
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:108
mcuxClRsa_Status_t mcuxClRsa_KeyGeneration_Plain(mcuxClSession_Handle_t pSession, mcuxClKey_Type_t type, mcuxClKey_Protection_t protection, mcuxClKey_Handle_t privKey, uint8_t *pPrivData, uint32_t *const pPrivDataLength, mcuxClKey_Handle_t pubKey, uint8_t *pPubData, uint32_t *const pPubDataLength)
RSA key generation of private plain key operation.
mcuxClRsa_Status_t mcuxClRsa_KeyGeneration_StorePrivatePlain(mcuxClSession_Handle_t pSession, uint8_t *pPrivData, uint32_t *const pPrivDataLength, uint8_t *pPubData, uint32_t dLen)
Store RSA Prviate Plain key.
mcuxClRsa_Status_t mcuxClRsa_verify(mcuxClSession_Handle_t pSession, const mcuxClRsa_Key *const pKey, mcuxCl_InputBuffer_t pMessageOrDigest, const uint32_t messageLength, mcuxCl_Buffer_t pSignature, const mcuxClRsa_SignVerifyMode pVerifyMode, const uint32_t saltLength, const uint32_t options, mcuxCl_Buffer_t pOutput)
RSA verify operation.
mcuxClRsa_Status_t mcuxClRsa_KeyGeneration_StorePrivateCRT(mcuxClSession_Handle_t pSession, uint8_t *pPrivData, uint32_t *const pPrivDataLength, uint32_t byteLenPrime)
Store RSA Private CRT key.
mcuxClRsa_Status_t mcuxClRsa_KeyGeneration_Crt(mcuxClSession_Handle_t pSession, mcuxClKey_Type_t type, mcuxClKey_Protection_t protection, mcuxClKey_Handle_t privKey, uint8_t *pPrivData, uint32_t *const pPrivDataLength, mcuxClKey_Handle_t pubKey, uint8_t *pPubData, uint32_t *const pPubDataLength)
Generates an RSA key in CRT format.
mcuxClRsa_Status_t mcuxClRsa_KeyGeneration_Init(mcuxClSession_Handle_t pSession, mcuxClKey_Type_t type, uint32_t *byteLenE)
RSA key generation initialization.
mcuxClRsa_Status_t mcuxClRsa_sign(mcuxClSession_Handle_t pSession, const mcuxClRsa_Key *const pKey, mcuxCl_InputBuffer_t pMessageOrDigest, const uint32_t messageLength, const mcuxClRsa_SignVerifyMode pPaddingMode, const uint32_t saltLength, const uint32_t options, mcuxCl_Buffer_t pSignature)
RSA sign operation.
mcuxClRsa_SignVerifyMode_t * mcuxClRsa_SignVerifyMode
Pointer type to Sign/Verify mode.
Definition mcuxClRsa_Types.h:207
uint32_t mcuxClRsa_Status_t
Type for RSA status codes.
Definition mcuxClRsa_Types.h:138
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:133
#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
Structure type for Rsa key, specifying key type and key entries.
Definition mcuxClRsa_Types.h:167