Dependencies:   mbed

Committer:
gbeardall
Date:
Mon Oct 17 10:39:17 2011 +0000
Revision:
0:715023d993d6

        

Who changed what in which revision?

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