|
Packit |
5ce601 |
/*
|
|
Packit |
5ce601 |
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
Packit |
5ce601 |
*
|
|
Packit |
5ce601 |
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
Packit |
5ce601 |
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
Packit Service |
704ed8 |
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
|
Packit |
5ce601 |
*
|
|
Packit |
5ce601 |
* See the COPYRIGHT file distributed with this work for additional
|
|
Packit |
5ce601 |
* information regarding copyright ownership.
|
|
Packit |
5ce601 |
*/
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#ifndef DST_GOST_H
|
|
Packit |
5ce601 |
#define DST_GOST_H 1
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#include <isc/lang.h>
|
|
Packit |
5ce601 |
#include <isc/log.h>
|
|
Packit |
5ce601 |
#include <dst/result.h>
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#define ISC_GOST_DIGESTLENGTH 32U
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#ifdef HAVE_OPENSSL_GOST
|
|
Packit |
5ce601 |
#include <openssl/evp.h>
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
typedef struct {
|
|
Packit |
5ce601 |
EVP_MD_CTX *ctx;
|
|
Packit |
5ce601 |
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
|
Packit |
5ce601 |
EVP_MD_CTX _ctx;
|
|
Packit |
5ce601 |
#endif
|
|
Packit |
5ce601 |
} isc_gost_t;
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#endif
|
|
Packit |
5ce601 |
#ifdef HAVE_PKCS11_GOST
|
|
Packit |
5ce601 |
#include <pk11/pk11.h>
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
typedef pk11_context_t isc_gost_t;
|
|
Packit |
5ce601 |
#endif
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
ISC_LANG_BEGINDECLS
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#if defined(HAVE_OPENSSL_GOST) || defined(HAVE_PKCS11_GOST)
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
isc_result_t
|
|
Packit |
5ce601 |
isc_gost_init(isc_gost_t *ctx);
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
void
|
|
Packit |
5ce601 |
isc_gost_invalidate(isc_gost_t *ctx);
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
isc_result_t
|
|
Packit |
5ce601 |
isc_gost_update(isc_gost_t *ctx, const unsigned char *data, unsigned int len);
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
isc_result_t
|
|
Packit |
5ce601 |
isc_gost_final(isc_gost_t *ctx, unsigned char *digest);
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
ISC_LANG_ENDDECLS
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#endif /* HAVE_OPENSSL_GOST || HAVE_PKCS11_GOST */
|
|
Packit |
5ce601 |
|
|
Packit |
5ce601 |
#endif /* DST_GOST_H */
|