Dependents:   SNMPAgent HTTPServer think_speak_a cyassl-client ... more

Committer:
mamezu
Date:
Thu Dec 09 01:33:56 2010 +0000
Revision:
0:0f6c82fcde82

        

Who changed what in which revision?

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