1 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
4 * License to copy and use this software is granted provided that it
5 * is identified as the "RSA Data Security, Inc. MD5 Message-Digest
6 * Algorithm" in all material mentioning or referencing this software
9 * License is also granted to make and use derivative works provided
10 * that such works are identified as "derived from the RSA Data
11 * Security, Inc. MD5 Message-Digest Algorithm" in all material
12 * mentioning or referencing the derived work.
14 * RSA Data Security, Inc. makes no representations concerning either
15 * the merchantability of this software or the suitability of this
16 * software for any particular purpose. It is provided "as is"
17 * without express or implied warranty of any kind.
19 * These notices must be retained in any copies of any part of this
20 * documentation and/or software.
23 #ifndef __libpbd_md5_h__
24 #define __libpbd_md5_h__
29 #include "pbd/libpbd_visibility.h"
36 // an MD5 digest is a 16-byte number (32 hex digits)
37 uint8_t digestRaw[16] ;
39 // This version of the digest is actually
40 // a "printf'd" version of the digest.
41 char digestChars[33] ;
43 void writeToString ();
44 char* digestFile (char *filename);
45 char* digestMemory (uint8_t const * memchunk, size_t len);
46 char* digestString (char const *string);
50 uint32_t state[4]; /* state (ABCD) */
51 uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
52 uint8_t buffer[64]; /* input buffer */
58 void Transform (uint32_t state[4], uint8_t const * block);
59 void Encode (uint8_t *output, uint32_t const *input, size_t len);
60 void Decode (uint32_t *output, uint8_t const * input, size_t len);
61 void Update (uint8_t const *input, size_t inputLen);
66 #endif /* __libpbd_md5_h__ */