MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClSession_Functions

Defines all functions of mcuxClSession. More...

Functions

mcuxClSession_Status_t mcuxClSession_init (mcuxClSession_Handle_t pSession, uint32_t *const pCpuWaBuffer, uint32_t cpuWaLength, uint32_t *const pPkcWaBuffer, uint32_t pkcWaLength)
 Initialize a Crypto Library session.
mcuxClSession_Status_t mcuxClSession_setResource (mcuxClSession_Handle_t session, mcuxClResource_Context_t *pResourceCtx)
 Set the resource context in a Crypto Library session.
mcuxClSession_Status_t mcuxClSession_configure_job (mcuxClSession_Handle_t session, mcuxClSession_Channels_t dmaChannels, mcuxClSession_Callback_t pUserCallback, void *pUserData)
 Configure the parameters for non-blocking operations (jobs) in this session.
mcuxClSession_Status_t mcuxClSession_cleanup (mcuxClSession_Handle_t pSession)
 Clean up a Crypto Library session.
mcuxClSession_Status_t mcuxClSession_destroy (mcuxClSession_Handle_t pSession)
 Destroy a Crypto Library session.
mcuxClSession_Status_t mcuxClSession_setRandom (mcuxClSession_Handle_t session, mcuxClRandom_Mode_t randomMode, mcuxClRandom_Context_t randomCtx)
 Function to switch to another random configuration.
mcuxClSession_Status_t mcuxClSession_cleanupOnError (mcuxClSession_Handle_t pSession)
 Clean up HW Resources after error case.

Detailed Description

Defines all functions of mcuxClSession.

Function Documentation

◆ mcuxClSession_init()

mcuxClSession_Status_t mcuxClSession_init ( mcuxClSession_Handle_t pSession,
uint32_t *const pCpuWaBuffer,
uint32_t cpuWaLength,
uint32_t *const pPkcWaBuffer,
uint32_t pkcWaLength )

Initialize a Crypto Library session.

Parameters
pSessionSession to be initialized.
pCpuWaBufferPointer to buffer to be used as workarea for CPU operations. This pointer shall be CPU-word aligned.
cpuWaLengthSize (in bytes) of the workarea for CPU operations. The size shall be a multiple of CPU wordsize.
pPkcWaBufferPointer to buffer to be used as workarea for PKC operations. This pointer shall be PKC-word aligned.
pkcWaLengthSize (in bytes) of the workarea for PKC operations. The size shall be a multiple of CPU wordsize.
Returns
status
Return values
MCUXCLSESSION_STATUS_OKSession has been initialized successfully
MCUXCLSESSION_STATUS_ERRORError occurred during session initializing.

◆ mcuxClSession_setResource()

mcuxClSession_Status_t mcuxClSession_setResource ( mcuxClSession_Handle_t session,
mcuxClResource_Context_t * pResourceCtx )

Set the resource context in a Crypto Library session.

Parameters
sessionSession to be initialized.
pResourceCtxPointer to the global resource context.
Returns
status
Return values
MCUXCLSESSION_STATUS_OKSession operation successful

◆ mcuxClSession_configure_job()

◆ mcuxClSession_cleanup()

mcuxClSession_Status_t mcuxClSession_cleanup ( mcuxClSession_Handle_t pSession)

Clean up a Crypto Library session.

This function will (securely) cleanup the session, which will still be usable afterwards.

Parameters
pSessionSession to be cleaned.
Returns
status
Return values
MCUXCLSESSION_STATUS_OKSession operation successful

◆ mcuxClSession_destroy()

mcuxClSession_Status_t mcuxClSession_destroy ( mcuxClSession_Handle_t pSession)

Destroy a Crypto Library session.

This function will (securely) cleanup the session, including uninitialization etc. The session will no longer be usable afterwards.

Parameters
pSessionSession to be destroyed.
Returns
status
Return values
MCUXCLSESSION_STATUS_OKSession operation successful
MCUXCLSESSION_STATUS_ERRORError occurred during Session operation

◆ mcuxClSession_setRandom()

mcuxClSession_Status_t mcuxClSession_setRandom ( mcuxClSession_Handle_t session,
mcuxClRandom_Mode_t randomMode,
mcuxClRandom_Context_t randomCtx )

Function to switch to another random configuration.

Parameters
sessionSession to set the new random configuration.
randomModeRandom data generation mode/algorithm. It should be the same mode used to initialize randomCtx.
randomCtxRandom context.
Returns
status
Examples
mcuxClRandomModes_Different_Sessions_example.c.

◆ mcuxClSession_cleanupOnError()

mcuxClSession_Status_t mcuxClSession_cleanupOnError ( mcuxClSession_Handle_t pSession)

Clean up HW Resources after error case.

(Early Exit scenario)

This function will reset all used HW Resources after an error (Early Exit scenario). Additionally it will clear the CPU workspace and PKC workspace if applicable. Random context associated with the session will not be cleared and must be reinitialized before further usage.

Attention
This function must not be used in case of Fault Attack error case but instead Power-On-Reset or System Reset must be performed.
Parameters
pSessionSession which is used when the error occurred.
Returns
status
Return values
MCUXCLSESSION_STATUS_OKThe HW Resources cleaned up successfully
Examples
mcuxClSession_cleanupOnError_example.c.