summaryrefslogtreecommitdiffstats
path: root/md5/md5.h
blob: 7a99ea14a80dad79058e4144f308bb895c0cd69f (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef	md5_h
#define	md5_h

/*
** Copyright 1998 - 2001 Double Precision, Inc.
** See COPYING for distribution information.
*/

/*
** RFC 1321 MD5 Message digest calculation.
**
** Returns a pointer to a sixteen-byte message digest.
*/

#ifdef	__cplusplus
extern "C" {
#endif

#if	HAVE_CONFIG_H
#include	"md5/config.h"
#endif

#if	HAVE_SYS_TYPES_H
#include	<sys/types.h>
#endif

#if	HAVE_STDINT_H
#include	<stdint.h>
#endif
#define	MD5_DIGEST_SIZE	16
#define	MD5_BLOCK_SIZE	64

typedef unsigned char MD5_DIGEST[MD5_DIGEST_SIZE];

#ifdef	MD5_INTERNAL

struct MD5_CONTEXT {

	MD5_WORD	A, B, C, D;

	unsigned char blk[MD5_BLOCK_SIZE];
	unsigned blk_ptr;
	} ;

void md5_context_init(struct MD5_CONTEXT *);
void md5_context_hash(struct MD5_CONTEXT *,
		const unsigned char[MD5_BLOCK_SIZE]);
void md5_context_hashstream(struct MD5_CONTEXT *, const void *, unsigned);
void md5_context_endstream(struct MD5_CONTEXT *, unsigned long);
void md5_context_digest(struct MD5_CONTEXT *, MD5_DIGEST);

void md5_context_restore(struct MD5_CONTEXT *, const MD5_DIGEST);

#endif

void md5_digest(const void *msg, unsigned int len, MD5_DIGEST);

char *md5_crypt_redhat(const char *, const char *);
#define	md5_crypt	md5_crypt_redhat

const char *md5_hash_courier(const char *);
const char *md5_hash_raw(const char *);

#ifdef	__cplusplus
} ;
#endif

#endif