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
12SEC_BEGIN_PROTOS
13
14/*
15** Generic hash api.
16*/
17
18extern unsigned int HASH_ResultLen(HASH_HashType type);
19
20extern unsigned int HASH_ResultLenContext(HASHContext *context);
21
22extern unsigned int HASH_ResultLenByOidTag(SECOidTag hashOid);
23
24extern SECStatus HASH_HashBuf(HASH_HashType type,
25 unsigned char *dest,
26 const unsigned char *src,
27 PRUint32 src_len);
28
29extern HASHContext *HASH_Create(HASH_HashType type);
30
31extern HASHContext *HASH_Clone(HASHContext *context);
32
33extern void HASH_Destroy(HASHContext *context);
34
35extern void HASH_Begin(HASHContext *context);
36
37extern void HASH_Update(HASHContext *context,
38 const unsigned char *src,
39 unsigned int len);
40
41extern void HASH_End(HASHContext *context,
42 unsigned char *result,
43 unsigned int *result_len,
44 unsigned int max_result_len);
45
46extern HASH_HashType HASH_GetType(HASHContext *context);
47
48extern const SECHashObject *HASH_GetHashObject(HASH_HashType type);
49
50extern const SECHashObject *HASH_GetHashObjectByOidTag(SECOidTag hashOid);
51
52extern HASH_HashType HASH_GetHashTypeByOidTag(SECOidTag hashOid);
53extern SECOidTag HASH_GetHashOidTagByHMACOidTag(SECOidTag hmacOid);
54extern SECOidTag HASH_GetHMACOidTagByHashOidTag(SECOidTag hashOid);
55
56extern SECOidTag HASH_GetHashOidTagByHashType(HASH_HashType type);
57
58SEC_END_PROTOS
59
60#endif /* _HASH_H_ */
61

source code of include/nss/sechash.h