File: md5.h

package info (click to toggle)
courier 0.60.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 52,288 kB
  • ctags: 12,677
  • sloc: ansic: 165,348; cpp: 24,820; sh: 16,410; perl: 6,839; makefile: 3,621; yacc: 289; sed: 16
file content (65 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (20)
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
#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

#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