GNU libmicrohttpd 1.0.0
Loading...
Searching...
No Matches
md5.h
Go to the documentation of this file.
1/*
2 This file is part of GNU libmicrohttpd
3 Copyright (C) 2022 Evgeny Grin (Karlson2k)
4
5 GNU libmicrohttpd is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library.
17 If not, see <http://www.gnu.org/licenses/>.
18*/
19
26#ifndef MHD_MD5_H
27#define MHD_MD5_H 1
28
29#include "mhd_options.h"
30#include <stdint.h>
31#ifdef HAVE_STDDEF_H
32#include <stddef.h> /* for size_t */
33#endif /* HAVE_STDDEF_H */
34
38#define MD5_WORD_SIZE_BITS 32
39
43#define MD5_BYTES_IN_WORD (MD5_WORD_SIZE_BITS / 8)
44
49#define MD5_HASH_SIZE_WORDS 4
50
55#define MD5_DIGEST_SIZE_WORDS MD5_HASH_SIZE_WORDS
56
61#define MD5_DIGEST_SIZE (MD5_DIGEST_SIZE_WORDS * MD5_BYTES_IN_WORD)
62
66#define MD5_DIGEST_STRING_SIZE ((MD5_DIGEST_SIZE) * 2 + 1)
67
71#define MD5_BLOCK_SIZE_BITS 512
72
76#define MD5_BLOCK_SIZE (MD5_BLOCK_SIZE_BITS / 8)
77
81#define MD5_BLOCK_SIZE_WORDS (MD5_BLOCK_SIZE_BITS / MD5_WORD_SIZE_BITS)
82
83
87struct Md5Ctx
88{
91 uint64_t count;
92};
93
99void
100MHD_MD5_init (struct Md5Ctx *ctx);
101
102
110void
111MHD_MD5_update (struct Md5Ctx *ctx,
112 const uint8_t *data,
113 size_t length);
114
115
122void
123MHD_MD5_finish (struct Md5Ctx *ctx,
124 uint8_t digest[MD5_DIGEST_SIZE]);
125
129#define MHD_MD5_HAS_FINISH 1
130
131#endif /* MHD_MD5_H */
void MHD_MD5_finish(struct Md5Ctx *ctx, uint8_t digest[MD5_DIGEST_SIZE])
Definition md5.c:461
void MHD_MD5_update(struct Md5Ctx *ctx, const uint8_t *data, size_t length)
Definition md5.c:393
#define MD5_BLOCK_SIZE_WORDS
Definition md5.h:81
#define MD5_HASH_SIZE_WORDS
Definition md5.h:49
#define MD5_DIGEST_SIZE
Definition md5.h:61
void MHD_MD5_init(struct Md5Ctx *ctx)
Definition md5.c:41
additional automatic macros for MHD_config.h
void * data
Definition md5.h:88
uint64_t count
Definition md5.h:91
uint32_t buffer[MD5_BLOCK_SIZE_WORDS]
Definition md5.h:90
uint32_t H[MD5_HASH_SIZE_WORDS]
Definition md5.h:89