When leancrypto is statically linked, their constructor will not be
called and which prevents some low-level algorithms being
functional. This adds a manual initialization with lc_init() at the
startup of the GnuTLS library.
Suggested-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Daiki Ueno <ueno@gnu.org>
#include "str.h"
#include "global.h"
#include "liboqs/liboqs.h"
+#ifdef HAVE_LEANCRYPTO
+#include <leancrypto.h>
+#endif
/* Minimum library versions we accept. */
#define GNUTLS_MIN_LIBTASN1_VERSION "0.3.4"
_gnutls_register_accel_crypto();
_gnutls_cryptodev_init();
_gnutls_afalg_init();
+#ifdef HAVE_LEANCRYPTO
+ lc_init(0);
+#endif
#ifdef ENABLE_FIPS140
/* These self tests are performed on the overridden algorithms