Go to the documentation of this file.
32 #define TRACE_LEVEL CRYPTO_TRACE_LEVEL
35 #include "fsl_device_registers.h"
44 #if (MIMXRT1170_CRYPTO_PKC_SUPPORT == ENABLED)
68 caam_handle_t caamHandle;
101 caamHandle.jobRing = kCAAM_JobRing0;
114 status = CAAM_PKHA_ModMul(CAAM, &caamHandle,
pkhaArgs.
a, aLen,
116 kCAAM_PKHA_IntegerArith, kCAAM_PKHA_NormalValue,
117 kCAAM_PKHA_NormalValue, kCAAM_PKHA_TimingEqualized);
120 if(status == kStatus_Success)
167 caam_handle_t caamHandle;
175 if(modLen > 0 && modLen <= 512 && expLen > 0 && expLen <= 512)
187 caamHandle.jobRing = kCAAM_JobRing0;
200 status = CAAM_PKHA_ModExp(CAAM, &caamHandle,
pkhaArgs.
a, scalarLen,
202 kCAAM_PKHA_IntegerArith, kCAAM_PKHA_NormalValue,
203 kCAAM_PKHA_TimingEqualized);
206 if(status == kStatus_Success)
248 caam_handle_t caamHandle;
249 caam_pkha_ecc_point_t input;
250 caam_pkha_ecc_point_t output;
258 if(modLen <= 66 && scalarLen <= 66)
261 caamHandle.jobRing = kCAAM_JobRing0;
285 status = CAAM_PKHA_ECC_PointMul(CAAM, &caamHandle, &input,
pkhaEccArgs.
d,
287 modLen, kCAAM_PKHA_TimingEqualized, kCAAM_PKHA_IntegerArith, &output);
290 if(status == kStatus_Success)
Arbitrary precision integer.
PKHA ECC primitive arguments.
OsMutex mimxrt1170CryptoMutex
#define mpiWriteRaw(a, data, length)
error_t mpiSetValue(Mpi *r, int_t a)
Set the value of a multiple precision integer.
void mpiInit(Mpi *r)
Initialize a multiple precision integer.
#define mpiReadRaw(r, data, length)
error_t mpiMod(Mpi *r, const Mpi *a, const Mpi *p)
Modulo operation.
@ ERROR_FAILURE
Generic error code.
General definitions for cryptographic algorithms.
i.MX RT1170 hardware cryptographic accelerator (CAAM)
i.MX RT1170 public-key hardware accelerator
PKHA primitive arguments.
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
error_t mpiMulMod(Mpi *r, const Mpi *a, const Mpi *b, const Mpi *p)
Modular multiplication.
error_t ecMult(const EcDomainParameters *params, EcPoint *r, const Mpi *d, const EcPoint *s)
Scalar multiplication.
ECC (Elliptic Curve Cryptography)
error_t mpiExpMod(Mpi *r, const Mpi *a, const Mpi *e, const Mpi *p)
Modular exponentiation.
uint_t mpiGetByteLength(const Mpi *a)
Get the actual length in bytes.
void mpiFree(Mpi *r)
Release a multiple precision integer.