|
QuickHash Library |
API |
|
SL_MD4_Final
void SL_HASHCALL SL_MD4_Final( void*
pContext, void* pDest );
Parameters
pContext
[in/out] Pointer to the
context.
pDest
[out] Pointer to the memory
buffer that will receive the message digest.
Remarks
Call this function to retrieve the message digest from the
context pointed by pContext. The digest is retrieved in the memory buffer
pointed by pDest. The size of the memory buffer pointed by pDest
must be at least SLC_MD4_DIGESTSIZE bytes.
After the SL_MD4_Final function is performed, the
context is initialized for new calculations, as it would be called
SL_MD4_Init
again.
Example
#include <stdio.h>
#include <QuickHash.h>
#define BUFF_SIZE 1024
int main()
{
FILE* file;
unsigned char buff[ BUFF_SIZE ];
unsigned char context[ SLC_MD4_CONTEXTSIZE ];
unsigned char digest[ SLC_MD4_DIGESTSIZE ];
file = fopen( "c:\\test.txt", "rb" );
if( file == NULL )
return 1;
/*****Initialize the context before calling Update, Final, or FinalHex****/
SL_MD4_Init( context );
/*****Calculate the digest by calling Update for each block of the file***/
while( !feof( file ) )
{
unsigned int nCount = fread( buff, sizeof( char ), BUFF_SIZE, file );
SL_MD4_Update( context, buff, nCount );
}
/*****Do final changes and get the digest*********************************/
SL_MD4_Final( context, digest );
/*****Use the digest******************************************************/
/*...*/
fclose( file );
return 0;
}
|
|
MD4 API Overview
| MD4 Functions
|
Useful Links | HashCalc
See Also
SL_MD4_FinalHex,
SL_MD4_Update,
SL_MD4_UpdateStr,
SL_MD4_Init
|