NXP NFC Reader Library  v4.040.05.011646
CryptoSym

This is only a wrapper layer to abstract the different CryptoSym implementations. More...

Collaboration diagram for CryptoSym:

Modules

 Component : Software
 Software implementation of the Symmetric Cryptography interface.
 

Functions

phStatus_t phCryptoSym_InvalidateKey (void *pDataParams)
 Invalidate the currently loaded key. More...
 
phStatus_t phCryptoSym_Encrypt (void *pDataParams, uint16_t wOption, const uint8_t *pPlainBuffer, uint16_t wBufferLength, uint8_t *pEncryptedBuffer)
 Perform Encryption with one of the supported crypto modes. More...
 
phStatus_t phCryptoSym_Decrypt (void *pDataParams, uint16_t wOption, const uint8_t *pEncryptedBuffer, uint16_t wBufferLength, uint8_t *pPlainBuffer)
 Perform Decryption with one of the supported crypto modes. More...
 
phStatus_t phCryptoSym_CalculateMac (void *pDataParams, uint16_t wOption, const uint8_t *pData, uint16_t wDataLength, uint8_t *pMac, uint8_t *pMacLength)
 Calculate MAC with one of the supported MAC modes. More...
 
phStatus_t phCryptoSym_LoadIv (void *pDataParams, const uint8_t *pIV, uint8_t bIVLength)
 Load IV. More...
 
phStatus_t phCryptoSym_LoadKey (void *pDataParams, uint16_t wKeyNo, uint16_t wKeyVersion, uint16_t wKeyType)
 Load Key. More...
 
phStatus_t phCryptoSym_LoadKeyDirect (void *pDataParams, const uint8_t *pKey, uint16_t wKeyType)
 Direct Load Key. More...
 
phStatus_t phCryptoSym_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Set configuration parameter. More...
 
phStatus_t phCryptoSym_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Get configuration parameter. More...
 
phStatus_t phCryptoSym_DiversifyKey (void *pDataParams, uint16_t wOption, uint16_t wKeyNo, uint16_t wKeyVersion, uint8_t *pDivInput, uint8_t bLenDivInput, uint8_t *pDiversifiedKey)
 Diversify Key - Note: This function invalidates the currently loaded key. More...
 
phStatus_t phCryptoSym_DiversifyDirectKey (void *pDataParams, uint16_t wOption, uint8_t *pKey, uint16_t wKeyType, uint8_t *pDivInput, uint8_t bLenDivInput, uint8_t *pDiversifiedKey)
 Diversify Direct Key - Note: This function invalidates the currently loaded key. More...
 
phStatus_t phCryptoSym_ApplyPadding (uint8_t bOption, const uint8_t *pDataIn, uint16_t wDataInLength, uint8_t bBlockSize, uint16_t wDataOutBufSize, uint8_t *pDataOut, uint16_t *pDataOutLength)
 Apply Padding to a given data buffer. More...
 
phStatus_t phCryptoSym_RemovePadding (uint8_t bOption, const uint8_t *pDataIn, uint16_t wDataInLength, uint8_t bBlockSize, uint16_t wDataOutBufSize, uint8_t *pDataOut, uint16_t *pDataOutLength)
 Remove Padding to a given data buffer. More...
 

CryptoSym Layer Configs

#define PH_CRYPTOSYM_CONFIG_KEY_TYPE   0x0000U
 Key Type. More...
 
#define PH_CRYPTOSYM_CONFIG_KEY_SIZE   0x0001U
 Key Size of currently loaded key. More...
 
#define PH_CRYPTOSYM_CONFIG_BLOCK_SIZE   0x0002U
 Block Size of currently loaded key. More...
 
#define PH_CRYPTOSYM_CONFIG_KEEP_IV   0x0003U
 Keep init vector. More...
 

Supported IV Updated Behaviour Modes

#define PH_CRYPTOSYM_VALUE_KEEP_IV_OFF   0x0000U
 Switch off Keep-IV behaviour. More...
 
#define PH_CRYPTOSYM_VALUE_KEEP_IV_ON   0x0001U
 Switch on Keep-IV behaviour. More...
 

Supported Padding Modes.

#define PH_CRYPTOSYM_PADDING_MODE_1   00U
 Pad with all zeros.
 
#define PH_CRYPTOSYM_PADDING_MODE_2   01U
 Pad with a one followed by all zeros.
 

Supported Cipher Modes

#define PH_CRYPTOSYM_CIPHER_MODE_ECB   0x00U
 ECB Cipher Mode. More...
 
#define PH_CRYPTOSYM_CIPHER_MODE_CBC   0x01U
 CBC Cipher Mode. More...
 
#define PH_CRYPTOSYM_CIPHER_MODE_CBC_DF4   0x02U
 CBC Cipher Mode for DF4. More...
 

Supported Mac Modes

#define PH_CRYPTOSYM_MAC_MODE_CMAC   0x00U
 CMAC MAC Mode. More...
 
#define PH_CRYPTOSYM_MAC_MODE_CBCMAC   0x01U
 CBCMAC MAC Mode. More...
 

Supported Key Types to be used in key loading functionality.

#define PH_CRYPTOSYM_KEY_TYPE_AES128   0x0000U
 AES 128 Key [16 Bytes]. More...
 
#define PH_CRYPTOSYM_KEY_TYPE_AES192   0x0001U
 AES 192 Key [24 Bytes]. More...
 
#define PH_CRYPTOSYM_KEY_TYPE_AES256   0x0002U
 AES 256 Key [32 Bytes]. More...
 
#define PH_CRYPTOSYM_KEY_TYPE_DES   0x0003U
 DES Single Key [8 Bytes]. More...
 
#define PH_CRYPTOSYM_KEY_TYPE_2K3DES   0x0004U
 2 Key Triple Des [16 Bytes]. More...
 
#define PH_CRYPTOSYM_KEY_TYPE_3K3DES   0x0005U
 3 Key Triple Des [24 Bytes]. More...
 
#define PH_CRYPTOSYM_KEY_TYPE_INVALID   0xFFFFU
 Invalid Key.
 
#define PH_CRYPTOSYM_KEY_TYPE_MIFARE   0x0006U
 MIFARE (R) Key. More...
 

Supported Diversification Types

#define PH_CRYPTOSYM_DIV_MODE_DESFIRE   0x0000U
 DESFire Key Diversification. More...
 
#define PH_CRYPTOSYM_DIV_MODE_MIFARE_PLUS   0x0001U
 MIFARE Plus Key Diversification. More...
 
#define PH_CRYPTOSYM_DIV_MODE_MASK   0x00FFU
 Bitmask for diversification Mode. More...
 
#define PH_CRYPTOSYM_DIV_OPTION_2K3DES_FULL   0x0000U
 Option for 2K3DES full-key diversification (only with PH_CRYPTOSYM_DIV_MODE_DESFIRE). More...
 
#define PH_CRYPTOSYM_DIV_OPTION_2K3DES_HALF   0x8000U
 Option for 2K3DES half-key diversification (only with PH_CRYPTOSYM_DIV_MODE_DESFIRE). More...
 

General DES Defines.

#define PH_CRYPTOSYM_DES_BLOCK_SIZE   8U
 Block size in DES algorithm.
 
#define PH_CRYPTOSYM_DES_KEY_SIZE   8U
 Key size in DES algorithm for 56 bit key.
 
#define PH_CRYPTOSYM_2K3DES_KEY_SIZE   16U
 Key size in AES algorithm for 112 bit key.
 
#define PH_CRYPTOSYM_3K3DES_KEY_SIZE   24U
 Key size in AES algorithm for 168 bit key.
 

General AES Defines.

#define PH_CRYPTOSYM_AES_BLOCK_SIZE   16U
 Block size in AES algorithm.
 
#define PH_CRYPTOSYM_AES128_KEY_SIZE   16U
 Key size in AES algorithm for 128 bit key.
 
#define PH_CRYPTOSYM_AES192_KEY_SIZE   24U
 Key size in AES algorithm for 192 bit key.
 
#define PH_CRYPTOSYM_AES256_KEY_SIZE   32U
 Key size in AES algorithm for 256 bit key.
 

Detailed Description

This is only a wrapper layer to abstract the different CryptoSym implementations.

With this wrapper it is possible to support more than one CryptoSym implementation in parallel, by adapting this wrapper.

Important hints for users of this component:

Macro Definition Documentation

§ PH_CRYPTOSYM_CONFIG_KEY_TYPE

§ PH_CRYPTOSYM_CONFIG_KEY_SIZE

#define PH_CRYPTOSYM_CONFIG_KEY_SIZE   0x0001U

Key Size of currently loaded key.

Read-only.

§ PH_CRYPTOSYM_CONFIG_BLOCK_SIZE

#define PH_CRYPTOSYM_CONFIG_BLOCK_SIZE   0x0002U

Block Size of currently loaded key.

Read-only.

§ PH_CRYPTOSYM_CONFIG_KEEP_IV

#define PH_CRYPTOSYM_CONFIG_KEEP_IV   0x0003U

Keep init vector.

Either PH_CRYPTOSYM_VALUE_KEEP_IV_OFF or PH_CRYPTOSYM_VALUE_KEEP_IV_ON.
This flag has to be used in combination with the option flag in the Encrypt/Decrypt/CalculateMac
function: If either the option in the function or this flag is set, the IV will be updated before
returning of the function.
R/W access possible.

§ PH_CRYPTOSYM_VALUE_KEEP_IV_OFF

#define PH_CRYPTOSYM_VALUE_KEEP_IV_OFF   0x0000U

Switch off Keep-IV behaviour.

§ PH_CRYPTOSYM_VALUE_KEEP_IV_ON

#define PH_CRYPTOSYM_VALUE_KEEP_IV_ON   0x0001U

Switch on Keep-IV behaviour.

§ PH_CRYPTOSYM_CIPHER_MODE_ECB

#define PH_CRYPTOSYM_CIPHER_MODE_ECB   0x00U

ECB Cipher Mode.

§ PH_CRYPTOSYM_CIPHER_MODE_CBC

#define PH_CRYPTOSYM_CIPHER_MODE_CBC   0x01U

CBC Cipher Mode.

§ PH_CRYPTOSYM_CIPHER_MODE_CBC_DF4

#define PH_CRYPTOSYM_CIPHER_MODE_CBC_DF4   0x02U

CBC Cipher Mode for DF4.

§ PH_CRYPTOSYM_MAC_MODE_CMAC

#define PH_CRYPTOSYM_MAC_MODE_CMAC   0x00U

CMAC MAC Mode.

§ PH_CRYPTOSYM_MAC_MODE_CBCMAC

#define PH_CRYPTOSYM_MAC_MODE_CBCMAC   0x01U

CBCMAC MAC Mode.

§ PH_CRYPTOSYM_KEY_TYPE_AES128

#define PH_CRYPTOSYM_KEY_TYPE_AES128   0x0000U

AES 128 Key [16 Bytes].

§ PH_CRYPTOSYM_KEY_TYPE_AES192

#define PH_CRYPTOSYM_KEY_TYPE_AES192   0x0001U

AES 192 Key [24 Bytes].

§ PH_CRYPTOSYM_KEY_TYPE_AES256

#define PH_CRYPTOSYM_KEY_TYPE_AES256   0x0002U

AES 256 Key [32 Bytes].

§ PH_CRYPTOSYM_KEY_TYPE_DES

#define PH_CRYPTOSYM_KEY_TYPE_DES   0x0003U

DES Single Key [8 Bytes].

§ PH_CRYPTOSYM_KEY_TYPE_2K3DES

#define PH_CRYPTOSYM_KEY_TYPE_2K3DES   0x0004U

2 Key Triple Des [16 Bytes].

§ PH_CRYPTOSYM_KEY_TYPE_3K3DES

#define PH_CRYPTOSYM_KEY_TYPE_3K3DES   0x0005U

3 Key Triple Des [24 Bytes].

§ PH_CRYPTOSYM_KEY_TYPE_MIFARE

#define PH_CRYPTOSYM_KEY_TYPE_MIFARE   0x0006U

MIFARE (R) Key.

§ PH_CRYPTOSYM_DIV_MODE_DESFIRE

#define PH_CRYPTOSYM_DIV_MODE_DESFIRE   0x0000U

DESFire Key Diversification.

§ PH_CRYPTOSYM_DIV_MODE_MIFARE_PLUS

#define PH_CRYPTOSYM_DIV_MODE_MIFARE_PLUS   0x0001U

MIFARE Plus Key Diversification.

§ PH_CRYPTOSYM_DIV_MODE_MASK

#define PH_CRYPTOSYM_DIV_MODE_MASK   0x00FFU

Bitmask for diversification Mode.

§ PH_CRYPTOSYM_DIV_OPTION_2K3DES_FULL

#define PH_CRYPTOSYM_DIV_OPTION_2K3DES_FULL   0x0000U

Option for 2K3DES full-key diversification (only with PH_CRYPTOSYM_DIV_MODE_DESFIRE).

§ PH_CRYPTOSYM_DIV_OPTION_2K3DES_HALF

#define PH_CRYPTOSYM_DIV_OPTION_2K3DES_HALF   0x8000U

Option for 2K3DES half-key diversification (only with PH_CRYPTOSYM_DIV_MODE_DESFIRE).

Function Documentation

§ phCryptoSym_InvalidateKey()

phStatus_t phCryptoSym_InvalidateKey ( void *  pDataParams)

Invalidate the currently loaded key.

Resets the key, the IV, the keep IV flag and the key Type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParamsPointer to this layer's parameter structure

§ phCryptoSym_Encrypt()

phStatus_t phCryptoSym_Encrypt ( void *  pDataParams,
uint16_t  wOption,
const uint8_t pPlainBuffer,
uint16_t  wBufferLength,
uint8_t pEncryptedBuffer 
)

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

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERwPlainBufferLength is not a multiple of the current block size.
PH_ERR_INVALID_PARAMETERAn unsupported key is loaded (or no key is loaded).
PH_ERR_UNSUPPORTED_PARAMETERAn unknown cipher option wOption is specified.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption byte specifying the cipher mode and the update behavior of the IV
[in]pPlainBufferplain data buffer
[in]wBufferLengthlength of plain and encrypted data buffer - needs to be a multiple of the current block size
[out]pEncryptedBufferencrypted data buffer

§ phCryptoSym_Decrypt()

phStatus_t phCryptoSym_Decrypt ( void *  pDataParams,
uint16_t  wOption,
const uint8_t pEncryptedBuffer,
uint16_t  wBufferLength,
uint8_t pPlainBuffer 
)

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

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERwPlainBufferLength is not a multiple of the current block size.
PH_ERR_INVALID_PARAMETERAn unsupported key is loaded (or no key is loaded).
PH_ERR_UNSUPPORTED_PARAMETERAn unknown cipher option wOption is specified.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption byte specifying the cipher mode and the update behavior of the IV
[in]pEncryptedBufferencrypted data buffer
[in]wBufferLengthlength of plain and encrypted data buffer - needs to be a multiple of the current block size
[out]pPlainBufferplain data buffer

§ phCryptoSym_CalculateMac()

phStatus_t phCryptoSym_CalculateMac ( void *  pDataParams,
uint16_t  wOption,
const uint8_t pData,
uint16_t  wDataLength,
uint8_t pMac,
uint8_t pMacLength 
)

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!

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERwDataLength is not a multiple of the current block size and the option PH_EXCHANGE_BUFFERED_BIT is set.
PH_ERR_INVALID_PARAMETERAn unsupported key is loaded (or no key is loaded).
PH_ERR_UNSUPPORTED_PARAMETERAn unknown mac option wOption is specified.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption byte specifying the MAC mode and the update behavior of the IV and the completion flag.
[in]pDatainput block; uint8_t[wDataLength]
[in]wDataLengthnumber of input data bytes
[out]pMacoutput MAC block; uint8_t[16]
[out]pMacLengthLength of MAC

§ phCryptoSym_LoadIv()

phStatus_t phCryptoSym_LoadIv ( void *  pDataParams,
const uint8_t pIV,
uint8_t  bIVLength 
)

Load IV.

Note: Before loading of an IV can be performed, a key has to be loaded upfront.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERbIVLength does not match the current block size.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]pIVIV[bIVLength].
[in]bIVLengthLength of IV.

§ phCryptoSym_LoadKey()

phStatus_t phCryptoSym_LoadKey ( void *  pDataParams,
uint16_t  wKeyNo,
uint16_t  wKeyVersion,
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.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSNo keystore specified at Init.
PH_ERR_UNSUPPORTED_PARAMETERKey Type not supported.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wKeyNoNumber of the Key
[in]wKeyVersionVersion of the key
[in]wKeyTypeType of Key

§ phCryptoSym_LoadKeyDirect()

phStatus_t phCryptoSym_LoadKeyDirect ( void *  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.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERKey Type not supported.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]pKeykey pointer to the key
[in]wKeyTypeID of the Key type

§ phCryptoSym_SetConfig()

phStatus_t phCryptoSym_SetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Set configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERInvalid (Unsupported) wConfig.
PH_ERR_INVALID_PARAMETERValid wConfig but invalid wValue for that config.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wConfigConfiguration Identifier
[in]wValueConfiguration Value

§ phCryptoSym_GetConfig()

phStatus_t phCryptoSym_GetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t pValue 
)

Get configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERInvalid (Unsupported) wConfig.
PH_ERR_INVALID_PARAMETERValue behind wConfig not valid at the moment.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wConfigConfiguration Identifier
[out]pValueConfiguration Value

§ phCryptoSym_DiversifyKey()

phStatus_t phCryptoSym_DiversifyKey ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wKeyNo,
uint16_t  wKeyVersion,
uint8_t pDivInput,
uint8_t  bLenDivInput,
uint8_t pDiversifiedKey 
)

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. The following key diversification methods are supported:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSNo keystore specified at Init.
PH_ERR_UNSUPPORTED_PARAMETERKey Type not supported (for key diversification).
PH_ERR_LENGTH_ERRORLength of diversification input is wrong.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption to specify the diversification method
[in]wKeyNoNumber of the Key
[in]wKeyVersionVersion of the key
[in]pDivInputDiversification Input used to diversify the key.
[in]bLenDivInputLength of diversification input used to diversify the key. If 0, no diversification is performed.
[out]pDiversifiedKeyDiversified key

§ phCryptoSym_DiversifyDirectKey()

phStatus_t phCryptoSym_DiversifyDirectKey ( void *  pDataParams,
uint16_t  wOption,
uint8_t pKey,
uint16_t  wKeyType,
uint8_t pDivInput,
uint8_t  bLenDivInput,
uint8_t pDiversifiedKey 
)

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. The following key diversification methods are supported:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERKey Type not supported (for key diversification).
PH_ERR_LENGTH_ERRORLength of diversification input is wrong.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption to specify the diversification method
[in]pKeyKey to be diversified
[in]wKeyTypeType of the key
[in]pDivInputDiversification Input used to diversify the key.
[in]bLenDivInputLength of diversification input used to diversify the key. If 0, no diversification is performed.
[out]pDiversifiedKeyDiversified key

§ phCryptoSym_ApplyPadding()

phStatus_t phCryptoSym_ApplyPadding ( uint8_t  bOption,
const uint8_t pDataIn,
uint16_t  wDataInLength,
uint8_t  bBlockSize,
uint16_t  wDataOutBufSize,
uint8_t pDataOut,
uint16_t pDataOutLength 
)

Apply Padding to a given data buffer.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_BUFFER_OVERFLOWwDataOutBufSize is too small.
PH_ERR_INVALID_PARAMETERUnsupported bOption.
Parameters
[in]bOptionSpecifies padding mode (1 or 2)
[in]pDataInPointer to input data array
[in]wDataInLengthLength of input data
[in]bBlockSizeBlock size to be used for padding
[in]wDataOutBufSizeSize of data array
[out]pDataOutPointer to output data array
[out]pDataOutLengthLength of output data

§ phCryptoSym_RemovePadding()

phStatus_t phCryptoSym_RemovePadding ( uint8_t  bOption,
const uint8_t pDataIn,
uint16_t  wDataInLength,
uint8_t  bBlockSize,
uint16_t  wDataOutBufSize,
uint8_t pDataOut,
uint16_t pDataOutLength 
)

Remove Padding to a given data buffer.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERwDataInLength is not a multiple of the bBlockSize parameter.
PH_ERR_INVALID_PARAMETERUnsupported bOption.
PH_ERR_FRAMING_ERRORPadding byte wrong.
Parameters
[in]bOptionSpecifies padding mode (1 or 2)
[in]pDataInPointer to input data array
[in]wDataInLengthLength of input data
[in]bBlockSizeBlock size to be used for padding
[in]wDataOutBufSizeSize of data array
[out]pDataOutPointer to output data array
[out]pDataOutLengthLength of output data