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