aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/lgl/md5.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/lgl/md5.h')
-rw-r--r--src/daemon/https/lgl/md5.h128
1 files changed, 0 insertions, 128 deletions
diff --git a/src/daemon/https/lgl/md5.h b/src/daemon/https/lgl/md5.h
deleted file mode 100644
index 94247e46..00000000
--- a/src/daemon/https/lgl/md5.h
+++ /dev/null
@@ -1,128 +0,0 @@
1/* Declaration of functions and data types used for MD5 sum computing
2 library functions.
3 Copyright (C) 1995-1997,1999,2000,2001,2004,2005,2006
4 Free Software Foundation, Inc.
5 This file is part of the GNU C Library.
6
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as published by the
9 Free Software Foundation; either version 2.1, or (at your option) any
10 later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
20
21#ifndef _MD5_H
22#define _MD5_H 1
23
24#include <stdio.h>
25#include <stdint.h>
26
27#define MD5_DIGEST_SIZE 16
28#define MD5_BLOCK_SIZE 64
29
30#ifndef __GNUC_PREREQ
31# if defined __GNUC__ && defined __GNUC_MINOR__
32# define __GNUC_PREREQ(maj, min) \
33 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
34# else
35# define __GNUC_PREREQ(maj, min) 0
36# endif
37#endif
38
39#ifndef __THROW
40# if defined __cplusplus && __GNUC_PREREQ (2,8)
41# define __THROW throw ()
42# else
43# define __THROW
44# endif
45#endif
46
47#ifndef _LIBC
48# define __MHD_md5_buffer MHD_md5_buffer
49# define __MHD_md5_finish_ctx MHD_md5_finish_ctx
50# define __MHD_md5_init_ctx MHD_md5_init_ctx
51# define __MHD_md5_process_block MHD_md5_process_block
52# define __MHD_md5_process_bytes MHD_md5_process_bytes
53# define __MHD_md5_read_ctx MHD_md5_read_ctx
54# define __MHD_md5_stream MHD_md5_stream
55#endif
56
57/* Structure to save state of computation between the single steps. */
58struct MHD_md5_ctx
59{
60 uint32_t A;
61 uint32_t B;
62 uint32_t C;
63 uint32_t D;
64
65 uint32_t total[2];
66 uint32_t buflen;
67 uint32_t buffer[32];
68};
69
70/*
71 * The following three functions are build up the low level used in
72 * the functions `MHD_md5_stream' and `MHD_md5_buffer'.
73 */
74
75/* Initialize structure containing state of computation.
76 (RFC 1321, 3.3: Step 3) */
77extern void
78__MHD_md5_init_ctx (struct MHD_md5_ctx *ctx)
79 __THROW;
80
81/* Starting with the result of former calls of this function (or the
82 initialization function update the context for the next LEN bytes
83 starting at BUFFER.
84 It is necessary that LEN is a multiple of 64!!! */
85 extern void __MHD_md5_process_block (const void *buffer, size_t len,
86 struct MHD_md5_ctx *ctx) __THROW;
87
88/* Starting with the result of former calls of this function (or the
89 initialization function update the context for the next LEN bytes
90 starting at BUFFER.
91 It is NOT required that LEN is a multiple of 64. */
92 extern void __MHD_md5_process_bytes (const void *buffer, size_t len,
93 struct MHD_md5_ctx *ctx) __THROW;
94
95/* Process the remaining bytes in the buffer and put result from CTX
96 in first 16 bytes following RESBUF. The result is always in little
97 endian byte order, so that a byte-wise output yields to the wanted
98 ASCII representation of the message digest.
99
100 IMPORTANT: On some systems, RESBUF must be aligned to a 32-bit
101 boundary. */
102 extern void *__MHD_md5_finish_ctx (struct MHD_md5_ctx *ctx,
103 void *resbuf) __THROW;
104
105
106/* Put result from CTX in first 16 bytes following RESBUF. The result is
107 always in little endian byte order, so that a byte-wise output yields
108 to the wanted ASCII representation of the message digest.
109
110 IMPORTANT: On some systems, RESBUF must be aligned to a 32-bit
111 boundary. */
112 extern void *__MHD_md5_read_ctx (const struct MHD_md5_ctx *ctx,
113 void *resbuf) __THROW;
114
115
116/* Compute MD5 message digest for bytes read from STREAM. The
117 resulting message digest number will be written into the 16 bytes
118 beginning at RESBLOCK. */
119 extern int __MHD_md5_stream (FILE * stream, void *resblock) __THROW;
120
121/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
122 result is always in little endian byte order, so that a byte-wise
123 output yields to the wanted ASCII representation of the message
124 digest. */
125 extern void *__MHD_md5_buffer (const char *buffer, size_t len,
126 void *resblock) __THROW;
127
128#endif /* md5.h */