Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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/. */
5 #ifndef _HASH_H_
6 #define _HASH_H_
8 #include "seccomon.h"
9 #include "hasht.h"
10 #include "secoidt.h"
12 SEC_BEGIN_PROTOS
14 /*
15 ** Generic hash api.
16 */
18 extern unsigned int HASH_ResultLen(HASH_HashType type);
20 extern unsigned int HASH_ResultLenContext(HASHContext *context);
22 extern unsigned int HASH_ResultLenByOidTag(SECOidTag hashOid);
24 extern SECStatus HASH_HashBuf(HASH_HashType type,
25 unsigned char *dest,
26 const unsigned char *src,
27 PRUint32 src_len);
29 extern HASHContext * HASH_Create(HASH_HashType type);
31 extern HASHContext * HASH_Clone(HASHContext *context);
33 extern void HASH_Destroy(HASHContext *context);
35 extern void HASH_Begin(HASHContext *context);
37 extern void HASH_Update(HASHContext *context,
38 const unsigned char *src,
39 unsigned int len);
41 extern void HASH_End(HASHContext *context,
42 unsigned char *result,
43 unsigned int *result_len,
44 unsigned int max_result_len);
46 extern HASH_HashType HASH_GetType(HASHContext *context);
48 extern const SECHashObject * HASH_GetHashObject(HASH_HashType type);
50 extern const SECHashObject * HASH_GetHashObjectByOidTag(SECOidTag hashOid);
52 extern HASH_HashType HASH_GetHashTypeByOidTag(SECOidTag hashOid);
53 extern SECOidTag HASH_GetHashOidTagByHMACOidTag(SECOidTag hmacOid);
54 extern SECOidTag HASH_GetHMACOidTagByHashOidTag(SECOidTag hashOid);
56 SEC_END_PROTOS
58 #endif /* _HASH_H_ */