GNU libmicrohttpd  0.9.76
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 #ifdef HAVE_STDDEF_H
24 #include <stddef.h>
25 #endif /* HAVE_STDDEF_H */
26 
27 #define MD5_BLOCK_SIZE 64
28 #define MD5_DIGEST_SIZE 16
29 #define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_SIZE * 2 + 1)
30 
31 struct MD5Context
32 {
33  uint32_t state[4]; /* state */
34  uint64_t count; /* number of bytes, mod 2^64 */
35  uint8_t buffer[MD5_BLOCK_SIZE]; /* input buffer */
36 };
37 
38 
45 void
46 MHD_MD5Init (void *ctx_);
47 
48 
55 void
56 MHD_MD5Update (void *ctx_,
57  const uint8_t *input,
58  size_t len);
59 
60 
66 void
67 MHD_MD5Final (void *ctx_,
68  uint8_t digest[MD5_DIGEST_SIZE]);
69 
70 
71 #endif /* !MHD_MD5_H */
void MHD_MD5Update(void *ctx_, const uint8_t *input, size_t len)
Definition: md5.c:269
void MHD_MD5Final(void *ctx_, uint8_t digest[MD5_DIGEST_SIZE])
Definition: md5.c:67
void MHD_MD5Init(void *ctx_)
Definition: md5.c:43
#define MD5_BLOCK_SIZE
Definition: md5.h:27
#define MD5_DIGEST_SIZE
Definition: md5.h:28
additional automatic macros for MHD_config.h
Definition: md5.h:32
uint32_t state[4]
Definition: md5.h:33
uint64_t count
Definition: md5.h:34
uint8_t buffer[MD5_BLOCK_SIZE]
Definition: md5.h:35