QuickHash Library Type Library

HMAC_UpdateStr

int HMAC_UpdateStr( [ in,out ]HMAC_Context* pContext, [ in , string ] unsigned char* pSrc );

Return value

Nonzero if update is successful, otherwise 0. In particular, this function returns 0 when the context was improperly initialized.

Parameters

pContext

    [in/out] A memory buffer that is used as the context.

     Note. All predefined types are specified in the Predefined Types List.

 pSrc

    [in] A null-terminated string with which to update the context.

Remarks

Updates the context specified by pContext with the null-terminated string specified by pSrc. Call this function for each null-terminated string for which the HMAC is calculated. To retrieve the HMAC after using HMAC_UpdateStr, call HMAC_Final or HMAC_FinalHex.

Note. Before the first call to HMAC_Update, HMAC_UpdateStr, HMAC_Final or HMAC_FinalHex functions, the context must be initialized with HMAC_Init or HMAC_InitKeyStr.

VB Example

Private Sub MyButton_Click()   
    Dim Context As HMAC_Context
    Dim Hmac As HMAC_Digest
 
    Dim MyStrData As String
    MyStrData = "Hello World!"
    Dim MyStrKey As String
    MyStrKey = "password"
    'Initialize the context for MD5-HMAC calculations
    HMAC_InitKeyStr Context, MD5_ALGID, MyStrKey
    'Update the context 
    HMAC_UpdateStr Context, MyStrData
    'Get the MD5-HMAC
    HMAC_Final Context, Hmac 
    'Show the hexadecimal representation of the MD5-HMAC
    MsgBox QHASH_ConvertToHex(Hmac.Value(0), MD5_DIGESTSIZE, True)
End Sub

Type Library Overview   |   Type Library Functions   |   Useful Links   |   HashCalc

 

See Also    HMAC_Update, HMAC_Final, HMAC_FinalHex, HMAC_Init, HMAC_InitKeyStr, QHASH_ConvertToHex


 

 

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