MCUX CLNS MCUX Crypto Library Normal Secure |

Functions
mcuxClCss_Common_Functions
mcuxClCss » mcuxClCss_Common

Defines all functions of mcuxClCss_Common. More...

## Functions
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_GetHwVersion (mcuxClCss_HwVersion_t *result)
| Determines the version of the underlying CSS hardware IP. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_GetHwConfig (mcuxClCss_HwConfig_t *result)
| Determines the hardware configuration of the underlying CSS hardware IP. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_GetHwState (mcuxClCss_HwState_t *result)
| Determines the current state of the CSS. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_Enable_Async (void)
| Enables the CSS. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_Reset_Async (mcuxClCss_ResetOption_t options)
| Perform a synchronous reset of the CSS. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_Disable (void)
| Disable the CSSv2. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_SetIntEnableFlags (mcuxClCss_InterruptOptionEn_t options)
| Set interrupt enable flags. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_GetIntEnableFlags (mcuxClCss_InterruptOptionEn_t *result)
| Get interrupt enable flags. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_ResetIntFlags (mcuxClCss_InterruptOptionRst_t options)
| Clear the interrupt status register. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_SetIntFlags (mcuxClCss_InterruptOptionSet_t options)
| Set the interrupt status register, for debug and testing purposes. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_WaitForOperation (mcuxClCss_ErrorHandling_t errorHandling)
| Wait for a CSS operation and optionally clear the error status. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_LimitedWaitForOperation (uint32_t counterLimit, mcuxClCss_ErrorHandling_t errorHandling)
| Await the completion of a CSS operation for a limited amount of time and optionally clear the error status. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_ResetErrorFlags (void)
| Resets all error flags that have been set by a previous operation. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_GetErrorCode (mcuxClCss_ErrorHandling_t errorHandling)
| Get the last CSS error code and optionally clear the error status. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_GetErrorLevel (mcuxClCss_ErrorHandling_t errorHandling, uint32_t *errorLevel)
| Get the last CSS error code and level and optionally clear the error status. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_SetRandomStartDelay (uint32_t delay)
| Set the random start delay for AES based operations. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_GetRandomStartDelay (uint32_t *delay)
| Get the random start delay for AES based operations. More...

## Detailed Description

Defines all functions of mcuxClCss_Common.

## Function Documentation

## ◆ mcuxClCss_GetHwVersion()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_GetHwVersion | ( | mcuxClCss_HwVersion_t * | result | ) |

Determines the version of the underlying CSS hardware IP.

Attention
  This header was delivered as part of a CLNS release which is compatible with a specific CSS hardware IP version, which is defined by the macro MCUXCLCSS_HW_VERSION.

Parameters

  [out] | result | Pointer which will be filled with the CSS hardware version

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

Examples
  common_get_info.c.

## ◆ mcuxClCss_GetHwConfig()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_GetHwConfig | ( | mcuxClCss_HwConfig_t * | result | ) |

Determines the hardware configuration of the underlying CSS hardware IP.

Parameters

  [out] | result | Pointer which will be filled with the CSS hardware configuration

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

Examples
  common_get_info.c.

## ◆ mcuxClCss_GetHwState()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_GetHwState | ( | mcuxClCss_HwState_t * | result | ) |

Determines the current state of the CSS.

Parameters

  [out] | result | Pointer which will be filled with the CSS status information

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

Examples
  ecc_keygen_sign_verify.c.

## ◆ mcuxClCss_Enable_Async()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Enable_Async | ( | void |  | ) |

Enables the CSS.

Call mcuxClCss_WaitForOperation to complete the operation.

Returns
  An error code that is always MCUXCLCSS_STATUS_OK_WAIT

Examples
  cipher_aes128_cbc_encrypt.c, cipher_aes128_ecb_encrypt.c, common_get_info.c, ecc_keygen_sign_verify.c, hash_sha224_one_block.c, hash_sha256_one_block.c, hash_sha256_sha_direct_one_block.c, hash_sha384_one_block.c, hash_sha384_sha_direct_one_block.c, hash_sha512_one_block.c, mcuxClEcc_Mont_example.c, mcuxClMac_cmac_oneshot_example.c, mcuxClRsa_sign_NoEncode_example.c, mcuxClRsa_sign_pss_sha2_256_example.c, mcuxClRsa_verify_NoVerify_example.c, mcuxClRsa_verify_pssverify_sha2_256_example.c, rng_prng_get_random.c, and tls_master_key_session_keys.c.

## ◆ mcuxClCss_Reset_Async()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Reset_Async | ( | mcuxClCss_ResetOption_t | options | ) |

Perform a synchronous reset of the CSS.

This means that:

- any running CSS 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 mcuxClCss_WaitForOperation to complete the operation.

Parameters

  [in] | options | A value indicating whether any running CSS operations shall be canceled

Returns
  An error code that can be any error code in MCUXCLCSS_STATUS_, see individual documentation for more information

Return values

  MCUXCLCSS_STATUS_SW_CANNOT_INTERRUPT | if a running operation prevented the reset
  MCUXCLCSS_STATUS_OK_WAIT | on successful request

## ◆ mcuxClCss_Disable()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Disable | ( | void |  | ) |

Disable the CSSv2.

This is useful as a power saving mechanism.

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

Examples
  cipher_aes128_cbc_encrypt.c, cipher_aes128_ecb_encrypt.c, common_get_info.c, ecc_keygen_sign_verify.c, hash_sha224_one_block.c, hash_sha256_one_block.c, hash_sha256_sha_direct_one_block.c, hash_sha384_one_block.c, hash_sha384_sha_direct_one_block.c, hash_sha512_one_block.c, mcuxClEcc_Mont_example.c, mcuxClMac_cmac_oneshot_example.c, mcuxClRsa_sign_NoEncode_example.c, mcuxClRsa_sign_pss_sha2_256_example.c, mcuxClRsa_verify_NoVerify_example.c, mcuxClRsa_verify_pssverify_sha2_256_example.c, and rng_prng_get_random.c.

## ◆ mcuxClCss_SetIntEnableFlags()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_SetIntEnableFlags | ( | mcuxClCss_InterruptOptionEn_t | options | ) |

Set interrupt enable flags.

Parameters

  [in] | options | The command options, determining which interrupts should be enabled or disabled. For more information, see mcuxClCss_InterruptOptionEn_t.

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

## ◆ mcuxClCss_GetIntEnableFlags()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_GetIntEnableFlags | ( | mcuxClCss_InterruptOptionEn_t * | result | ) |

Get interrupt enable flags.

Parameters

  [out] | result | Pointer which is filled with the configuration of the interrupts enable register.

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

## ◆ mcuxClCss_ResetIntFlags()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_ResetIntFlags | ( | mcuxClCss_InterruptOptionRst_t | options | ) |

Clear the interrupt status register.

Parameters

  [in] | options | The command options, determining which interrupt status bits should be cleared. For more information, see mcuxClCss_InterruptOptionRst_t.

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

## ◆ mcuxClCss_SetIntFlags()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_SetIntFlags | ( | mcuxClCss_InterruptOptionSet_t | options | ) |

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

Parameters

  [in] | options | The command options, determining which interrupt status bits should be set. For more information, see mcuxClCss_InterruptOptionSet_t.

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

## ◆ mcuxClCss_WaitForOperation()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_WaitForOperation | ( | mcuxClCss_ErrorHandling_t | errorHandling | ) |

Wait for a CSS operation and optionally clear the error status.

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

Parameters

  [in] | errorHandling | Define if error flags shall be cleared.

Return values

  MCUXCLCSS_STATUS_OK | if the last operation was successful, or no operation was active

Returns
  An error code that can be any error code in MCUXCLCSS_STATUS_, see individual documentation for more information

Examples
  cipher_aes128_cbc_encrypt.c, cipher_aes128_ecb_encrypt.c, common_get_info.c, ecc_keygen_sign_verify.c, hash_sha224_one_block.c, hash_sha256_one_block.c, hash_sha256_sha_direct_one_block.c, hash_sha384_one_block.c, hash_sha384_sha_direct_one_block.c, hash_sha512_one_block.c, mcuxClEcc_Mont_example.c, mcuxClMac_cmac_oneshot_example.c, mcuxClRsa_sign_NoEncode_example.c, mcuxClRsa_sign_pss_sha2_256_example.c, mcuxClRsa_verify_NoVerify_example.c, mcuxClRsa_verify_pssverify_sha2_256_example.c, rng_prng_get_random.c, and tls_master_key_session_keys.c.

## ◆ mcuxClCss_LimitedWaitForOperation()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_LimitedWaitForOperation | ( | uint32_t | counterLimit,
|  | mcuxClCss_ErrorHandling_t | errorHandling
| ) |  |

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

If a CSS operation is active, this function waits for completion of that operation until a counter expires. For this, the busy flag of CSS 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] | counterLimit | The limit of the wait counter.
  [in] | errorHandling | Define if error flags shall be cleared.

Return values

  MCUXCLCSS_STATUS_OK | if the last operation was successful, or no operation was active
  MCUXCLCSS_STATUS_SW_COUNTER_EXPIRED | if the counter expired while waiting for the operation to complete

Returns
  An error code that can be any error code in MCUXCLCSS_STATUS_, see individual documentation for more information

Examples
  ecc_keygen_sign_verify.c, and tls_master_key_session_keys.c.

## ◆ mcuxClCss_ResetErrorFlags()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_ResetErrorFlags | ( | void |  | ) |

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

Returns
  An error code that is always MCUXCLCSS_STATUS_OK

## ◆ mcuxClCss_GetErrorCode()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_GetErrorCode | ( | mcuxClCss_ErrorHandling_t | errorHandling | ) |

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

Parameters

  [in] | errorHandling | Define if error flags shall be cleared.

Return values

  MCUXCLCSS_STATUS_OK | if the last operation was successful or no operation was active

Returns
  An error code that can be any error code in MCUXCLCSS_STATUS_, see individual documentation for more information

## ◆ mcuxClCss_GetErrorLevel()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_GetErrorLevel | ( | mcuxClCss_ErrorHandling_t | errorHandling,
|  | uint32_t * | errorLevel
| ) |  |

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

Parameters

  [in] | errorHandling | Define if error flags shall be cleared.
  [out] | errorLevel | Pointer to the location that will receive the value of the error level.

Return values

  MCUXCLCSS_STATUS_OK | if the last operation was successful or no operation was active
  #MCUXCLCSS_STATUS_ | if the last operation resulted in an error

Returns
  An error code that can be any error code in MCUXCLCSS_STATUS_, see individual documentation for more information

## ◆ mcuxClCss_SetRandomStartDelay()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_SetRandomStartDelay | ( | uint32_t | delay | ) |

Set the random start delay for AES based operations.

This impacts mcuxClCss_Aead_*, mcuxClCss_Cipher_*, mcuxClCss_Cmac_*, ncpClCss_Ckdf_*, mcuxClCss_KeyImport_Async, mcuxClCss_KeyExport_Async

Parameters

  [in] | delay | Define 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

  MCUXCLCSS_STATUS_OK | if the operation was successful

Returns
  An error code that can be any error code in MCUXCLCSS_STATUS_, see individual documentation for more information

## ◆ mcuxClCss_GetRandomStartDelay()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_GetRandomStartDelay | ( | uint32_t * | delay | ) |

Get the random start delay for AES based operations.

Parameters

  [out] | delay | Pointer to store random start delay configuration.

Return values

  MCUXCLCSS_STATUS_OK | if the operation was successful

Returns
  An error code that can be any error code in MCUXCLCSS_STATUS_, see individual documentation for more information