Main Page | Modules | Namespace List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

apr_sha1.h

Go to the documentation of this file.
00001 /* Copyright 2001-2004 The Apache Software Foundation
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *     http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 /* NIST Secure Hash Algorithm
00016  *      heavily modified by Uwe Hollerbach uh@alumni.caltech edu
00017  *      from Peter C. Gutmann's implementation as found in
00018  *      Applied Cryptography by Bruce Schneier
00019  *      This code is hereby placed in the public domain
00020  */
00021 
00022 #ifndef APR_SHA1_H
00023 #define APR_SHA1_H
00024 
00025 #include "apu.h"
00026 #include "apr_general.h"
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00038 #define APR_SHA1_DIGESTSIZE 20
00039 
00044 #define APR_SHA1PW_ID "{SHA}"
00045 
00047 #define APR_SHA1PW_IDLEN 5
00048 
00050 typedef struct apr_sha1_ctx_t apr_sha1_ctx_t;
00051 
00055 struct apr_sha1_ctx_t {
00057     apr_uint32_t digest[5];
00059     apr_uint32_t count_lo, count_hi;
00061     apr_uint32_t data[16];
00063     int local;
00064 };
00065 
00081 APU_DECLARE(void) apr_sha1_base64(const char *clear, int len, char *out);
00082 
00087 APU_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context);
00088 
00095 APU_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input,
00096                                 unsigned int inputLen);
00097 
00104 APU_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context,
00105                                        const unsigned char *input,
00106                                        unsigned int inputLen);
00107 
00113 APU_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE],
00114                                apr_sha1_ctx_t *context);
00115 
00116 #ifdef __cplusplus
00117 }
00118 #endif
00119 
00120 #endif  /* APR_SHA1_H */

Generated on Thu Sep 8 12:20:49 2005 for Apache Portable Runtime Utility Library by  doxygen 1.4.4