summaryrefslogtreecommitdiff
path: root/usr/src/lib/libresolv2/common/dnssafe/md5.h
blob: 1a1c963a619b1dbf3f1636db2c3abf4b257a1244 (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
/*
 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#pragma ident	"%Z%%M%	%I%	%E% SMI"

/* Copyright (C) RSA Data Security, Inc. created 1994, 1996.  This is an
   unpublished work protected as such under copyright law.  This work
   contains proprietary, confidential, and trade secret information of
   RSA Data Security, Inc.  Use, disclosure or reproduction without the
   express written authorization of RSA Data Security, Inc. is
   prohibited.
 */

#ifndef _MD5_H_
#define _MD5_H_ 1

#ifdef __cplusplus
extern "C" {
#endif

#define A_MD5_DIGEST_LEN 16

#ifndef	SUNW_LIBMD5

typedef struct {
  UINT4 state[4];                                            /* state (ABCD) */
  UINT4 count[2];                 /* number of bits, modulo 2^64 (lsb first) */
  unsigned char buffer[64];                                  /* input buffer */
} A_MD5_CTX;

void A_MD5Init PROTO_LIST ((A_MD5_CTX *));
void A_MD5Update PROTO_LIST ((A_MD5_CTX *, const unsigned char *, unsigned int));
void A_MD5Final PROTO_LIST ((A_MD5_CTX *, unsigned char *));

#else

#include <sys/md5.h>
#define	A_MD5_CTX		MD5_CTX
#define	A_MD5Init(c)		MD5Init((c))
#define	A_MD5Update(c, d, l)	MD5Update((c), (d), (l))
#define	A_MD5Final(c, d)	MD5Final((d), (c))

#endif	/* SUNW_LIBMD5 */

#ifdef __cplusplus
}
#endif

#endif