1 /*
2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
7  *
8  * See the COPYRIGHT file distributed with this work for additional
9  * information regarding copyright ownership.
10  */
11 
12 #pragma once
13 
14 #include <isc/lang.h>
15 
16 /*
17  * The maximal hash length that can be encoded in a name
18  * using base32hex.  floor(255/8)*5
19  */
20 #define NSEC3_MAX_HASH_LENGTH 155
21 
22 /*
23  * The maximum has that can be encoded in a single label using
24  * base32hex.  floor(63/8)*5
25  */
26 #define NSEC3_MAX_LABEL_HASH 35
27 
28 ISC_LANG_BEGINDECLS
29 
30 int
31 isc_iterated_hash(unsigned char *out, const unsigned int hashalg,
32 		  const int iterations, const unsigned char *salt,
33 		  const int saltlength, const unsigned char *in,
34 		  const int inlength);
35 
36 ISC_LANG_ENDDECLS
37