sechash.h (1626B)
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 5 #ifndef _HASH_H_ 6 #define _HASH_H_ 7 8 #include "seccomon.h" 9 #include "hasht.h" 10 #include "secoidt.h" 11 #include "pkcs11t.h" 12 #include "nsshash.h" 13 14 SEC_BEGIN_PROTOS 15 16 /* 17 ** Generic hash api. 18 */ 19 20 extern unsigned int HASH_ResultLen(HASH_HashType type); 21 22 extern unsigned int HASH_ResultLenContext(HASHContext *context); 23 24 extern unsigned int HASH_ResultLenByOidTag(SECOidTag hashOid); 25 26 extern SECStatus HASH_HashBuf(HASH_HashType type, 27 unsigned char *dest, 28 const unsigned char *src, 29 PRUint32 src_len); 30 31 extern HASHContext *HASH_Create(HASH_HashType type); 32 33 extern HASHContext *HASH_Clone(HASHContext *context); 34 35 extern void HASH_Destroy(HASHContext *context); 36 37 extern void HASH_Begin(HASHContext *context); 38 39 extern void HASH_Update(HASHContext *context, 40 const unsigned char *src, 41 unsigned int len); 42 43 extern void HASH_End(HASHContext *context, 44 unsigned char *result, 45 unsigned int *result_len, 46 unsigned int max_result_len); 47 48 extern HASH_HashType HASH_GetType(HASHContext *context); 49 50 extern const SECHashObject *HASH_GetHashObject(HASH_HashType type); 51 52 extern const SECHashObject *HASH_GetHashObjectByOidTag(SECOidTag hashOid); 53 54 extern CK_RSA_PKCS_MGF_TYPE SEC_GetMgfTypeByOidTag(SECOidTag tag); 55 56 SEC_END_PROTOS 57 58 #endif /* _HASH_H_ */