GME  13
apr_md4.h
Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 /* This is derived from material copyright RSA Data Security, Inc.
00017  * Their notice is reproduced below in its entirety.
00018  *
00019  * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
00020  * rights reserved.
00021  *
00022  * License to copy and use this software is granted provided that it
00023  * is identified as the "RSA Data Security, Inc. MD4 Message-Digest
00024  * Algorithm" in all material mentioning or referencing this software
00025  * or this function.
00026  *
00027  * License is also granted to make and use derivative works provided
00028  * that such works are identified as "derived from the RSA Data
00029  * Security, Inc. MD4 Message-Digest Algorithm" in all material
00030  * mentioning or referencing the derived work.
00031  *
00032  * RSA Data Security, Inc. makes no representations concerning either
00033  * the merchantability of this software or the suitability of this
00034  * software for any particular purpose. It is provided "as is"
00035  * without express or implied warranty of any kind.
00036  *
00037  * These notices must be retained in any copies of any part of this
00038  * documentation and/or software.
00039  */
00040 
00041 #ifndef APR_MD4_H
00042 #define APR_MD4_H
00043 
00044 #include "apu.h"
00045 #include "apr_xlate.h"
00050 #ifdef __cplusplus
00051 extern "C" {
00052 #endif
00053 
00061 #define APR_MD4_DIGESTSIZE 16
00062 
00064 typedef struct apr_md4_ctx_t apr_md4_ctx_t;
00065 
00067 struct apr_md4_ctx_t {
00069     apr_uint32_t state[4];
00071     apr_uint32_t count[2];
00073     unsigned char buffer[64];
00074 #if APR_HAS_XLATE
00075 
00076     apr_xlate_t *xlate;
00077 #endif
00078 };
00079 
00084 APU_DECLARE(apr_status_t) apr_md4_init(apr_md4_ctx_t *context);
00085 
00086 #if APR_HAS_XLATE
00087 
00093 APU_DECLARE(apr_status_t) apr_md4_set_xlate(apr_md4_ctx_t *context,
00094                                             apr_xlate_t *xlate);
00095 #else
00096 #define apr_md4_set_xlate(context, xlate) APR_ENOTIMPL
00097 #endif
00098 
00106 APU_DECLARE(apr_status_t) apr_md4_update(apr_md4_ctx_t *context,
00107                                          const unsigned char *input,
00108                                          apr_size_t inputLen);
00109 
00116 APU_DECLARE(apr_status_t) apr_md4_final(
00117                                     unsigned char digest[APR_MD4_DIGESTSIZE],
00118                                     apr_md4_ctx_t *context);
00119 
00126 APU_DECLARE(apr_status_t) apr_md4(unsigned char digest[APR_MD4_DIGESTSIZE],
00127                                   const unsigned char *input,
00128                                   apr_size_t inputLen);
00129 
00131 #ifdef __cplusplus
00132 }
00133 #endif
00134 
00135 #endif /* !APR_MD4_H */