1 /* $OpenBSD: md5.h,v 1.3 2002/03/14 01:26:46 millert Exp $ */ 2 /* $NetBSD: md5.h,v 1.1 2000/08/20 14:58:38 mrg Exp $ */ 3 4 /* 5 * This file is derived from the RSA Data Security, Inc. MD5 Message-Digest 6 * Algorithm and has been modified by Jason R. Thorpe <thorpej@NetBSD.ORG> 7 * for portability and formatting. 8 */ 9 10 /* 11 * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 12 * rights reserved. 13 * 14 * License to copy and use this software is granted provided that it 15 * is identified as the "RSA Data Security, Inc. MD5 Message-Digest 16 * Algorithm" in all material mentioning or referencing this software 17 * or this function. 18 * 19 * License is also granted to make and use derivative works provided 20 * that such works are identified as "derived from the RSA Data 21 * Security, Inc. MD5 Message-Digest Algorithm" in all material 22 * mentioning or referencing the derived work. 23 * 24 * RSA Data Security, Inc. makes no representations concerning either 25 * the merchantability of this software or the suitability of this 26 * software for any particular purpose. It is provided "as is" 27 * without express or implied warranty of any kind. 28 * 29 * These notices must be retained in any copies of any part of this 30 * documentation and/or software. 31 */ 32 33 #ifndef _SYS_MD5_H_ 34 #define _SYS_MD5_H_ 35 36 #include <sys/types.h> 37 38 /* MD5 context. */ 39 typedef struct MD5Context { 40 u_int32_t state[4]; /* state (ABCD) */ 41 u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ 42 unsigned char buffer[64]; /* input buffer */ 43 } MD5_CTX; 44 45 __BEGIN_DECLS 46 void MD5Init(MD5_CTX *); 47 void MD5Update(MD5_CTX *, const unsigned char *, unsigned int); 48 void MD5Final(unsigned char[16], MD5_CTX *); 49 #ifndef _KERNEL 50 char *MD5End(MD5_CTX *, char *); 51 char *MD5File(const char *, char *); 52 char *MD5Data(const unsigned char *, unsigned int, char *); 53 #endif /* _KERNEL */ 54 __END_DECLS 55 56 #endif /* _SYS_MD5_H_ */ 57