Alex 'AdUser' Z
4 years ago
2 changed files with 18 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||||||
|
#include "../src/common.h" |
||||||
|
#include "../src/md5.h" |
||||||
|
|
||||||
|
int main() { |
||||||
|
MD5_CTX md5; |
||||||
|
char *sample = "098f6bcd4621d373cade4e832627b4f6"; // md5_hex("test")
|
||||||
|
|
||||||
|
memset(&md5, 0x0, sizeof(md5)); |
||||||
|
|
||||||
|
MD5Init(&md5); |
||||||
|
MD5Update(&md5, (unsigned char *) "test", 4); |
||||||
|
MD5Final(&md5); |
||||||
|
|
||||||
|
assert(strcmp(md5.hexdigest, sample) == 0); |
||||||
|
return 0; |
||||||
|
} |
Loading…
Reference in new issue