Functions#
This section provides a reference to the CCM Crypto API functions.
Functions#
To encrypt or decrypt the message according to the given configuration.
To initialize a multipart CCM operation by sending the first-packet command (FIRST_CHUNK) to the firmware.
To send a middle-packet CCM command (MIDDLE_CHUNK) carrying a chunk of message data to the firmware for encryption or decryption.
To send the last-packet CCM command (LAST_CHUNK) to the firmware, which finalizes the CCM operation.
Function Documentation#
sl_si91x_ccm#
sl_status_t sl_si91x_ccm (sl_si91x_ccm_config_t * config, uint8_t * output)
To encrypt or decrypt the message according to the given configuration.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_si91x_ccm_config_t * | [in] | config | Configuration object of type sl_si91x_ccm_config_t. |
| uint8_t * | [out] | output | Buffer to store the output. |
This is a blocking API. Returns
sl_status_t. For more information on status codes, refer to SL STATUS DOCUMENTATION.
sl_si91x_mp_ccm_init#
sl_status_t sl_si91x_mp_ccm_init (sl_si91x_ccm_config_t * config)
To initialize a multipart CCM operation by sending the first-packet command (FIRST_CHUNK) to the firmware.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_si91x_ccm_config_t * | [in] | config | Configuration object of type sl_si91x_ccm_config_t. |
This resets and initializes the firmware CCM context with all required configuration: key, nonce, AD, tag length, total message length, and encrypt/decrypt direction. No plaintext or ciphertext payload is sent in this call. This is a blocking API. Returns
sl_status_t. For more information on status codes, refer to SL STATUS DOCUMENTATION.
sl_si91x_mp_ccm_update#
sl_status_t sl_si91x_mp_ccm_update (sl_si91x_ccm_config_t * config, uint16_t chunk_length, uint8_t * output)
To send a middle-packet CCM command (MIDDLE_CHUNK) carrying a chunk of message data to the firmware for encryption or decryption.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_si91x_ccm_config_t * | [in] | config | Configuration object of type sl_si91x_ccm_config_t. The msg pointer should be advanced to the current chunk. |
| uint16_t | [in] | chunk_length | Number of bytes in this chunk. |
| uint8_t * | [out] | output | Buffer to store the encrypted or decrypted output for this chunk. |
This is a blocking API. Returns
sl_status_t. For more information on status codes, refer to SL STATUS DOCUMENTATION.
sl_si91x_mp_ccm_final#
sl_status_t sl_si91x_mp_ccm_final (sl_si91x_ccm_config_t * config, uint16_t chunk_length, uint8_t * output)
To send the last-packet CCM command (LAST_CHUNK) to the firmware, which finalizes the CCM operation.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_si91x_ccm_config_t * | [in] | config | Configuration object of type sl_si91x_ccm_config_t. The msg pointer should be at the final chunk (may be NULL if chunk_length is 0). |
| uint16_t | [in] | chunk_length | Number of bytes in this final chunk (can be 0). |
| uint8_t * | [out] | output | Buffer to store the firmware output. |
For encryption, the firmware produces the authentication tag. For decryption, the firmware verifies the tag. This is a blocking API. Returns
sl_status_t. For more information on status codes, refer to SL STATUS DOCUMENTATION.