AC_CHECK_FUNCS(xts_encrypt_message)
LIBS=$save_LIBS
+# Check for Gosthash94 with CryptoPro S-box support
+save_LIBS=$LIBS
+LIBS="$LIBS $NETTLE_LIBS"
+AC_CHECK_FUNCS(nettle_gosthash94cp_update)
+LIBS=$save_LIBS
+
+# Check for GOST28147
+save_LIBS=$LIBS
+LIBS="$LIBS $NETTLE_LIBS"
+AC_CHECK_FUNCS(nettle_gost28147_set_key)
+LIBS=$save_LIBS
+
+# Check for Streebog support
+save_LIBS=$LIBS
+LIBS="$LIBS $NETTLE_LIBS"
+AC_CHECK_FUNCS(nettle_streebog512_update)
+LIBS=$save_LIBS
AC_MSG_CHECKING([whether to build libdane])
AC_ARG_ENABLE(libdane,
#include <nettle/des.h>
#include <nettle/version.h>
#if ENABLE_GOST
+#ifndef HAVE_NETTLE_GOST28147_SET_KEY
#include "gost/gost28147.h"
+#else
+#include <nettle/gost28147.h>
+#endif
#endif
#include <nettle/nettle-meta.h>
#include <nettle/cbc.h>
#include "config.h"
#endif
+#ifndef HAVE_NETTLE_GOST28147_SET_KEY
+
#include <gnutls_int.h>
#include <string.h>
ctx->key_count += GOST28147_BLOCK_SIZE;
}
}
+#endif
#ifndef GNUTLS_LIB_NETTLE_GOST_GOST28147_H
#define GNUTLS_LIB_NETTLE_GOST_GOST28147_H
+#include "config.h"
+
+#ifndef HAVE_NETTLE_GOST28147_SET_KEY
+
#include <nettle/nettle-types.h>
#ifdef __cplusplus
}
#endif
+#endif
+
#endif /* GNUTLS_LIB_NETTLE_GOST_GOST28147_H */
# include "config.h"
#endif
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
+
#include <gnutls_int.h>
#include <nettle/nettle-meta.h>
const struct nettle_hash nettle_gosthash94cp
= _NETTLE_HASH(gosthash94cp, GOSTHASH94CP);
+
+#endif
#include "config.h"
#endif
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
#include <gnutls_int.h>
#include <string.h>
gosthash94_write_digest (ctx, length, result,
gost28147_param_CryptoPro_3411.sbox);
}
+#endif
#ifndef GNUTLS_LIB_NETTLE_GOST_GOSTHASH94_H
#define GNUTLS_LIB_NETTLE_GOST_GOSTHASH94_H
+#include "config.h"
+
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
+
#include <nettle/nettle-types.h>
#ifdef __cplusplus
}
#endif
+#endif
+
#endif /* GNUTLS_LIB_NETTLE_GOST_GOSTHASH94_H */
#ifndef GNUTLS_LIB_NETTLE_GOST_HMAC_GOST_H
#define GNUTLS_LIB_NETTLE_GOST_HMAC_GOST_H
+#include "config.h"
+
#include <nettle/hmac.h>
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
#include "gosthash94.h"
+#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
#include "streebog.h"
+#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Namespace mangling */
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
#define hmac_gosthash94cp_set_key _gnutls_hmac_gosthash94cp_set_key
#define hmac_gosthash94cp_update _gnutls_hmac_gosthash94cp_update
#define hmac_gosthash94cp_digest _gnutls_hmac_gosthash94cp_digest
+#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
#define hmac_streebog256_set_key _gnutls_hmac_streebog256_set_key
#define hmac_streebog256_digest _gnutls_hmac_streebog256_digest
#define hmac_streebog512_set_key _gnutls_hmac_streebog512_set_key
#define hmac_streebog512_update _gnutls_hmac_streebog512_update
#define hmac_streebog512_digest _gnutls_hmac_streebog512_digest
+#endif
/* hmac-gosthash94 */
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
struct hmac_gosthash94cp_ctx HMAC_CTX(struct gosthash94cp_ctx);
void
void
hmac_gosthash94cp_digest(struct hmac_gosthash94cp_ctx *ctx,
size_t length, uint8_t *digest);
+#endif
/* hmac-streebog */
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
struct hmac_streebog512_ctx HMAC_CTX(struct streebog512_ctx);
void
void
hmac_streebog256_digest(struct hmac_streebog256_ctx *ctx,
size_t length, uint8_t *digest);
+#endif
#ifdef __cplusplus
}
# include <config.h>
#endif
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
+
#include <gnutls_int.h>
#include <nettle/hmac.h>
{
HMAC_DIGEST(ctx, &nettle_gosthash94cp, length, digest);
}
+#endif
# include <config.h>
#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
#include <gnutls_int.h>
#include <nettle/hmac.h>
{
HMAC_DIGEST(ctx, &nettle_streebog256, length, digest);
}
+#endif
#ifndef GNUTLS_LIB_NETTLE_GOST_PBKDF2_GOST_H
#define GNUTLS_LIB_NETTLE_GOST_PBKDF2_GOST_H
+#include "config.h"
+
#include <nettle/nettle-meta.h>
#include <nettle/pbkdf2.h>
#endif
/* Namespace mangling */
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
#define pbkdf2_hmac_gosthash94cp _gnutls_pbkdf2_hmac_gosthash94cp
+#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
#define pbkdf2_hmac_streebog256 _gnutls_pbkdf2_hmac_streebog256
#define pbkdf2_hmac_streebog512 _gnutls_pbkdf2_hmac_streebog512
+#endif
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
void
pbkdf2_hmac_gosthash94cp (size_t key_length, const uint8_t *key,
unsigned iterations,
size_t salt_length, const uint8_t *salt,
size_t length, uint8_t *dst);
+#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
void
pbkdf2_hmac_streebog256 (size_t key_length, const uint8_t *key,
unsigned iterations,
unsigned iterations,
size_t salt_length, const uint8_t *salt,
size_t length, uint8_t *dst);
+#endif
#ifdef __cplusplus
}
# include "config.h"
#endif
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
+
#include <gnutls_int.h>
#include "pbkdf2-gost.h"
PBKDF2 (&gosthash94cpctx, hmac_gosthash94cp_update, hmac_gosthash94cp_digest,
GOSTHASH94CP_DIGEST_SIZE, iterations, salt_length, salt, length, dst);
}
+#endif
# include "config.h"
#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
#include <gnutls_int.h>
#include "pbkdf2-gost.h"
PBKDF2 (&streebog512ctx, hmac_streebog512_update, hmac_streebog512_digest,
STREEBOG512_DIGEST_SIZE, iterations, salt_length, salt, length, dst);
}
+#endif
# include "config.h"
#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
#include <gnutls_int.h>
#include <nettle/nettle-meta.h>
const struct nettle_hash nettle_streebog256
= _NETTLE_HASH(streebog256, STREEBOG256);
+#endif
# include "config.h"
#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
#include <gnutls_int.h>
#include <stdlib.h>
digest);
streebog256_init(ctx);
}
+#endif
#ifndef GNUTLS_LIB_NETTLE_GOST_STREEBOG_H
#define GNUTLS_LIB_NETTLE_GOST_STREEBOG_H
+#include "config.h"
+
#include <nettle/nettle-types.h>
#include <nettle/nettle-meta.h>
extern "C" {
#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
/* Name mangling */
#define streebog256_init _gnutls_streebog256_init
#define streebog256_digest _gnutls_streebog256_digest
#define nettle_streebog512 _gnutls_streebog512
extern const struct nettle_hash _gnutls_streebog256;
extern const struct nettle_hash _gnutls_streebog512;
+#endif
#ifdef __cplusplus
}
#include <nettle/umac.h>
#if ENABLE_GOST
#include "gost/hmac-gost.h"
+#ifndef HAVE_NETTLE_GOSTHASH94CP_UPDATE
#include "gost/gosthash94.h"
+#endif
+#ifndef HAVE_NETTLE_STREEBOG512_UPDATE
#include "gost/streebog.h"
#endif
+#endif
#ifdef HAVE_NETTLE_CMAC128_UPDATE
#include <nettle/cmac.h>
#else