Example for the mcuxClEcc component.
#include <mcuxClCore_Examples.h>
#include <mcuxClExample_Session_Helper.h>
static const uint8_t pCompressedPoint[MCUXCLECC_WEIERECC_SECP224R1_SIZE_ENCPOINT_SEC_COMPRESSED] =
{
0x03u,
0x43u, 0x40u, 0x02u, 0x5Au, 0xD9u, 0x33u, 0xF3u, 0x0Au,
0x65u, 0x1Au, 0x05u, 0xEAu, 0x93u, 0xA0u, 0x73u, 0x2Du,
0x7Du, 0x9Fu, 0x66u, 0x66u, 0xD9u, 0x9Eu, 0x2Du, 0x87u,
0x16u, 0xC4u, 0x5Du, 0xCDu
};
static const uint8_t pRefDecodedPoint[MCUXCLECC_WEIERECC_SECP224R1_SIZE_PRIMEP * 2u] =
{
0x43u, 0x40u, 0x02u, 0x5Au, 0xD9u, 0x33u, 0xF3u, 0x0Au,
0x65u, 0x1Au, 0x05u, 0xEAu, 0x93u, 0xA0u, 0x73u, 0x2Du,
0x7Du, 0x9Fu, 0x66u, 0x66u, 0xD9u, 0x9Eu, 0x2Du, 0x87u,
0x16u, 0xC4u, 0x5Du, 0xCDu,
0x15u, 0x56u, 0x3Du, 0x61u, 0x53u, 0x4Fu, 0x83u, 0x4Fu,
0xB3u, 0x8Du, 0x15u, 0x2Cu, 0x2Fu, 0x09u, 0x53u, 0x8Du,
0xE0u, 0x7Eu, 0xA2u, 0x01u, 0xC0u, 0x1Au, 0x94u, 0xA6u,
0x36u, 0x32u, 0x1Au, 0xEFu
};
#define MAX_CPUWA_SIZE MCUXCLECC_WEIERECC_DECODEPOINT_WACPU_SIZE
#define MAX_PKCWA_SIZE MCUXCLECC_WEIERECC_DECODEPOINT_WAPKC_SIZE_256
MCUXCLEXAMPLE_FUNCTION(mcuxClEcc_WeierECC_DecodePoint_secp224r1_example)
{
mcuxClSession_Descriptor_t sessionDesc;
MCUXCLEXAMPLE_ALLOCATE_AND_INITIALIZE_SESSION(pSession, MAX_CPUWA_SIZE, MAX_PKCWA_SIZE);
uint8_t pDecodedPoint[MCUXCLECC_WEIERECC_SECP224R1_SIZE_PRIMEP * 2u] = {0u};
MCUXCLBUFFER_INIT(buffDecodedPoint, NULL, pDecodedPoint, (MCUXCLECC_WEIERECC_SECP224R1_SIZE_PRIMEP * 2u));
pSession,
buffCompressedPoint,
buffDecodedPoint,
MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_CONST_QUALIFIER()
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_CONST_QUALIFIER())
);
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
if(!mcuxClCore_assertEqual(pDecodedPoint, pRefDecodedPoint, MCUXCLECC_WEIERECC_SECP224R1_SIZE_PRIMEP * 2u))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
if(!mcuxClExample_Session_Clean(pSession))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
return MCUXCLEXAMPLE_STATUS_OK;
}
Definition of function identifiers for the flow protection mechanism.
Top level header of mcuxClEcc component.
Top-level include file for the mcuxClSession component.
Provides the API for the CSSL flow protection mechanism.
#define MCUXCLBUFFER_INIT(name, info, ptr, size)
Initialize an input/output buffer (mcuxCl_Buffer_t).
Definition mcuxClBuffer.h:67
#define MCUXCLBUFFER_INIT_RO(name, info, ptr, size)
Initialize an input buffer (mcuxCl_InputBuffer_t) with plain CPU handling.
Definition mcuxClBuffer.h:84
mcuxClEcc_Status_t mcuxClEcc_WeierECC_DecodePoint(mcuxClSession_Handle_t pSession, mcuxCl_InputBuffer_t pEncodedPoint, mcuxCl_Buffer_t pDecodedPoint, mcuxClEcc_WeierECC_PointEncType_t pointEncType, mcuxClEcc_Weier_DomainParams_t *pEccWeierDomainParams)
Point decoding function.
struct mcuxClEcc_Weier_DomainParams mcuxClEcc_Weier_DomainParams_t
Type for Weierstrass ECC domain parameters.
Definition mcuxClEcc_Types.h:83
const mcuxClEcc_Weier_DomainParams_t mcuxClEcc_Weier_DomainParams_secp224r1
secp224r1 (nistp224r1, ansix9p224r1) domain parameters
static const mcuxClEcc_WeierECC_PointEncType_t mcuxClEcc_WeierECC_PointEncType_SEC
Point encoding type to be used for Weierstrass curve points as specified in SEC 1: Elliptic Curve Cry...
Definition mcuxClEcc_Types.h:626
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:98
#define MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(...)
Call a flow protected function and check the protection token.
Definition mcuxCsslFlowProtection.h:623
#define MCUX_CSSL_FP_FUNCTION_CALLED(...)
Expectation of a called function.
Definition mcuxCsslFlowProtection.h:777
#define MCUX_CSSL_FP_FUNCTION_CALL_END(...)
End a function call section started by MCUX_CSSL_FP_FUNCTION_CALL_BEGIN.
Definition mcuxCsslFlowProtection.h:658
#define MCUXCLECC_STATUS_OK
Operation was successful.
Definition mcuxClEcc_Constants.h:46