summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibrhash/librhash/md5.h
blob: 1af6f133c925077ed43ef782d50757805be9b9e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* md5.h */
#ifndef MD5_HIDER
#define MD5_HIDER
#include "ustd.h"

#ifdef __cplusplus
extern "C" {
#endif

#define md5_block_size 64
#define md5_hash_size  16

/* algorithm context */
typedef struct md5_ctx
{
	unsigned message[md5_block_size / 4]; /* 512-bit buffer for leftovers */
	uint64_t length;   /* number of processed bytes */
	unsigned hash[4];  /* 128-bit algorithm internal hashing state */
} md5_ctx;

/* hash functions */

void rhash_md5_init(md5_ctx *ctx);
void rhash_md5_update(md5_ctx *ctx, const unsigned char* msg, size_t size);
void rhash_md5_final(md5_ctx *ctx, unsigned char result[16]);

#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

#endif /* MD5_HIDER */