]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/include/private/svn_pseudo_md5.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / include / private / svn_pseudo_md5.h
1 /**
2  * @copyright
3  * ====================================================================
4  *    Licensed to the Apache Software Foundation (ASF) under one
5  *    or more contributor license agreements.  See the NOTICE file
6  *    distributed with this work for additional information
7  *    regarding copyright ownership.  The ASF licenses this file
8  *    to you under the Apache License, Version 2.0 (the
9  *    "License"); you may not use this file except in compliance
10  *    with the License.  You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *    Unless required by applicable law or agreed to in writing,
15  *    software distributed under the License is distributed on an
16  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  *    KIND, either express or implied.  See the License for the
18  *    specific language governing permissions and limitations
19  *    under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_pseudo_md5.h
24  * @brief Subversion hash sum calculation for runtime data (only)
25  */
26
27 #ifndef SVN_PSEUDO_MD5_H
28 #define SVN_PSEUDO_MD5_H
29
30 #include <apr.h>        /* for apr_uint32_t */
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35
36 \f
37 /**
38  * Calculates a hash sum for 15 bytes in @a x and returns it in @a digest.
39  * The most significant byte in @a x must be 0 (independent of being on a
40  * little or big endian machine).
41  *
42  * @note Use for runtime data hashing only.
43  *
44  * @note The output is NOT an MD5 digest shares has the same basic
45  *       cryptographic properties.  Collisions with proper MD5 on the same
46  *       or other input data is equally unlikely as any MD5 collision.
47  */
48 void svn__pseudo_md5_15(apr_uint32_t digest[4],
49                         const apr_uint32_t x[4]);
50
51 /**
52  * Calculates a hash sum for 31 bytes in @a x and returns it in @a digest.
53  * The most significant byte in @a x must be 0 (independent of being on a
54  * little or big endian machine).
55  *
56  * @note Use for runtime data hashing only.
57  *
58  * @note The output is NOT an MD5 digest shares has the same basic
59  *       cryptographic properties.  Collisions with proper MD5 on the same
60  *       or other input data is equally unlikely as any MD5 collision.
61  */
62 void svn__pseudo_md5_31(apr_uint32_t digest[4],
63                         const apr_uint32_t x[8]);
64
65 /**
66  * Calculates a hash sum for 63 bytes in @a x and returns it in @a digest.
67  * The most significant byte in @a x must be 0 (independent of being on a
68  * little or big endian machine).
69  *
70  * @note Use for runtime data hashing only.
71  *
72  * @note The output is NOT an MD5 digest shares has the same basic
73  *       cryptographic properties.  Collisions with proper MD5 on the same
74  *       or other input data is equally unlikely as any MD5 collision.
75  */
76 void svn__pseudo_md5_63(apr_uint32_t digest[4],
77                         const apr_uint32_t x[16]);
78
79 #ifdef __cplusplus
80 }
81 #endif /* __cplusplus */
82
83 #endif /* SVN_PSEUDO_MD5_H */