OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 #ifndef _HASH_H_ | 5 #ifndef _HASH_H_ |
6 #define _HASH_H_ | 6 #define _HASH_H_ |
7 | 7 |
8 #include "seccomon.h" | 8 #include "seccomon.h" |
9 #include "hasht.h" | 9 #include "hasht.h" |
10 #include "secoidt.h" | 10 #include "secoidt.h" |
11 | 11 |
12 SEC_BEGIN_PROTOS | 12 SEC_BEGIN_PROTOS |
13 | 13 |
14 /* | 14 /* |
15 ** Generic hash api. | 15 ** Generic hash api. |
16 */ | 16 */ |
17 | 17 |
18 extern unsigned int HASH_ResultLen(HASH_HashType type); | 18 extern unsigned int HASH_ResultLen(HASH_HashType type); |
19 | 19 |
20 extern unsigned int HASH_ResultLenContext(HASHContext *context); | 20 extern unsigned int HASH_ResultLenContext(HASHContext *context); |
21 | 21 |
22 extern unsigned int HASH_ResultLenByOidTag(SECOidTag hashOid); | 22 extern unsigned int HASH_ResultLenByOidTag(SECOidTag hashOid); |
23 | 23 |
24 extern SECStatus HASH_HashBuf(HASH_HashType type, | 24 extern SECStatus HASH_HashBuf(HASH_HashType type, unsigned char *dest, |
25 » » » » unsigned char *dest, | 25 const unsigned char *src, PRUint32 src_len); |
26 » » » » const unsigned char *src, | |
27 » » » » PRUint32 src_len); | |
28 | 26 |
29 extern HASHContext * HASH_Create(HASH_HashType type); | 27 extern HASHContext *HASH_Create(HASH_HashType type); |
30 | 28 |
31 extern HASHContext * HASH_Clone(HASHContext *context); | 29 extern HASHContext *HASH_Clone(HASHContext *context); |
32 | 30 |
33 extern void HASH_Destroy(HASHContext *context); | 31 extern void HASH_Destroy(HASHContext *context); |
34 | 32 |
35 extern void HASH_Begin(HASHContext *context); | 33 extern void HASH_Begin(HASHContext *context); |
36 | 34 |
37 extern void HASH_Update(HASHContext *context, | 35 extern void HASH_Update(HASHContext *context, const unsigned char *src, |
38 » » » » const unsigned char *src, | 36 unsigned int len); |
39 » » » » unsigned int len); | |
40 | 37 |
41 extern void HASH_End(HASHContext *context, | 38 extern void HASH_End(HASHContext *context, unsigned char *result, |
42 » » » unsigned char *result, | 39 unsigned int *result_len, unsigned int max_result_len); |
43 » » » unsigned int *result_len, | 40 |
44 » » » unsigned int max_result_len); | |
45 » » » | |
46 extern HASH_HashType HASH_GetType(HASHContext *context); | 41 extern HASH_HashType HASH_GetType(HASHContext *context); |
47 | 42 |
48 extern const SECHashObject * HASH_GetHashObject(HASH_HashType type); | 43 extern const SECHashObject *HASH_GetHashObject(HASH_HashType type); |
49 | 44 |
50 extern const SECHashObject * HASH_GetHashObjectByOidTag(SECOidTag hashOid); | 45 extern const SECHashObject *HASH_GetHashObjectByOidTag(SECOidTag hashOid); |
51 | 46 |
52 extern HASH_HashType HASH_GetHashTypeByOidTag(SECOidTag hashOid); | 47 extern HASH_HashType HASH_GetHashTypeByOidTag(SECOidTag hashOid); |
53 extern SECOidTag HASH_GetHashOidTagByHMACOidTag(SECOidTag hmacOid); | 48 extern SECOidTag HASH_GetHashOidTagByHMACOidTag(SECOidTag hmacOid); |
54 extern SECOidTag HASH_GetHMACOidTagByHashOidTag(SECOidTag hashOid); | 49 extern SECOidTag HASH_GetHMACOidTagByHashOidTag(SECOidTag hashOid); |
55 | 50 |
56 SEC_END_PROTOS | 51 SEC_END_PROTOS |
57 | 52 |
58 #endif /* _HASH_H_ */ | 53 #endif /* _HASH_H_ */ |
OLD | NEW |