2 * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
17 /* $Id: iterated_hash.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */
19 #ifndef ISC_ITERATED_HASH_H
20 #define ISC_ITERATED_HASH_H 1
26 * The maximal hash length that can be encoded it a name
27 * using base32hex. floor(255/8)*5
29 #define NSEC3_MAX_HASH_LENGTH 155
32 * The maximum has that can be encoded in a single label using
33 * base32hex. floor(63/8)*5
35 #define NSEC3_MAX_LABEL_HASH 35
39 int isc_iterated_hash(unsigned char out[NSEC3_MAX_HASH_LENGTH],
40 unsigned int hashalg, int iterations,
41 const unsigned char *salt, int saltlength,
42 const unsigned char *in, int inlength);
47 #endif /* ISC_ITERATED_HASH_H */