QuickHash Library API

SL_HMAC_GetDigestSize

unsigned int SL_HASHCALL SL_HMAC_GetDigestSize( const void* pContext );

Parameters

pContext

    [in] Pointer to the context.

Remarks

Returns the size of the message digest for the hash algorithm with which the context was initialized, or 0 when the context was improperly initialized.

Example

 

#include <string.h>
#include <QuickHash.h>

int main()
{
    /*...*/

    char key[] = "Password";

    unsigned char context[ SLC_HMAC_CONTEXTSIZE( SLC_MD5_CONTEXTSIZE, SLC_MD5_BLOCKSIZE ) ];

    int nDigestSize = 0;

    /*****Initialize the context*****/

    SL_HMAC_Init( context, SLC_MD5_ALGID, key, strlen( key ) );

    /*****Get digest size*****/

    nDigestSize = SL_HMAC_GetDigestSize( context );

    /***nDigestSize is 16 at this point***/
    /*...*/

    return 0;
}

 

 

HMAC API Overview   |   HMAC API Functions   |   Useful Links   |   HashCalc

 

See Also    SL_HMAC_Init


 

 

Send Feedback to SlavaSoft Inc. Tell a friend about QuickHash Library