1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 /* 3 * Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. 4 * 5 * License to copy and use this software is granted provided that 6 * it is identified as the "RSA Data Security, Inc. MD5 Message- 7 * Digest Algorithm" in all material mentioning or referencing this 8 * software or this function. 9 * 10 * License is also granted to make and use derivative works 11 * provided that such works are identified as "derived from the RSA 12 * Data Security, Inc. MD5 Message-Digest Algorithm" in all 13 * material mentioning or referencing the derived work. 14 * 15 * RSA Data Security, Inc. makes no representations concerning 16 * either the merchantability of this software or the suitability 17 * of this software for any particular purpose. It is provided "as 18 * is" without express or implied warranty of any kind. 19 * 20 * These notices must be retained in any copies of any part of this 21 * documentation and/or software. 22 */ 23 24 /* 25 *********************************************************************** 26 ** md5.h -- header file for implementation of MD5 ** 27 ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** 28 ** Created: 2/17/90 RLR ** 29 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 30 ** Revised (for MD5): RLR 4/27/91 ** 31 ** -- G modified to have y&~z instead of y&z ** 32 ** -- FF, GG, HH modified to add in last register done ** 33 ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 34 ** -- distinct additive constant for each step ** 35 ** -- round 4 added, working mod 7 ** 36 *********************************************************************** 37 */ 38 39 #ifndef KRB5_RSA_MD5__ 40 #define KRB5_RSA_MD5__ 41 42 /* Data structure for MD5 (Message-Digest) computation */ 43 typedef struct { 44 krb5_ui_4 i[2]; /* number of _bits_ handled mod 2^64 */ 45 krb5_ui_4 buf[4]; /* scratch buffer */ 46 unsigned char in[64]; /* input buffer */ 47 unsigned char digest[16]; /* actual digest after MD5Final call */ 48 } krb5_MD5_CTX; 49 50 extern void krb5int_MD5Init(krb5_MD5_CTX *); 51 extern void krb5int_MD5Update(krb5_MD5_CTX *,const unsigned char *,unsigned int); 52 extern void krb5int_MD5Final(krb5_MD5_CTX *); 53 54 #define RSA_MD5_CKSUM_LENGTH 16 55 #define OLD_RSA_MD5_DES_CKSUM_LENGTH 16 56 #define NEW_RSA_MD5_DES_CKSUM_LENGTH 24 57 #define RSA_MD5_DES_CONFOUND_LENGTH 8 58 59 #endif /* KRB5_RSA_MD5__ */ 60