1#include <sys/types.h>
2
3#include <string.h>
4
5#include <openssl/md5.h>
6
7#include <rumprun/tester.h>
8
9#define TESTSTRING "sum test string this is"
10
11static unsigned char expected[MD5_DIGEST_LENGTH] = {
12	0x20, 0x62, 0xda, 0xe2, 0xa3, 0xb4, 0x1d, 0xc7,
13	0x0c, 0x23, 0x3f, 0x25, 0xd8, 0xff, 0x5b, 0x6e,
14};
15
16int
17rumprun_test(int argc, char *argv[])
18{
19	unsigned char md5sum[MD5_DIGEST_LENGTH];
20	MD5_CTX md5ctx;
21
22	MD5_Init(&md5ctx);
23	MD5_Update(&md5ctx, TESTSTRING, sizeof(TESTSTRING)-1);
24	MD5_Final(md5sum, &md5ctx);
25
26	return memcmp(expected, md5sum, sizeof(expected));
27}
28