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