NXP Reader Library  v17.1.0.2535
Component : mBedTLS

Initialize the CryptoSym with mBedTLS as sub-component. More...

Collaboration diagram for Component : mBedTLS:

Data Structures

struct  phCryptoSym_mBedTLS_DataParams_t
 Data structure for Symmetric Crypto mBedTLS layer implementation. More...
 

Functions

phStatus_t phCryptoSym_mBedTLS_Init (phCryptoSym_mBedTLS_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pKeyStoreDataParams, uint8_t *pAddData_Buffer, uint16_t wAddData_Size)
 Initialize the CryptoSym with mBedTLS as sub-component. More...
 
phStatus_t phCryptoSym_mBedTLS_DeInit (phCryptoSym_mBedTLS_DataParams_t *pDataParams)
 De-Initialize the CryptoSym with mBedTLS as sub-component. More...
 

Detailed Description

Initialize the CryptoSym with mBedTLS as sub-component.

Note
  • LRP (Leakage Resilient Primitive) feature is not supported.
  • CMAC implementation of mBedTLS library is not utilized due to below mentioned reason(s)
    • When using MIFARE DESFire EVx AL component, CMAC computation excluding the first call requires IV of the last subsequent calls. Here the IV is only zero for the first call and non zero for the rest of the calls. This behavior is required for EV1 Secure messaging of MIFARE DESFire product.
    • Its not possible to update the IV for intermediate / final calls provide by mBedTLS.
    • To over come this, CMAC is implemented directly in this component using cipher interfaces of mBedTLS.
    • The above limitation is valid only for CalculateMac interface.
  • CMAC implementation of mBedTLS library is not utilized due to below mentioned reason(s)
    • CMAC implementation provided by mBedTLS library do not support 3DES-2Key key diversification.
    • Based on AN10922 CryptoSym should support diversification of 3DES-2Key but mBedTLS CMAC library do not support this key type.
    • To over come this, CMAC is implemented directly in this component using cipher interfaces of mBedTLS.
    • The above limitation is valid only for below mentioned interfaces.
  • Additional Data for CCM or CCM* cipher mode can be set using Load Additional Data interface.
  • Tag Length can be configured using GetConfig with Tag Length as configuration identifier.
  • Tag information can be configured using Set Authentication Tag for Decryption operation. Refer Decryption interface for more information.
  • Tag information can be retrieved using Get Authentication Tag for Encryption operation. Refer Encryption interface for more details.
  • Refer Encryption interface for more details on CCM output behavior
  • Refer Decryption interface for more details on CCM Input behavior

Function Documentation

◆ phCryptoSym_mBedTLS_Init()

phStatus_t phCryptoSym_mBedTLS_Init ( phCryptoSym_mBedTLS_DataParams_t pDataParams,
uint16_t  wSizeOfDataParams,
void *  pKeyStoreDataParams,
uint8_t pAddData_Buffer,
uint16_t  wAddData_Size 
)

Initialize the CryptoSym with mBedTLS as sub-component.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMS
  • If the input size do not match the DataParams size of this component.
  • If any of the DataParams are null.
PH_ERR_INVALID_PARAMETER
  • If wAddData_Size > 0 and pAddData_Buffer is NULL.
  • If wAddData_Size > Maximum size (65280).
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wSizeOfDataParams[In] Specifies the size of the data parameter structure.
[in]pKeyStoreDataParams[In] Pointer to a key store structure (can be null).
[in]pAddData_Buffer[In] Pointer to Additional Data buffer (can be null). This is used for AES-CCM or AES-CCM* Cipher mode
[in]wAddData_Size[In] Size allocated for pAddData_Buffer.
  • Non zero if null is not provided for pAddData_Buffer. Maximum size should be less than 2^16 - 2^8 = 65280.
  • Zero if null is provided for pAddData_Buffer

◆ phCryptoSym_mBedTLS_DeInit()

phStatus_t phCryptoSym_mBedTLS_DeInit ( phCryptoSym_mBedTLS_DataParams_t pDataParams)

De-Initialize the CryptoSym with mBedTLS as sub-component.

Note
Its must to call this interface to Un-initialize any used global context from other libraries. If not called, there might be unusual behavior for the next executions.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.