1
/* Licensed to the Apache Software Foundation (ASF) under one or more
2
* contributor license agreements. See the NOTICE file distributed with
3
* this work for additional information regarding copyright ownership.
4
* The ASF licenses this file to You under the Apache License, Version 2.0
5
* (the "License"); you may not use this file except in compliance with
6
* the License. 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
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
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.
45
#include "apr_xlate.h"
48
* @brief APR-UTIL MD4 Library
55
* @defgroup APR_Util_MD4 MD4 Library
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;
67
struct apr_md4_ctx_t {
69
apr_uint32_t state[4];
70
/** number of bits, modulo 2^64 (lsb first) */
71
apr_uint32_t count[2];
73
unsigned char buffer[64];
75
/** translation handle */
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);
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,
96
#define apr_md4_set_xlate(context, xlate) APR_ENOTIMPL
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);
135
#endif /* !APR_MD4_H */