mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-25 17:36:26 -05:00
Better MD5 support with test vectors, speed test and libcrypto fast implementation.
This commit is contained in:
parent
26c0e26a33
commit
face268eb1
14 changed files with 182 additions and 53 deletions
18
util.c
18
util.c
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue