Adjust fileList from perl
[msysgit.git] / include / apr-0 / apr_md4.h
blob42d108df9f515be106bfd17853dd94f3b141aa65
1 /* Copyright 2001-2005 The Apache Software Foundation or its licensors, as
2 * applicable.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 /* This is derived from material copyright RSA Data Security, Inc.
17 * Their notice is reproduced below in its entirety.
19 * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
20 * rights reserved.
22 * License to copy and use this software is granted provided that it
23 * is identified as the "RSA Data Security, Inc. MD4 Message-Digest
24 * Algorithm" in all material mentioning or referencing this software
25 * or this function.
27 * License is also granted to make and use derivative works provided
28 * that such works are identified as "derived from the RSA Data
29 * Security, Inc. MD4 Message-Digest Algorithm" in all material
30 * mentioning or referencing the derived work.
32 * RSA Data Security, Inc. makes no representations concerning either
33 * the merchantability of this software or the suitability of this
34 * software for any particular purpose. It is provided "as is"
35 * without express or implied warranty of any kind.
37 * These notices must be retained in any copies of any part of this
38 * documentation and/or software.
41 #ifndef APR_MD4_H
42 #define APR_MD4_H
44 #include "apu.h"
45 #include "apr_xlate.h"
46 /**
47 * @file apr_md4.h
48 * @brief APR-UTIL MD4 Library
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
54 /**
55 * @defgroup APR_Util_MD4 MD4 Library
56 * @ingroup APR_Util
57 * @{
60 /** The digestsize for MD4 */
61 #define APR_MD4_DIGESTSIZE 16
63 /** @see apr_md4_ctx_t */
64 typedef struct apr_md4_ctx_t apr_md4_ctx_t;
66 /** MD4 context. */
67 struct apr_md4_ctx_t {
68 /** state (ABCD) */
69 apr_uint32_t state[4];
70 /** number of bits, modulo 2^64 (lsb first) */
71 apr_uint32_t count[2];
72 /** input buffer */
73 unsigned char buffer[64];
74 #if APR_HAS_XLATE
75 /** translation handle */
76 apr_xlate_t *xlate;
77 #endif
80 /**
81 * MD4 Initialize. Begins an MD4 operation, writing a new context.
82 * @param context The MD4 context to initialize.
84 APU_DECLARE(apr_status_t) apr_md4_init(apr_md4_ctx_t *context);
86 #if APR_HAS_XLATE
87 /**
88 * MDr4 translation setup. Provides the APR translation handle to be used
89 * for translating the content before calculating the digest.
90 * @param context The MD4 content to set the translation for.
91 * @param xlate The translation handle to use for this MD4 context
93 APU_DECLARE(apr_status_t) apr_md4_set_xlate(apr_md4_ctx_t *context,
94 apr_xlate_t *xlate);
95 #else
96 #define apr_md4_set_xlate(context, xlate) APR_ENOTIMPL
97 #endif
99 /**
100 * MD4 block update operation. Continue an MD4 message-digest operation,
101 * processing another message block, and updating the context.
102 * @param context The MD4 content to update.
103 * @param input next message block to update
104 * @param inputLen The length of the next message block
106 APU_DECLARE(apr_status_t) apr_md4_update(apr_md4_ctx_t *context,
107 const unsigned char *input,
108 apr_size_t inputLen);
111 * MD4 finalization. Ends an MD4 message-digest operation, writing the
112 * message digest and zeroing the context
113 * @param digest The final MD4 digest
114 * @param context The MD4 content we are finalizing.
116 APU_DECLARE(apr_status_t) apr_md4_final(
117 unsigned char digest[APR_MD4_DIGESTSIZE],
118 apr_md4_ctx_t *context);
121 * MD4 digest computation
122 * @param digest The MD4 digest
123 * @param input message block to use
124 * @param inputLen The length of the message block
126 APU_DECLARE(apr_status_t) apr_md4(unsigned char digest[APR_MD4_DIGESTSIZE],
127 const unsigned char *input,
128 apr_size_t inputLen);
130 /** @} */
131 #ifdef __cplusplus
133 #endif
135 #endif /* !APR_MD4_H */