bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / native / common / jk_md5.h
1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17
18 /*
19  * This is work is derived from material Copyright RSA Data Security, Inc.
20  *
21  * The RSA copyright statement and Licence for that original material is
22  * included below. This is followed by the Apache copyright statement and
23  * licence for the modifications made to that material.
24  */
25
26 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
27    rights reserved.
28
29    License to copy and use this software is granted provided that it
30    is identified as the "RSA Data Security, Inc. MD5 Message-Digest
31    Algorithm" in all material mentioning or referencing this software
32    or this function.
33
34    License is also granted to make and use derivative works provided
35    that such works are identified as "derived from the RSA Data
36    Security, Inc. MD5 Message-Digest Algorithm" in all material
37    mentioning or referencing the derived work.
38
39    RSA Data Security, Inc. makes no representations concerning either
40    the merchantability of this software or the suitability of this
41    software for any particular purpose. It is provided "as is"
42    without express or implied warranty of any kind.
43
44    These notices must be retained in any copies of any part of this
45    documentation and/or software.
46 */
47
48 #ifndef JK_APACHE_MD5_H
49 #define JK_APACHE_MD5_H
50
51 #ifdef __cplusplus
52 extern "C"
53 {
54 #endif
55
56 /* MD5.H - header file for MD5.C */
57
58 #define JK_MD5_DIGESTSIZE 16
59
60 /* MD5 context. */
61 typedef struct
62 {
63     jk_uint32_t state[4];      /* state (ABCD) */
64     jk_uint32_t count[2];      /* number of bits, modulo 2^64 (lsb first) */
65     unsigned char buffer[64];       /* input buffer */
66 } JK_MD5_CTX;
67
68 /*
69  * Define the Magic String prefix that identifies a password as being
70  * hashed using our algorithm.
71  */
72 #define JK_MD5PW_ID "$apr1$"
73 #define JK_MD5PW_IDLEN 6
74
75 char *JK_METHOD jk_hextocstr(unsigned char *org, char *dst, int n);
76 char *JK_METHOD jk_md5(const unsigned char *org,
77                        const unsigned char *org2, char *dst);
78
79
80 #ifdef __cplusplus
81 }
82 #endif
83
84 #endif                          /* !JK_APACHE_MD5_H */