xref: /minix/external/bsd/bind/dist/lib/dns/dst_gost.h (revision bb9622b5)
1 /*	$NetBSD: dst_gost.h,v 1.1.1.3 2014/12/10 03:34:39 christos Exp $	*/
2 
3 /*
4  * Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef DST_GOST_H
20 #define DST_GOST_H 1
21 
22 #include <isc/lang.h>
23 #include <isc/log.h>
24 #include <dst/result.h>
25 
26 #define ISC_GOST_DIGESTLENGTH 32U
27 
28 #ifdef HAVE_OPENSSL_GOST
29 #include <openssl/evp.h>
30 
31 typedef EVP_MD_CTX isc_gost_t;
32 #endif
33 #ifdef HAVE_PKCS11_GOST
34 #include <pk11/pk11.h>
35 
36 typedef pk11_context_t isc_gost_t;
37 #endif
38 
39 ISC_LANG_BEGINDECLS
40 
41 #if defined(HAVE_OPENSSL_GOST) || defined(HAVE_PKCS11_GOST)
42 
43 isc_result_t
44 isc_gost_init(isc_gost_t *ctx);
45 
46 void
47 isc_gost_invalidate(isc_gost_t *ctx);
48 
49 isc_result_t
50 isc_gost_update(isc_gost_t *ctx, const unsigned char *data, unsigned int len);
51 
52 isc_result_t
53 isc_gost_final(isc_gost_t *ctx, unsigned char *digest);
54 
55 ISC_LANG_ENDDECLS
56 
57 #endif /* HAVE_OPENSSL_GOST || HAVE_PKCS11_GOST */
58 
59 #endif /* DST_GOST_H */
60