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