/**************************************************************** **************************************************************** ** ** ** (C)Copyright 2005-2006, American Megatrends Inc. ** ** ** ** All Rights Reserved. ** ** ** ** 6145-F, Northbelt Parkway, Norcross, ** ** ** ** Georgia - 30071, USA. Phone-(770)-246-8600. ** ** ** **************************************************************** ***************************************************************** * * Md5_128.c * This Code is taken from RFC 1321(RFC1321) * * *****************************************************************/ #include "md5.h" /****************************************************************************** * * Name * MD5_128 * * Abstract: * Function to compute the digest using MD5. * * Context/Scope: * Called from anywhere. * * Side Effects: * * Return Value: * None * * Assumptions: * None * ******************************************************************************/ void MD5_128(char* k, /* secret key */ int lk, /* length of the key in bytes */ char* d, /* data */ int ld, /* length of data in bytes */ char* out, /* output buffer, at least "t" bytes */ int t ) { MD5_CTX ctx; MD5_Init(&ctx) ; MD5_Update(&ctx, (unsigned char *) k, lk) ; MD5_Update(&ctx, (unsigned char *) d, ld) ; // Added this to match the MD5 for user password integrity MD5_Update(&ctx, (unsigned char *) k, lk) ; MD5_Final((unsigned char *) out,&ctx ) ; }