GNU libmicrohttpd
0.9.77
Loading...
Searching...
No Matches
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 */
MHD_MD5Update
void MHD_MD5Update(void *ctx_, const uint8_t *input, size_t len)
Definition
md5.c:269
MHD_MD5Final
void MHD_MD5Final(void *ctx_, uint8_t digest[MD5_DIGEST_SIZE])
Definition
md5.c:67
MHD_MD5Init
void MHD_MD5Init(void *ctx_)
Definition
md5.c:43
MD5_BLOCK_SIZE
#define MD5_BLOCK_SIZE
Definition
md5.h:27
MD5_DIGEST_SIZE
#define MD5_DIGEST_SIZE
Definition
md5.h:28
mhd_options.h
additional automatic macros for MHD_config.h
MD5Context
Definition
md5.h:32
MD5Context::state
uint32_t state[4]
Definition
md5.h:33
MD5Context::count
uint64_t count
Definition
md5.h:34
MD5Context::buffer
uint8_t buffer[MD5_BLOCK_SIZE]
Definition
md5.h:35
src
microhttpd
md5.h
Generated by
1.9.7