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