Symmetric Crypto Command of HAL DUT Command dispatcher frame. More...

Modules | |
| Command_Codes | |
| Symmetric Crypto Command Codes of HAL DUT Command dispatcher frame. | |
| Defines | |
| Symmetric Crypto Definitions of HAL DUT Command dispatcher frame. | |
Symmetric Crypto Command of HAL DUT Command dispatcher frame.
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_Init | ( | phhalHw_DUT_DataParams_t * | pDataParams | ) |
Initialize Hardware Symmetric Crypto Component.
| PH_ERR_SUCCESS | Operation successful. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_DeInit | ( | phhalHw_DUT_DataParams_t * | pDataParams | ) |
Un-Initialize Hardware Symmetric Crypto Component.
| PH_ERR_SUCCESS | Operation successful. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_GetLastStatus | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wStatusMsgLen, | ||
| int8_t * | pStatusMsg, | ||
| int32_t * | pStatusCode | ||
| ) |
Returns the status code and respective message.
This interfaces is supported only if CryptoSym component is initialized with mBedTLS Initialization.
| PH_ERR_SUCCESS | Operation successful. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wStatusMsgLen | [In] Size of bytes allocated for pStatusMsg parameter. |
| [out] | pStatusMsg | [Out] The equivalent status message for the information available in pStatusCode. |
| [out] | pStatusCode | [Out] The status code returned by the underlying Crypto library. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_InvalidateKey | ( | phhalHw_DUT_DataParams_t * | pDataParams | ) |
Invalidate the currently loaded key.
Resets the key, the IV, the keep IV flag and the key Type.
| PH_ERR_SUCCESS | Operation successful. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_SetConfig | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wConfig, | ||
| uint16_t | wValue | ||
| ) |
Set configuration parameter.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_INVALID_PARAMETER | Valid wConfig but invalid wValue for that config. |
| PH_ERR_UNSUPPORTED_PARAMETER | Invalid (Unsupported) wConfig. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wConfig | [In] Configuration Identifier. Refer Configuration Identifier |
| [in] | wValue | [In] Configuration Value for the provided configuration identifier. Refer KeepIV Options for PHHAL_HW_DUT_CMD_CRYPTOSYM_CONFIG_KEEP_IV configuration identifier. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_GetConfig | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wConfig, | ||
| uint16_t * | pValue | ||
| ) |
Get configuration parameter.
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_INVALID_PARAMETER | Value behind wConfig not valid at the moment. |
| PH_ERR_UNSUPPORTED_PARAMETER | Invalid (Unsupported) wConfig. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wConfig | [In] Configuration Identifier. Refer Configuration Identifier |
| [out] | pValue | [Out] Configuration Value for the provided configuration identifier.
|
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_Encrypt | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| const uint8_t * | pPlainBuff, | ||
| uint16_t | wBuffLen, | ||
| uint8_t * | pEncBuff | ||
| ) |
Perform Encryption with one of the supported crypto modes.
The option word specifies the operation mode to use and the update behavior of the IV. All modes of operation are coded in the LSB, the flags in the MSB. The following Cipher modes are supported:
The following Flags are supported:
Note: The input data length needs to be a multiple of the current block size
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_INVALID_PARAMETER | An unsupported key is loaded (or no key is loaded) or wBufferLength is not a multiple of the current block size. |
| PH_ERR_UNSUPPORTED_PARAMETER | An unknown cipher option wOption is specified. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option byte specifying the cipher mode and the update behavior of the IV |
| [in] | pPlainBuff | [In] Plain data buffer.
|
| [in] | wBuffLen | [In] Length of plain and encrypted data buffer - needs to be a multiple of the current block size |
| [out] | pEncBuff | [Out] Encrypted data buffer. Will always be in multiple of current block size. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_Decrypt | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| const uint8_t * | pEncBuff, | ||
| uint16_t | wBuffLen, | ||
| uint8_t * | pPlainBuff | ||
| ) |
Perform Decryption with one of the supported crypto modes.
The option word specifies the operation mode to use and the update behavior of the IV. All modes of operation are coded in the LSB, the flags in the MSB. The following Cipher modes are supported:
The following Flags are supported:
Note: The input data length needs to be a multiple of the current block size
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_INVALID_PARAMETER | An unsupported key is loaded (or no key is loaded) or wBufferLength is not a multiple of the current block size. |
| PH_ERR_UNSUPPORTED_PARAMETER | An unknown cipher option wOption is specified. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option byte specifying the cipher mode and the update behavior of the IV |
| [in] | pEncBuff | [In] Encrypted data buffer. Should always be in multiple of current block size. |
| [in] | wBuffLen | [In] Length of plain and encrypted data buffer - needs to be a multiple of the current block size. |
| [out] | pPlainBuff | [Out] Plain data buffer. Will always be in multiple of current block size. Plain data may be padded with zeros if not current block size. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_CalculateMac | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| const uint8_t * | pData, | ||
| uint16_t | wDataLen, | ||
| uint8_t * | pMac, | ||
| uint8_t * | pMacLen | ||
| ) |
Calculate MAC with one of the supported MAC modes.
The option word specifies the MAC mode to use and the update behavior of the IV as well as the completion behavior. All modes of operation are coded in the LSB, the flags in the MSB. The following Cipher modes are supported:
The following Flags are supported:
Note: If PH_EXCHANGE_BUFFERED_BIT is set, the input length needs to be a multiple of the block length!
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_INVALID_PARAMETER | An unsupported key is loaded (or no key is loaded) or wDataLength is not a multiple of the current block size and the option PH_EXCHANGE_BUFFERED_BIT is set. |
| PH_ERR_UNSUPPORTED_PARAMETER | An unknown mac option wOption is specified. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option byte specifying the MAC mode and the update behavior of the IV and the completion flag. |
| [in] | pData | [In] Input data on which the MAC needs to be computed. Input will be always be in multiple of current block size if wOption is |
| [in] | wDataLen | [In] number of input data bytes |
| [out] | pMac | [Out] Output MAC block; uint8_t[16] |
| [out] | pMacLen | [Out] Length of MAC |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_LoadIv | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| const uint8_t * | pIV, | ||
| uint8_t | bIVLen | ||
| ) |
Load IV.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_INVALID_PARAMETER | bIVLength does not match the current block size. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | pIV | [In] Initialization vector to use. Should of current block size. |
| [in] | bIVLen | [In] Length of bytes available in pIV buffer. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_LoadKey | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wKeyNo, | ||
| uint16_t | wKeyVer, | ||
| uint16_t | wKeyType | ||
| ) |
Load Key.
This function uses the key storage provided at component initialization to retrieve the key identified by wKeyNo and wKeyVersion. After retrieving the key is loaded into the internal key storage array to be prepared for subsequent cipher operations.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_UNSUPPORTED_PARAMETER | Key Type not supported. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wKeyNo | [In] Key number in KeyStore to be loaded. |
| [in] | wKeyVer | [In] Key Version in KeyStore to be loaded. |
| [in] | wKeyType | [In] Type of Key to be loaded. Supported ones are |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_LoadKeyDirect | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| const uint8_t * | pKey, | ||
| uint16_t | wKeyType | ||
| ) |
Direct Load Key.
The key provided in the pKey parameter is loaded into the internal key storage array to be prepared for subsequent cipher operations.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_UNSUPPORTED_PARAMETER | Key Type not supported. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | pKey | [In] Key to be loaded. Number of bytes should be based on the key type mentioned in wKeyType parameter. |
| [in] | wKeyType | [In] Type of Key to be loaded. Supported ones are |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_DiversifyKey | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint16_t | wKeyNo, | ||
| uint16_t | wKeyVer, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInLen, | ||
| uint8_t * | pDivKey, | ||
| uint8_t * | pDivKeyLen | ||
| ) |
Diversify Key - Note: This function invalidates the currently loaded key.
Using the key stored in the KeyStore passed at initialization of the component and identified by wKeyNo and wKeyVersion this function calculates a diversified key according to the wOption specified that can be used in different applications.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_UNSUPPORTED_PARAMETER | Key Type not supported (for key diversification). |
| PH_ERR_LENGTH_ERROR | Length of diversification input is wrong. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option to specify the diversification method. One of the below mentioned information. |
| [in] | wKeyNo | [In] Key number in KeyStore to be loaded |
| [in] | wKeyVer | [In] Key Version in KeyStore to be loaded |
| [in] | pDivInput | [In] Diversification Input used to diversify the key. |
| [in] | bDivInLen | [In] Length of diversification input used to diversify the key. If 0, no diversification is performed. |
| [out] | pDivKey | [Out] Diversified key. Will be of current block size. |
| [out] | pDivKeyLen | [Out] Length of bytes available in pDivKey buffer. |
| phStatus_t phhalHw_DUT_Cmd_CryptoSym_DiversifyDirectKey | ( | phhalHw_DUT_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t * | pKey, | ||
| uint16_t | wKeyType, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInLen, | ||
| uint8_t * | pDivKey, | ||
| uint8_t * | pDivKeyLen | ||
| ) |
Diversify Direct Key - Note: This function invalidates the currently loaded key.
Using the key passed in the pKey parameter this function calculates a diversified key according to the wOption specified that can be used in different applications.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS |
|
| PH_ERR_UNSUPPORTED_PARAMETER | Key Type not supported (for key diversification). |
| PH_ERR_LENGTH_ERROR | Length of diversification input is wrong. |
| Other | Depending on implementation and underlying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option to specify the diversification method. One of the below mentioned information. |
| [in] | pKey | [In] Key to be loaded. Number of bytes should be based on the key type mentioned in wKeyType parameter. |
| [in] | wKeyType | [In] Type of Key to be loaded. Supported ones are |
| [in] | pDivInput | [In] Diversification Input used to diversify the key. |
| [in] | bDivInLen | [In] Length of diversification input used to diversify the key. If 0, no diversification is performed. |
| [out] | pDivKey | [Out] Diversified key. Will be of current block size. |
| [out] | pDivKeyLen | [Out] Length of bytes available in pDivKey buffer. |