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