| 1 | /* $NetBSD: md5.h,v 1.1.1.1 2012/03/23 21:20:01 christos Exp $ */ |
| 2 | |
| 3 | /* |
| 4 | *********************************************************************** |
| 5 | ** md5.h -- header file for implementation of MD5 ** |
| 6 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** |
| 7 | ** Created: 2/17/90 RLR ** |
| 8 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** |
| 9 | ** Revised (for MD5): RLR 4/27/91 ** |
| 10 | ** -- G modified to have y&~z instead of y&z ** |
| 11 | ** -- FF, GG, HH modified to add in last register done ** |
| 12 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** |
| 13 | ** -- distinct additive constant for each step ** |
| 14 | ** -- round 4 added, working mod 7 ** |
| 15 | *********************************************************************** |
| 16 | */ |
| 17 | |
| 18 | /* |
| 19 | *********************************************************************** |
| 20 | ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** |
| 21 | ** ** |
| 22 | ** License to copy and use this software is granted provided that ** |
| 23 | ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** |
| 24 | ** Digest Algorithm" in all material mentioning or referencing this ** |
| 25 | ** software or this function. ** |
| 26 | ** ** |
| 27 | ** License is also granted to make and use derivative works ** |
| 28 | ** provided that such works are identified as "derived from the RSA ** |
| 29 | ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** |
| 30 | ** material mentioning or referencing the derived work. ** |
| 31 | ** ** |
| 32 | ** RSA Data Security, Inc. makes no representations concerning ** |
| 33 | ** either the merchantability of this software or the suitability ** |
| 34 | ** of this software for any particular purpose. It is provided "as ** |
| 35 | ** is" without express or implied warranty of any kind. ** |
| 36 | ** ** |
| 37 | ** These notices must be retained in any copies of any part of this ** |
| 38 | ** documentation and/or software. ** |
| 39 | *********************************************************************** |
| 40 | */ |
| 41 | |
| 42 | #if !defined(__MD5_INCLUDE__) && !defined(_SYS_MD5_H) |
| 43 | |
| 44 | #ifndef __P |
| 45 | # ifdef __STDC__ |
| 46 | # define __P(x) x |
| 47 | # else |
| 48 | # define __P(x) () |
| 49 | # endif |
| 50 | #endif |
| 51 | #ifndef __STDC__ |
| 52 | # undef const |
| 53 | # define const |
| 54 | #endif |
| 55 | |
| 56 | /* typedef a 32-bit type */ |
| 57 | typedef unsigned int UINT4; |
| 58 | |
| 59 | /* Data structure for MD5 (Message-Digest) computation */ |
| 60 | typedef struct { |
| 61 | UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ |
| 62 | UINT4 buf[4]; /* scratch buffer */ |
| 63 | unsigned char in[64]; /* input buffer */ |
| 64 | unsigned char digest[16]; /* actual digest after MD5Final call */ |
| 65 | } MD5_CTX; |
| 66 | |
| 67 | extern void MD5Init __P((MD5_CTX *)); |
| 68 | extern void MD5Update __P((MD5_CTX *, unsigned char *, unsigned int)); |
| 69 | extern void MD5Final __P((unsigned char *, MD5_CTX *)); |
| 70 | |
| 71 | #define __MD5_INCLUDE__ |
| 72 | #endif /* __MD5_INCLUDE__ */ |
| 73 | |