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