2.5.1.3 Crypto_Sym_Camellia_EncryptDirect
crypto_Sym_Status_E Crypto_Sym_Camellia_EncryptDirect(
crypto_HandlerType_E handlerType_en,
crypto_Sym_OpModes_E opMode_en,
uint8_t *ptr_inputData,
uint32_t dataLen,
uint8_t *ptr_outData,
uint8_t *ptr_key,
uint32_t keyLen,
uint8_t *ptr_initVect,
uint32_t sessionID
);
Description
This API performs Camellia encryption for different operation modes in a single step without initializing.
Parameters
No. | Argument Type | Argument Name | Type | Description |
---|---|---|---|---|
1 | crypto_HandlerType_E | handlerType_en | Input | Enum for crypto operation handler i.e., SW, HW. |
2 | crypto_Sym_OpModes_E | opMode_en | Input | Select operation mode. i.e., ECB, CBC, or others. |
3 | uint8_t* | ptr_inputData | Input | Input data to encrypt. |
4 | uint32_t | dataLen Input | Input | Length of plain data in bytes. |
5 | uint8_t* | ptr_outData | Output | Pointer to store cipher text as output. |
6 | uint8_t* | ptr_key | Input | Key for the Symmetric operation. |
7 | uint32_t | keyLen | Input | Key length for the Symmetric algorithm in bytes. |
8 | uint8_t* | ptr_initVect | Input | Initialization vector. Use NULL when ECB mode. |
9 | uint32_t | sessionID | Input | It defines the session ID, must be more than zero. |
Returns
Return Type | Description |
---|---|
crypto_Sym_Status_E | Function returns the status of the API. |
Example
#define sessionID 1
crypto_Sym_Status_E status;
crypto_HandlerType_E handlerType_en = CRYPTO_HANDLER_HW_INTERNAL;
crypto_Sym_OpModes_E opMode_en = CRYPTO_SYM_OPMODE_ECB;
uint8_t key[16] = {/*data*/};
uint32_t keyLen = sizeof(key);
uint8_t *ptr_initVect = NULL;
uint8_t inputData[64] = {/*data*/};
uint32_t dataLen = sizeof(inputData);
uint8_t outData[64];
uint8_t ptr_tweak[] = {/*data*/};
status = Crypto_Sym_Camellia_EncryptDirect(
handlerType_en,
opMode_en,
inputData,
dataLen,
ptr_outData,
key,
keyLen,
ptr_initVect,
sessionID
);