mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 14:29:34 +08:00
optimize md5 code
This commit is contained in:
parent
fb54df66e4
commit
0de85dd736
10
lib/md5.c
10
lib/md5.c
@ -302,11 +302,15 @@ void md5_finish( md5_context *ctx, unsigned char output[16] )
|
||||
*/
|
||||
void md5( const unsigned char *input, size_t ilen, unsigned char output[16] )
|
||||
{
|
||||
md5_context ctx;
|
||||
|
||||
static md5_context ctx;
|
||||
static int done=0;
|
||||
if(done==0)
|
||||
{
|
||||
md5_init( &ctx );
|
||||
done=1;
|
||||
}
|
||||
md5_starts( &ctx );
|
||||
md5_update( &ctx, input, ilen );
|
||||
md5_finish( &ctx, output );
|
||||
md5_free( &ctx );
|
||||
//md5_free( &ctx );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user