File indexing completed on 2025-01-17 09:55:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _MD5_H_
0016 #define _MD5_H_
0017
0018 #include <sys/types.h>
0019
0020 #include <stdint.h>
0021
0022 #define MD5_BLOCK_LENGTH 64
0023 #define MD5_DIGEST_LENGTH 16
0024 #define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH * 2 + 1)
0025
0026 typedef struct MD5Context {
0027 uint32_t state[4];
0028 uint64_t count;
0029 uint8_t buffer[MD5_BLOCK_LENGTH];
0030 } MD5_CTX;
0031
0032 #ifdef __cplusplus
0033 extern "C" {
0034 #endif
0035
0036 void MD5Init(MD5_CTX *);
0037 void MD5Update(MD5_CTX *, const uint8_t *, size_t);
0038 void MD5Pad(MD5_CTX *);
0039 void MD5Final(uint8_t [MD5_DIGEST_LENGTH], MD5_CTX *);
0040 void MD5Transform(uint32_t [4], const uint8_t [MD5_BLOCK_LENGTH]);
0041 char *MD5End(MD5_CTX *, char *);
0042 char *MD5File(const char *, char *);
0043 char *MD5FileChunk(const char *, char *, off_t, off_t);
0044 char *MD5Data(const uint8_t *, size_t, char *);
0045
0046 #ifdef __cplusplus
0047 }
0048 #endif
0049
0050
0051
0052
0053 #ifdef LIBMD_MD5_ALADDIN
0054
0055
0056
0057
0058
0059
0060 typedef uint8_t md5_byte_t;
0061 typedef uint32_t md5_word_t;
0062 typedef MD5_CTX md5_state_t;
0063
0064 #define md5_init(pms) MD5Init(pms)
0065 #define md5_append(pms, data, nbytes) MD5Update(pms, data, nbytes)
0066 #define md5_finish(pms, digest) MD5Final(digest, pms)
0067
0068 #endif
0069
0070 #endif