MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClOsccaSm2_Functions.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2022-2023 NXP */
3/* */
4/* NXP Proprietary. This software is owned or controlled by NXP and may */
5/* only be used strictly in accordance with the applicable license terms. */
6/* By expressly accepting such terms or by downloading, installing, */
7/* activating and/or otherwise using the software, you are agreeing that */
8/* you have read, and that you agree to comply with and are bound by, such */
9/* license terms. If you do not agree to be bound by the applicable */
10/* license terms, then you may not retain, install, activate or otherwise */
11/* use the software. */
12/*--------------------------------------------------------------------------*/
13
20#ifndef MCUXCLOSCCASM2_FUNCTIONS_H_
21#define MCUXCLOSCCASM2_FUNCTIONS_H_
22
23
24#include <stdint.h>
25#include <mcuxClConfig.h> // Exported features flags header
26#include <mcuxClCore_Platform.h>
27#include <mcuxClBuffer.h>
28#include <mcuxClKey_Types.h>
29#include <mcuxClSession.h>
31#include <mcuxClKey_Types.h>
32#ifdef MCUXCL_FEATURE_SM2_CIPHER
33#include <mcuxClCipher_Types.h>
34#endif /* MCUXCL_FEATURE_SM2_CIPHER */
37
38#ifdef __cplusplus
39extern "C"
40{
41#endif
42
43/**********************************************************/
44/* Public APIs of mcuxClOsccaSm2 */
45/**********************************************************/
46#ifdef MCUXCL_FEATURE_SM2_INTERNAL
47
48#ifdef MCUXCL_FEATURE_SM2_KEYGEN
49
67MCUX_CSSL_FP_FUNCTION_DECL(mcuxClOsccaSm2_GenerateKeyPair, mcuxClKey_KeyGenFct_t)
68MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClKey_Status_t) mcuxClOsccaSm2_GenerateKeyPair(
70 mcuxClKey_Generation_t generation,
71 mcuxClKey_Handle_t privKey,
73);
74
75#endif /* MCUXCL_FEATURE_SM2_KEYGEN */
76
77#ifdef MCUXCL_FEATURE_SM2_CIPHER
78
79MCUX_CSSL_FP_FUNCTION_DECL(mcuxClOsccaSm2_Cipher_SkeletonSM2, mcuxClCipher_CryptFunc_t)
80MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClCipher_Status_t) mcuxClOsccaSm2_Cipher_SkeletonSM2(
82 mcuxClCipher_Context_t * const pContext,
86 uint32_t ivLength,
88 uint32_t inLength,
89 mcuxCl_Buffer_t pOut,
90 uint32_t * const pOutLength,
91 uint32_t steps
92);
93
94#endif /* MCUXCL_FEATURE_SM2_CIPHER */
95
96#ifdef MCUXCL_FEATURE_SM2_KEYAGREEMENT
97MCUX_CSSL_FP_FUNCTION_DECL(mcuxClOsccaSm2_key_agreement, mcuxClKey_AgreementFct_t)
98MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClKey_Status_t) mcuxClOsccaSm2_key_agreement(
100 mcuxClKey_Agreement_t agreement,
102 mcuxClKey_Handle_t otherKey,
103 mcuxClKey_Agreement_AdditionalInput_t additionalInputs[],
104 uint32_t numberOfInputs,
105 uint8_t * pOut,
106 uint32_t * const pOutLength
107);
108
109MCUX_CSSL_FP_FUNCTION_DECL(mcuxClOsccaSm2_KeyAgreement_SelfTest, mcuxClKey_Agreement_SelfTestFct_t)
110MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClKey_Status_t) mcuxClOsccaSm2_KeyAgreement_SelfTest(
112 mcuxClKey_Agreement_t agreement
113);
114#endif /* MCUXCL_FEATURE_SM2_KEYAGREEMENT */
115#endif /* MCUXCL_FEATURE_SM2_INTERNAL */
116
117MCUX_CSSL_FP_FUNCTION_DECL(mcuxClOsccaSm2_Signature_PreHash)
118MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClOsccaSm2_Status_t) mcuxClOsccaSm2_Signature_PreHash(
121 mcuxCl_InputBuffer_t pIdentifier,
122 uint16_t identifierSize,
123 mcuxCl_Buffer_t pPrehash,
124 uint32_t * const prehashSize
125);
126 /* mcuxClOsccaSm2_Functions */
130
131#ifdef __cplusplus
132} /* extern "C" */
133#endif
134
135#endif /* MCUXCLOSCCASM2_FUNCTIONS_H_ */
Provides the API for the CL buffer types.
Type definitions for the mcuxClCipher component.
Type definitions for the mcuxClKey component.
Type definitions of mcuxClOsccaSm2 component.
Definition of function identifiers for the flow protection mechanism.
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:46
uint8_t * mcuxCl_Buffer_t
Input/output buffer type.
Definition mcuxClBuffer_Pointer.h:55
struct mcuxClCipher_Context mcuxClCipher_Context_t
Cipher context type.
Definition mcuxClCipher_Types.h:100
const mcuxClCipher_ModeDescriptor_t *const mcuxClCipher_Mode_t
Cipher mode/algorithm type.
Definition mcuxClCipher_Types.h:61
uint32_t mcuxClCipher_Status_t
Cipher status code.
Definition mcuxClCipher_Types.h:108
uint32_t mcuxClKey_Status_t
Type for Key component error codes.
Definition mcuxClKey_Types.h:47
const mcuxClKey_GenerationDescriptor_t *const mcuxClKey_Generation_t
Key generation type.
Definition mcuxClKey_Types.h:225
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:88
uint32_t mcuxClOsccaSm2_Status_t
Type for SM2 status codes.
Definition mcuxClOsccaSm2_Types.h:49
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:113
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:125
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:81