Dependencies:   mbed

Committer:
robertcook
Date:
Wed Jun 13 18:39:46 2012 +0000
Revision:
0:32a0996dff0f

        

Who changed what in which revision?

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