Top-level API of the mcuxClCipher component. More...
#include <mcuxClConfig.h>
#include <mcuxClSession_Types.h>
#include <mcuxClKey_Types.h>
#include <mcuxClCipher_Types.h>
#include <mcuxClCore_Platform.h>
#include <mcuxClCore_Buffer.h>
Go to the source code of this file.
Functions | |
mcuxClCipher_Status_t | mcuxClCipher_crypt (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, mcuxClCipher_Mode_t mode, mcuxCl_InputBuffer_t pIv, uint32_t ivLength, mcuxCl_InputBuffer_t pIn, uint32_t inLength, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength) |
One-shot encryption/decryption function. More... | |
mcuxClCipher_Status_t | mcuxClCipher_init (mcuxClSession_Handle_t session, mcuxClCipher_Context_t *const pContext, mcuxClKey_Handle_t key, mcuxClCipher_Mode_t mode, mcuxCl_InputBuffer_t pIv, uint32_t ivLength) |
Multi-part encryption/decryption initialization function. More... | |
mcuxClCipher_Status_t | mcuxClCipher_process (mcuxClSession_Handle_t session, mcuxClCipher_Context_t *const pContext, mcuxCl_InputBuffer_t pIn, uint32_t inLength, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength) |
Multi-part encryption/decryption processing function. More... | |
mcuxClCipher_Status_t | mcuxClCipher_finish (mcuxClSession_Handle_t session, mcuxClCipher_Context_t *const pContext, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength) |
Multi-part encryption/decryption finalization function. More... | |
Top-level API of the mcuxClCipher component.
mcuxClCipher_Status_t mcuxClCipher_crypt | ( | mcuxClSession_Handle_t | session, |
mcuxClKey_Handle_t | key, | ||
mcuxClCipher_Mode_t | mode, | ||
mcuxCl_InputBuffer_t | pIv, | ||
uint32_t | ivLength, | ||
mcuxCl_InputBuffer_t | pIn, | ||
uint32_t | inLength, | ||
mcuxCl_Buffer_t | pOut, | ||
uint32_t *const | pOutLength | ||
) |
One-shot encryption/decryption function.
This function performs an encryption/decryption operation in one shot. The algorithm to be used will be determined based on the mode that is provided.
For example, to perform an AES encryption/decryption operation with a 128-bit key in CBC mode on padded data, the following needs to be provided:
session | Handle for the current CL session. | |
key | Key to be used to encrypt the data. | |
mode | Cipher mode that should be used during the encryption/decryption operation. | |
[in] | pIv | Pointer to the buffer that contains the IV, if needed for the chosen mode , otherwise ignored. |
ivLength | Number of bytes of data in the pIv buffer. | |
[in] | pIn | Pointer to the input buffer that contains the plain data that needs to be encrypted. |
inLength | Number of bytes of plain data in the pIn buffer. | |
[out] | pOut | Pointer to the output buffer where the encrypted data needs to be written. |
[out] | pOutLength | Will be incremented by the number of bytes of encrypted data that have been written to the pOut buffer. |
mcuxClCipher_Status_t mcuxClCipher_init | ( | mcuxClSession_Handle_t | session, |
mcuxClCipher_Context_t *const | pContext, | ||
mcuxClKey_Handle_t | key, | ||
mcuxClCipher_Mode_t | mode, | ||
mcuxCl_InputBuffer_t | pIv, | ||
uint32_t | ivLength | ||
) |
Multi-part encryption/decryption initialization function.
This function performs the initialization for a multi part encryption/decryption operation. The algorithm to be used will be determined based on the mode that is provided.
session | Handle for the current CL session. | |
pContext | Cipher context which is used to maintain the state and store other relevant information about the operation. | |
key | Key to be used to encrypt the data. | |
mode | Cipher mode that should be used during the encryption/decryption operation. | |
[in] | pIv | Pointer to the buffer that contains the IV, if needed for the chosen mode , otherwise ignored. |
ivLength | Number of bytes of data in the pIv buffer. |
mcuxClCipher_Status_t mcuxClCipher_process | ( | mcuxClSession_Handle_t | session, |
mcuxClCipher_Context_t *const | pContext, | ||
mcuxCl_InputBuffer_t | pIn, | ||
uint32_t | inLength, | ||
mcuxCl_Buffer_t | pOut, | ||
uint32_t *const | pOutLength | ||
) |
Multi-part encryption/decryption processing function.
This function performs the processing of (a part of) a data stream for an encryption/decryption operation. The algorithm and key to be used will be determined based on the context that is provided. Data is processed in full blocks only. Remaining data is stored in the context to be handled in later process or finish calls.
session | Handle for the current CL session. | |
pContext | Cipher context which is used to maintain the state and store other relevant information about the operation. | |
[in] | pIn | Pointer to the input buffer that contains the data that needs to be processed. |
inLength | Number of bytes of data in the pIn buffer. | |
[out] | pOut | Pointer to the output buffer where the processed data needs to be written. |
[out] | pOutLength | Will be incremented by the number of bytes of processed data that have been written to the pOut buffer. |
mcuxClCipher_Status_t mcuxClCipher_finish | ( | mcuxClSession_Handle_t | session, |
mcuxClCipher_Context_t *const | pContext, | ||
mcuxCl_Buffer_t | pOut, | ||
uint32_t *const | pOutLength | ||
) |
Multi-part encryption/decryption finalization function.
This function performs the finalization of an encryption or decryption operation. The algorithm and key to be used will be determined based on the context that is provided. No new data is accepted but remaining data in the context is processed.
session | Handle for the current CL session. | |
pContext | Cipher context which is used to maintain the state and store other relevant information about the operation. | |
[out] | pOut | Pointer to the output buffer where the processed data needs to be written. |
[out] | pOutLength | Will be incremented by the number of bytes of processed data that have been written to the pOut buffer. |