NXP Reader Library  v17.1.0.2535
Commands_Hash

Describes about the ASymmetric Crypto's Hash related commands. More...

Collaboration diagram for Commands_Hash:

Functions

phStatus_t phCryptoASym_ComputeHash (void *pDataParams, uint16_t wOption, uint8_t bHashAlgo, uint8_t *pMessage, uint16_t wMsgLen, uint8_t *pHash, uint16_t *pHashLen)
 Computes Hash for the given message. More...
 

Detailed Description

Describes about the ASymmetric Crypto's Hash related commands.

Function Documentation

◆ phCryptoASym_ComputeHash()

phStatus_t phCryptoASym_ComputeHash ( void *  pDataParams,
uint16_t  wOption,
uint8_t  bHashAlgo,
uint8_t pMessage,
uint16_t  wMsgLen,
uint8_t pHash,
uint16_t pHashLen 
)

Computes Hash for the given message.

Note
Start, Update and Finish operation are supported and can be exercised by using wOption parameter.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_HASH_ALGOHash Algorithm not supported. Refer bHashAlgo parameter description.
PH_ERR_INVALID_PARAMETER- If Hashing algorithm is No-Hashing and buffering options is not PH_EXCHANGE_DEFAULT.
  • If the buffers are null.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure
[in]wOption[In] Buffering options for Hashing the message. These flags can be used for intermediate Hash operation
  • PH_EXCHANGE_DEFAULT : Computes the Hash for the Message and returns the Hash. This performs Start, Update and Finish in one operation.
  • PH_EXCHANGE_BUFFER_FIRST: Computes the Hash and saves for completion. This is equivalent to Start and here the Hash is not provided.
  • PH_EXCHANGE_BUFFER_CONT : Computes the Hash along with the previous hash data and saves for completion. This is equivalent to Update and here the Hash is not provided.
  • PH_EXCHANGE_BUFFER_LAST : Computes the Hash along with the previous hash data. This is equivalent to Finish and here the Hash is provided.
[in]bHashAlgo[In] Hashing Algorithm to use. Refer Hash Algorithm.
[in]pMessage[In] Input message to be Hashed.
[in]wMsgLen[In] Length of bytes available in pMessage buffer.
[out]pHash[Out] The Hashed information for the message based on hashing algorithm.
[out]pHashLen[Out] Length of bytes available in pHash buffer.