hattori&ide

Dependencies:   mbed

Committer:
hattori_atsushi
Date:
Sun Dec 18 08:16:01 2022 +0000
Revision:
0:f77369cabd75
hattori

Who changed what in which revision?

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