1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/cryptohi/sechash.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef _HASH_H_ 1.9 +#define _HASH_H_ 1.10 + 1.11 +#include "seccomon.h" 1.12 +#include "hasht.h" 1.13 +#include "secoidt.h" 1.14 + 1.15 +SEC_BEGIN_PROTOS 1.16 + 1.17 +/* 1.18 +** Generic hash api. 1.19 +*/ 1.20 + 1.21 +extern unsigned int HASH_ResultLen(HASH_HashType type); 1.22 + 1.23 +extern unsigned int HASH_ResultLenContext(HASHContext *context); 1.24 + 1.25 +extern unsigned int HASH_ResultLenByOidTag(SECOidTag hashOid); 1.26 + 1.27 +extern SECStatus HASH_HashBuf(HASH_HashType type, 1.28 + unsigned char *dest, 1.29 + const unsigned char *src, 1.30 + PRUint32 src_len); 1.31 + 1.32 +extern HASHContext * HASH_Create(HASH_HashType type); 1.33 + 1.34 +extern HASHContext * HASH_Clone(HASHContext *context); 1.35 + 1.36 +extern void HASH_Destroy(HASHContext *context); 1.37 + 1.38 +extern void HASH_Begin(HASHContext *context); 1.39 + 1.40 +extern void HASH_Update(HASHContext *context, 1.41 + const unsigned char *src, 1.42 + unsigned int len); 1.43 + 1.44 +extern void HASH_End(HASHContext *context, 1.45 + unsigned char *result, 1.46 + unsigned int *result_len, 1.47 + unsigned int max_result_len); 1.48 + 1.49 +extern HASH_HashType HASH_GetType(HASHContext *context); 1.50 + 1.51 +extern const SECHashObject * HASH_GetHashObject(HASH_HashType type); 1.52 + 1.53 +extern const SECHashObject * HASH_GetHashObjectByOidTag(SECOidTag hashOid); 1.54 + 1.55 +extern HASH_HashType HASH_GetHashTypeByOidTag(SECOidTag hashOid); 1.56 +extern SECOidTag HASH_GetHashOidTagByHMACOidTag(SECOidTag hmacOid); 1.57 +extern SECOidTag HASH_GetHMACOidTagByHashOidTag(SECOidTag hashOid); 1.58 + 1.59 +SEC_END_PROTOS 1.60 + 1.61 +#endif /* _HASH_H_ */