Artifact 0cd9bc1df44adacb82ade7b255444ce45b09754b:
- File
md5.h
— part of check-in
[02f5cea2da]
at
2011-09-08 01:47:17
on branch trunk
— CACKey 0.6.2
Updated to include sha1.c, md5.c, and asn1-x509.c in the cackey.c translation unit so that these symbols never get exported and conflict with existing programs
Updated to try harder to remove and weaken symbols from shared object (user: rkeene, size: 1475) [annotate] [blame] [check-ins using]
0000: 2f 2a 20 4d 44 35 2e 48 20 2d 20 68 65 61 64 65 /* MD5.H - heade 0010: 72 20 66 69 6c 65 20 66 6f 72 20 4d 44 35 2e 43 r file for MD5.C 0020: 0a 20 2a 2f 0a 0a 2f 2a 20 43 6f 70 79 72 69 67 . */../* Copyrig 0030: 68 74 20 28 43 29 20 31 39 39 31 2d 32 2c 20 52 ht (C) 1991-2, R 0040: 53 41 20 44 61 74 61 20 53 65 63 75 72 69 74 79 SA Data Security 0050: 2c 20 49 6e 63 2e 20 43 72 65 61 74 65 64 20 31 , Inc. Created 1 0060: 39 39 31 2e 20 41 6c 6c 0a 72 69 67 68 74 73 20 991. All.rights 0070: 72 65 73 65 72 76 65 64 2e 0a 0a 4c 69 63 65 6e reserved...Licen 0080: 73 65 20 74 6f 20 63 6f 70 79 20 61 6e 64 20 75 se to copy and u 0090: 73 65 20 74 68 69 73 20 73 6f 66 74 77 61 72 65 se this software 00a0: 20 69 73 20 67 72 61 6e 74 65 64 20 70 72 6f 76 is granted prov 00b0: 69 64 65 64 20 74 68 61 74 20 69 74 0a 69 73 20 ided that it.is 00c0: 69 64 65 6e 74 69 66 69 65 64 20 61 73 20 74 68 identified as th 00d0: 65 20 22 52 53 41 20 44 61 74 61 20 53 65 63 75 e "RSA Data Secu 00e0: 72 69 74 79 2c 20 49 6e 63 2e 20 4d 44 35 20 4d rity, Inc. MD5 M 00f0: 65 73 73 61 67 65 2d 44 69 67 65 73 74 0a 41 6c essage-Digest.Al 0100: 67 6f 72 69 74 68 6d 22 20 69 6e 20 61 6c 6c 20 gorithm" in all 0110: 6d 61 74 65 72 69 61 6c 20 6d 65 6e 74 69 6f 6e material mention 0120: 69 6e 67 20 6f 72 20 72 65 66 65 72 65 6e 63 69 ing or referenci 0130: 6e 67 20 74 68 69 73 20 73 6f 66 74 77 61 72 65 ng this software 0140: 0a 6f 72 20 74 68 69 73 20 66 75 6e 63 74 69 6f .or this functio 0150: 6e 2e 0a 0a 4c 69 63 65 6e 73 65 20 69 73 20 61 n...License is a 0160: 6c 73 6f 20 67 72 61 6e 74 65 64 20 74 6f 20 6d lso granted to m 0170: 61 6b 65 20 61 6e 64 20 75 73 65 20 64 65 72 69 ake and use deri 0180: 76 61 74 69 76 65 20 77 6f 72 6b 73 20 70 72 6f vative works pro 0190: 76 69 64 65 64 0a 74 68 61 74 20 73 75 63 68 20 vided.that such 01a0: 77 6f 72 6b 73 20 61 72 65 20 69 64 65 6e 74 69 works are identi 01b0: 66 69 65 64 20 61 73 20 22 64 65 72 69 76 65 64 fied as "derived 01c0: 20 66 72 6f 6d 20 74 68 65 20 52 53 41 20 44 61 from the RSA Da 01d0: 74 61 0a 53 65 63 75 72 69 74 79 2c 20 49 6e 63 ta.Security, Inc 01e0: 2e 20 4d 44 35 20 4d 65 73 73 61 67 65 2d 44 69 . MD5 Message-Di 01f0: 67 65 73 74 20 41 6c 67 6f 72 69 74 68 6d 22 20 gest Algorithm" 0200: 69 6e 20 61 6c 6c 20 6d 61 74 65 72 69 61 6c 0a in all material. 0210: 6d 65 6e 74 69 6f 6e 69 6e 67 20 6f 72 20 72 65 mentioning or re 0220: 66 65 72 65 6e 63 69 6e 67 20 74 68 65 20 64 65 ferencing the de 0230: 72 69 76 65 64 20 77 6f 72 6b 2e 0a 0a 52 53 41 rived work...RSA 0240: 20 44 61 74 61 20 53 65 63 75 72 69 74 79 2c 20 Data Security, 0250: 49 6e 63 2e 20 6d 61 6b 65 73 20 6e 6f 20 72 65 Inc. makes no re 0260: 70 72 65 73 65 6e 74 61 74 69 6f 6e 73 20 63 6f presentations co 0270: 6e 63 65 72 6e 69 6e 67 20 65 69 74 68 65 72 0a ncerning either. 0280: 74 68 65 20 6d 65 72 63 68 61 6e 74 61 62 69 6c the merchantabil 0290: 69 74 79 20 6f 66 20 74 68 69 73 20 73 6f 66 74 ity of this soft 02a0: 77 61 72 65 20 6f 72 20 74 68 65 20 73 75 69 74 ware or the suit 02b0: 61 62 69 6c 69 74 79 20 6f 66 20 74 68 69 73 0a ability of this. 02c0: 73 6f 66 74 77 61 72 65 20 66 6f 72 20 61 6e 79 software for any 02d0: 20 70 61 72 74 69 63 75 6c 61 72 20 70 75 72 70 particular purp 02e0: 6f 73 65 2e 20 49 74 20 69 73 20 70 72 6f 76 69 ose. It is provi 02f0: 64 65 64 20 22 61 73 20 69 73 22 0a 77 69 74 68 ded "as is".with 0300: 6f 75 74 20 65 78 70 72 65 73 73 20 6f 72 20 69 out express or i 0310: 6d 70 6c 69 65 64 20 77 61 72 72 61 6e 74 79 20 mplied warranty 0320: 6f 66 20 61 6e 79 20 6b 69 6e 64 2e 0a 0a 54 68 of any kind...Th 0330: 65 73 65 20 6e 6f 74 69 63 65 73 20 6d 75 73 74 ese notices must 0340: 20 62 65 20 72 65 74 61 69 6e 65 64 20 69 6e 20 be retained in 0350: 61 6e 79 20 63 6f 70 69 65 73 20 6f 66 20 61 6e any copies of an 0360: 79 20 70 61 72 74 20 6f 66 20 74 68 69 73 0a 64 y part of this.d 0370: 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 61 6e 64 ocumentation and 0380: 2f 6f 72 20 73 6f 66 74 77 61 72 65 2e 0a 20 2a /or software.. * 0390: 2f 0a 0a 23 69 66 6e 64 65 66 20 5f 4d 44 35 5f /..#ifndef _MD5_ 03a0: 48 5f 0a 23 64 65 66 69 6e 65 20 5f 4d 44 35 5f H_.#define _MD5_ 03b0: 48 5f 0a 0a 23 69 6e 63 6c 75 64 65 20 22 63 6f H_..#include "co 03c0: 6e 66 69 67 2e 68 22 0a 0a 23 69 66 64 65 66 20 nfig.h"..#ifdef 03d0: 48 41 56 45 5f 53 54 44 49 4e 54 5f 48 0a 23 20 HAVE_STDINT_H.# 03e0: 20 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6e 74 include <stdint 03f0: 2e 68 3e 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 .h>.#endif.#ifde 0400: 66 20 48 41 56 45 5f 49 4e 54 54 59 50 45 53 5f f HAVE_INTTYPES_ 0410: 48 0a 23 20 20 69 6e 63 6c 75 64 65 20 3c 69 6e H.# include <in 0420: 74 74 79 70 65 73 2e 68 3e 0a 23 65 6e 64 69 66 ttypes.h>.#endif 0430: 0a 0a 23 64 65 66 69 6e 65 20 4d 44 35 48 61 73 ..#define MD5Has 0440: 68 53 69 7a 65 20 31 36 0a 0a 2f 2a 20 4d 44 35 hSize 16../* MD5 0450: 20 63 6f 6e 74 65 78 74 2e 20 2a 2f 0a 74 79 70 context. */.typ 0460: 65 64 65 66 20 73 74 72 75 63 74 20 7b 0a 09 75 edef struct {..u 0470: 69 6e 74 33 32 5f 74 20 73 74 61 74 65 5b 34 5d int32_t state[4] 0480: 3b 20 20 20 20 20 20 20 2f 2a 20 73 74 61 74 65 ; /* state 0490: 20 28 41 42 43 44 29 20 2a 2f 0a 09 75 69 6e 74 (ABCD) */..uint 04a0: 33 32 5f 74 20 63 6f 75 6e 74 5b 32 5d 3b 20 20 32_t count[2]; 04b0: 20 20 20 20 20 2f 2a 20 6e 75 6d 62 65 72 20 6f /* number o 04c0: 66 20 62 69 74 73 2c 20 6d 6f 64 75 6c 6f 20 32 f bits, modulo 2 04d0: 5e 36 34 20 28 6c 73 62 20 66 69 72 73 74 29 20 ^64 (lsb first) 04e0: 2a 2f 0a 09 75 69 6e 74 38 5f 74 20 62 75 66 66 */..uint8_t buff 04f0: 65 72 5b 36 34 5d 3b 20 20 20 20 20 20 2f 2a 20 er[64]; /* 0500: 69 6e 70 75 74 20 62 75 66 66 65 72 20 2a 2f 0a input buffer */. 0510: 7d 20 4d 44 35 5f 43 54 58 3b 0a 0a 73 74 61 74 } MD5_CTX;..stat 0520: 69 63 20 76 6f 69 64 20 4d 44 35 49 6e 69 74 28 ic void MD5Init( 0530: 4d 44 35 5f 43 54 58 20 2a 29 3b 0a 73 74 61 74 MD5_CTX *);.stat 0540: 69 63 20 76 6f 69 64 20 4d 44 35 55 70 64 61 74 ic void MD5Updat 0550: 65 28 4d 44 35 5f 43 54 58 20 2a 2c 20 75 6e 73 e(MD5_CTX *, uns 0560: 69 67 6e 65 64 20 63 68 61 72 20 2a 2c 20 75 6e igned char *, un 0570: 73 69 67 6e 65 64 20 69 6e 74 29 3b 0a 73 74 61 signed int);.sta 0580: 74 69 63 20 76 6f 69 64 20 4d 44 35 46 69 6e 61 tic void MD5Fina 0590: 6c 28 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 l(unsigned char 05a0: 5b 4d 44 35 48 61 73 68 53 69 7a 65 5d 2c 20 4d [MD5HashSize], M 05b0: 44 35 5f 43 54 58 20 2a 29 3b 0a 0a 23 65 6e 64 D5_CTX *);..#end 05c0: 69 66 0a if.