Better MD5 support with test vectors, speed test and libcrypto fast implementation.

This commit is contained in:
Andrea Mazzoleni 2011-03-25 21:04:46 +01:00
parent 26c0e26a33
commit face268eb1
14 changed files with 182 additions and 53 deletions

18
util.c
View file

@ -257,3 +257,21 @@ void memxor(unsigned char* xor, const unsigned char* block, unsigned size)
}
}
#if HAVE_LIBCRYPTO
#include <openssl/md5.h>
#else
#include "md5.c"
#endif
void memmd5(void* digest, const void* src, unsigned size)
{
#if HAVE_LIBCRYPTO
MD5((void*)src, size, digest);
#else
struct md5_t md5;
md5_init(&md5);
md5_update(&md5, src, size);
md5_final(&md5, digest);
#endif
}