MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClEls_Common_Functions

Defines all functions of mcuxClEls_Common. More...

Functions

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetHwVersion (mcuxClEls_HwVersion_t *result)
 Determines the version of the underlying ELS hardware IP. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetHwState (mcuxClEls_HwState_t *result)
 Determines the current state of the ELS. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Enable_Async (void)
 Enables the ELS. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Reset_Async (mcuxClEls_ResetOption_t options)
 Perform a synchronous reset of the ELS. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Disable (void)
 Disable the ELS. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_SetIntEnableFlags (mcuxClEls_InterruptOptionEn_t options)
 Set interrupt enable flags. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetIntEnableFlags (mcuxClEls_InterruptOptionEn_t *result)
 Get interrupt enable flags. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_ResetIntFlags (mcuxClEls_InterruptOptionRst_t options)
 Clear the interrupt status register. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_SetIntFlags (mcuxClEls_InterruptOptionSet_t options)
 Set the interrupt status register, for debug and testing purposes. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_WaitForOperation (mcuxClEls_ErrorHandling_t errorHandling)
 Wait for an ELS operation and optionally clear the error status. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_LimitedWaitForOperation (uint32_t counterLimit, mcuxClEls_ErrorHandling_t errorHandling)
 Await the completion of an ELS operation for a limited amount of time and optionally clear the error status. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_ResetErrorFlags (void)
 Resets all error flags that have been set by a previous operation. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetErrorCode (mcuxClEls_ErrorHandling_t errorHandling)
 Get the last ELS error code and optionally clear the error status. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetErrorLevel (mcuxClEls_ErrorHandling_t errorHandling, uint32_t *errorLevel)
 Get the last ELS error code and level and optionally clear the error status. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_SetRandomStartDelay (uint32_t delay)
 Set the random start delay for AES based operations. More...
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetRandomStartDelay (uint32_t *delay)
 Get the random start delay for AES based operations. More...
 

Detailed Description

Defines all functions of mcuxClEls_Common.

Function Documentation

◆ mcuxClEls_GetHwVersion()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetHwVersion ( mcuxClEls_HwVersion_t result)

Determines the version of the underlying ELS hardware IP.

Attention
This header was delivered as part of a CLNS release which is compatible with a specific ELS hardware IP version, which is defined by the macro MCUXCLELS_HW_VERSION.
Parameters
[out]resultPointer which will be filled with the ELS hardware version
Returns
An error code that is always MCUXCLELS_STATUS_OK
Examples
mcuxClEls_Common_Get_Info_example.c.

◆ mcuxClEls_GetHwState()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetHwState ( mcuxClEls_HwState_t result)

Determines the current state of the ELS.

Parameters
[out]resultPointer which will be filled with the ELS status information
Returns
An error code that is always MCUXCLELS_STATUS_OK
Examples
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c.

◆ mcuxClEls_Enable_Async()

◆ mcuxClEls_Reset_Async()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Reset_Async ( mcuxClEls_ResetOption_t  options)

Perform a synchronous reset of the ELS.

This means that:

  • any running ELS command will be stopped,
  • all errors will be cleared,
  • all keys will be deleted,
  • any RNG entropy will be discarded,
  • the glitch detector will be reset and
  • the run-time fingerprint will be restored to its default value.

Call mcuxClEls_WaitForOperation to complete the operation.

Parameters
[in]optionsA value indicating whether any running ELS operations shall be canceled
Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information
Return values
MCUXCLELS_STATUS_SW_CANNOT_INTERRUPTif a running operation prevented the reset
MCUXCLELS_STATUS_OK_WAITon successful request
Examples
mcuxClPsaDriver_keygen_export_public_key_oracle_example.c.

◆ mcuxClEls_Disable()

◆ mcuxClEls_SetIntEnableFlags()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_SetIntEnableFlags ( mcuxClEls_InterruptOptionEn_t  options)

Set interrupt enable flags.

Parameters
[in]optionsThe command options, determining which interrupts should be enabled or disabled. For more information, see mcuxClEls_InterruptOptionEn_t.
Returns
An error code that is always MCUXCLELS_STATUS_OK

◆ mcuxClEls_GetIntEnableFlags()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetIntEnableFlags ( mcuxClEls_InterruptOptionEn_t result)

Get interrupt enable flags.

Parameters
[out]resultPointer which is filled with the configuration of the interrupts enable register.
Returns
An error code that is always MCUXCLELS_STATUS_OK

◆ mcuxClEls_ResetIntFlags()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_ResetIntFlags ( mcuxClEls_InterruptOptionRst_t  options)

Clear the interrupt status register.

Parameters
[in]optionsThe command options, determining which interrupt status bits should be cleared. For more information, see mcuxClEls_InterruptOptionRst_t.
Returns
An error code that is always MCUXCLELS_STATUS_OK

◆ mcuxClEls_SetIntFlags()

Set the interrupt status register, for debug and testing purposes.

Parameters
[in]optionsThe command options, determining which interrupt status bits should be set. For more information, see mcuxClEls_InterruptOptionSet_t.
Returns
An error code that is always MCUXCLELS_STATUS_OK

◆ mcuxClEls_WaitForOperation()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_WaitForOperation ( mcuxClEls_ErrorHandling_t  errorHandling)

Wait for an ELS operation and optionally clear the error status.

If an ELS operation is active, this function waits for completion of that operation. For this, the busy flag of ELS is polled. Additionally, this function checks and returns any applicable error indication. If no operation is active, the function returns immediately.

Parameters
[in]errorHandlingDefine if error flags shall be cleared.
Return values
MCUXCLELS_STATUS_OKif the last operation was successful, or no operation was active
Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information
Examples
mcuxClEls_Cipher_Aes128_Cbc_Encrypt_example.c, mcuxClEls_Cipher_Aes128_Ecb_Encrypt_example.c, mcuxClEls_Hash_Sha224_One_Block_example.c, mcuxClEls_Hash_Sha256_One_Block_example.c, mcuxClEls_Hash_Sha384_One_Block_example.c, mcuxClEls_Hash_Sha512_One_Block_example.c, mcuxClPsaDriver_keygen_export_public_key_brainpoolpr1_example.c, mcuxClPsaDriver_keygen_export_public_key_mont_curve25519_example.c, mcuxClPsaDriver_keygen_export_public_key_oracle_example.c, mcuxClPsaDriver_keygen_export_public_key_rsa_example.c, mcuxClPsaDriver_keygen_export_public_key_secpk1_example.c, and mcuxClPsaDriver_keygen_export_public_key_secpr1_example.c.

◆ mcuxClEls_LimitedWaitForOperation()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_LimitedWaitForOperation ( uint32_t  counterLimit,
mcuxClEls_ErrorHandling_t  errorHandling 
)

Await the completion of an ELS operation for a limited amount of time and optionally clear the error status.

If an ELS operation is active, this function waits for completion of that operation until a counter expires. For this, the busy flag of ELS is polled. The counting mechanism behaves like a simple for-loop from counterLimit to one. This counter does not have a well-defined relationship to real-world time. Additionally, this function checks and returns any applicable error indication. If no operation is active, the function returns immediately.

Parameters
[in]counterLimitThe limit of the wait counter.
[in]errorHandlingDefine if error flags shall be cleared.
Return values
MCUXCLELS_STATUS_OKif the last operation was successful, or no operation was active
MCUXCLELS_STATUS_SW_COUNTER_EXPIREDif the counter expired while waiting for the operation to complete
Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information
Examples
mcuxClEls_Ecc_Keygen_Sign_Verify_example.c, and mcuxClEls_Tls_Master_Key_Session_Keys_example.c.

◆ mcuxClEls_ResetErrorFlags()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_ResetErrorFlags ( void  )

Resets all error flags that have been set by a previous operation.

Returns
An error code that is always MCUXCLELS_STATUS_OK

◆ mcuxClEls_GetErrorCode()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetErrorCode ( mcuxClEls_ErrorHandling_t  errorHandling)

Get the last ELS error code and optionally clear the error status.

Parameters
[in]errorHandlingDefine if error flags shall be cleared.
Return values
MCUXCLELS_STATUS_OKif the last operation was successful or no operation was active
Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information

◆ mcuxClEls_GetErrorLevel()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetErrorLevel ( mcuxClEls_ErrorHandling_t  errorHandling,
uint32_t *  errorLevel 
)

Get the last ELS error code and level and optionally clear the error status.

Parameters
[in]errorHandlingDefine if error flags shall be cleared.
[out]errorLevelPointer to the location that will receive the value of the error level.
Return values
MCUXCLELS_STATUS_OKif the last operation was successful or no operation was active
#MCUXCLELS_STATUS_if the last operation resulted in an error
Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information

◆ mcuxClEls_SetRandomStartDelay()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_SetRandomStartDelay ( uint32_t  delay)

Set the random start delay for AES based operations.

This impacts mcuxClEls_Aead_*, mcuxClEls_Cipher_*, mcuxClEls_Cmac_*, ncpClEls_Ckdf_*, mcuxClEls_KeyImport_Async, mcuxClEls_KeyExport_Async

Parameters
[in]delayDefine the max random start delay. Acceptable values are a power of 2 minus one, starting from 0 to 1023 (0, 1, 3, 7, ..., 1023).
Return values
MCUXCLELS_STATUS_OKif the operation was successful
Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information

◆ mcuxClEls_GetRandomStartDelay()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetRandomStartDelay ( uint32_t *  delay)

Get the random start delay for AES based operations.

Parameters
[out]delayPointer to store random start delay configuration.
Return values
MCUXCLELS_STATUS_OKif the operation was successful
Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information