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