GNU libmicrohttpd  0.9.72
md5.h
Go to the documentation of this file.
1 /*
2  * This code implements the MD5 message-digest algorithm.
3  * The algorithm is due to Ron Rivest. This code was
4  * written by Colin Plumb in 1993, no copyright is claimed.
5  * This code is in the public domain; do with it what you wish.
6  *
7  * Equivalent code is available from RSA Data Security, Inc.
8  * This code has been tested against that, and is equivalent,
9  * except that you don't need to include two pages of legalese
10  * with every copy.
11  *
12  * To compute the message digest of a chunk of bytes, declare an
13  * MD5Context structure, pass it to MHD_MD5Init, call MHD_MD5Update as
14  * needed on buffers full of bytes, and then call MHD_MD5Final, which
15  * will fill a supplied 16-byte array with the digest.
16  */
17 
18 #ifndef MHD_MD5_H
19 #define MHD_MD5_H
20 
21 #include "mhd_options.h"
22 #include <stdint.h>
23 #include <stddef.h>
24 
25 #define MD5_BLOCK_SIZE 64
26 #define MD5_DIGEST_SIZE 16
27 #define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_SIZE * 2 + 1)
28 
29 struct MD5Context
30 {
31  uint32_t state[4]; /* state */
32  uint64_t count; /* number of bytes, mod 2^64 */
33  uint8_t buffer[MD5_BLOCK_SIZE]; /* input buffer */
34 };
35 
36 
43 void
44 MHD_MD5Init (void *ctx_);
45 
46 
53 void
54 MHD_MD5Update (void *ctx_,
55  const uint8_t *input,
56  size_t len);
57 
58 
64 void
65 MHD_MD5Final (void *ctx_,
66  uint8_t digest[MD5_DIGEST_SIZE]);
67 
68 
69 #endif /* !MHD_MD5_H */
void MHD_MD5Update(void *ctx_, const uint8_t *input, size_t len)
Definition: md5.c:230
void MHD_MD5Final(void *ctx_, uint8_t digest[MD5_DIGEST_SIZE])
Definition: md5.c:61
void MHD_MD5Init(void *ctx_)
Definition: md5.c:37
#define MD5_BLOCK_SIZE
Definition: md5.h:25
#define MD5_DIGEST_SIZE
Definition: md5.h:26
additional automatic macros for MHD_config.h
Definition: md5.h:30
uint32_t state[4]
Definition: md5.h:31
uint64_t count
Definition: md5.h:32
uint8_t buffer[MD5_BLOCK_SIZE]
Definition: md5.h:33