-
Notifications
You must be signed in to change notification settings - Fork 1
/
md5.h
33 lines (25 loc) · 1010 Bytes
/
md5.h
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
32
33
#ifndef _MD5_H_
#define _MD5_H_
/*------------------------------------------------------------------*\
file: md5.h (taken from alock, based on opensd m5d)
about: implements md5-checksumming
author: m. gumz <[email protected]>
license: see md5.c
\*------------------------------------------------------------------*/
#include <stddef.h>
enum {
MD5_BLOCK_LENGTH = 64,
MD5_DIGEST_LENGTH = 16,
MD5_DIGEST_STRING_LENGTH = (MD5_DIGEST_LENGTH*2) + 1
};
typedef struct {
unsigned int state[4]; /* state */
unsigned long long count; /* number of bits, mod 2^64 */
unsigned char buffer[MD5_BLOCK_LENGTH]; /* input buffer */
} md5Context;
extern void md5_init(md5Context*);
extern void md5_update(md5Context*, const unsigned char[], size_t);
extern void md5_pad(md5Context*);
extern void md5_final(unsigned char[MD5_DIGEST_LENGTH], md5Context*);
extern void md5_transform(unsigned int [4], const unsigned char[MD5_BLOCK_LENGTH]);
#endif