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