OLD | NEW |
| (Empty) |
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 | |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
4 /* $Id: sechash.h,v 1.11 2012/09/22 01:11:49 wtc%google.com Exp $ */ | |
5 | |
6 #ifndef _HASH_H_ | |
7 #define _HASH_H_ | |
8 | |
9 #include "seccomon.h" | |
10 #include "hasht.h" | |
11 #include "secoidt.h" | |
12 | |
13 SEC_BEGIN_PROTOS | |
14 | |
15 /* | |
16 ** Generic hash api. | |
17 */ | |
18 | |
19 extern unsigned int HASH_ResultLen(HASH_HashType type); | |
20 | |
21 extern unsigned int HASH_ResultLenContext(HASHContext *context); | |
22 | |
23 extern unsigned int HASH_ResultLenByOidTag(SECOidTag hashOid); | |
24 | |
25 extern SECStatus HASH_HashBuf(HASH_HashType type, | |
26 unsigned char *dest, | |
27 const unsigned char *src, | |
28 PRUint32 src_len); | |
29 | |
30 extern HASHContext * HASH_Create(HASH_HashType type); | |
31 | |
32 extern HASHContext * HASH_Clone(HASHContext *context); | |
33 | |
34 extern void HASH_Destroy(HASHContext *context); | |
35 | |
36 extern void HASH_Begin(HASHContext *context); | |
37 | |
38 extern void HASH_Update(HASHContext *context, | |
39 const unsigned char *src, | |
40 unsigned int len); | |
41 | |
42 extern void HASH_End(HASHContext *context, | |
43 unsigned char *result, | |
44 unsigned int *result_len, | |
45 unsigned int max_result_len); | |
46 | |
47 extern HASH_HashType HASH_GetType(HASHContext *context); | |
48 | |
49 extern const SECHashObject * HASH_GetHashObject(HASH_HashType type); | |
50 | |
51 extern const SECHashObject * HASH_GetHashObjectByOidTag(SECOidTag hashOid); | |
52 | |
53 extern HASH_HashType HASH_GetHashTypeByOidTag(SECOidTag hashOid); | |
54 extern SECOidTag HASH_GetHashOidTagByHMACOidTag(SECOidTag hmacOid); | |
55 extern SECOidTag HASH_GetHMACOidTagByHashOidTag(SECOidTag hashOid); | |
56 | |
57 SEC_END_PROTOS | |
58 | |
59 #endif /* _HASH_H_ */ | |
OLD | NEW |