Dependencies:   mbed

Dependents:   TCP

Committer:
slowness
Date:
Tue Sep 06 18:05:46 2011 +0000
Revision:
0:58c3d014a4e7

        

Who changed what in which revision?

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