int SL_HASHCALL SL_HMAC_FinalHex( void* pContext, void* pDest, int bUpper );
Nonzero if the function succeeds, otherwise 0. In particular, this function returns 0 when the context was improperly initialized.
[in/out] Pointer to the context.
[out] Pointer to the text buffer that will receive the HMAC.
[in] Uppercase flag. If bUpper is 0, the received HMAC represents a lowercase string, otherwise it represents an uppercase string.
Call this function to retrieve the HMAC from the context pointed by pContext. The HMAC is retrieved as a null-terminated hexadecimal string in the text buffer pointed by pDest. The size of the text buffer pointed by pDest must be at least HEXDIGESTSIZE characters. HEXDIGESTSIZE is a predefined constant that specifies the size of the hexadecimal string representation of the HMAC for a specific hash algorithm. For example, you have to allocate at least SLC_SHA512_HEXDIGESTSIZE characters for the text buffer pointed by pDest if you need to calculate the HMAC using SHA-512 hash algorithm.
All supported hash algorithms with their corresponding HEXDIGESTSIZEs are listed in Table1.
After the SL_HMAC_FinalHex function is performed, the context is initialized for new calculations, as it would be called SL_HMAC_Init again.
Table1. Supported hash algorithms and their HEXDIGESTSIZEs.
|Algorithm Name||Algorithm HEXDIGESTSIZE|
HMAC API Overview | HMAC API Functions | Useful Links | HashCalc
See Also SL_HMAC_Final, SL_HMAC_Update, SL_HMAC_UpdateStr, SL_HMAC_Init, SL_HMAC_InitKeyStr
|Send Feedback to SlavaSoft Inc.||Tell a friend about QuickHash Library|