]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
liboqs: require version 0.11.0
authorDaiki Ueno <ueno@gnu.org>
Mon, 7 Oct 2024 04:39:22 +0000 (13:39 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 29 Oct 2024 12:37:32 +0000 (21:37 +0900)
liboqs 0.11.0 shipped with public headers for plugging in alternative
symmetric algorithms (e.g., sha3_ops.h), which were previously
missing.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
configure.ac
devel/generate-dlwrap.sh
lib/dlwrap/oqs.h
lib/liboqs/Makefile.am
lib/liboqs/backport/sha3_ops.h [deleted file]

index 11c3cd54add7613b5a81a6c0d175dc8c093d6622..47b5eba681b542a194fa0b20b3a46e0487995bc0 100644 (file)
@@ -1304,21 +1304,12 @@ AS_CASE([$ac_liboqs],
 
 
 AS_IF([test x$ac_liboqs != xno],
-    [PKG_CHECK_MODULES([LIBOQS],[liboqs >= 0.10.1],
-      [save_CFLAGS=$CFLAGS
-      CFLAGS="$CFLAGS $LIBOQS_CFLAGS"
-      AC_CHECK_DECLS([OQS_SHA3_set_callbacks])
-      CFLAGS="$save_CFLAGS"
-      # liboqs 0.10.1 didn't expose OQS_SHA3_set_callbacks from the header
-      # file, so extra treatment is needed:
-      # https://github.com/open-quantum-safe/liboqs/pull/1832
-      AC_DEFINE([HAVE_LIBOQS], 1, [Have liboqs])
+    [PKG_CHECK_MODULES([LIBOQS],[liboqs >= 0.11.0],
+      [AC_DEFINE([HAVE_LIBOQS], 1, [Have liboqs])
       need_ltlibdl=yes],
       [AC_MSG_ERROR([liboqs support was requested but the required libraries were not found.])])])
 
 AM_CONDITIONAL(ENABLE_LIBOQS, test "$ac_liboqs" != "no")
-AM_CONDITIONAL(NEED_LIBOQS_SHA3_OPS_H,
-  test "$ac_cv_have_decl_OQS_SHA3_set_callbacks" != yes)
 AM_CONDITIONAL([LIBOQS_ENABLE_DLOPEN], [test "$ac_liboqs" = dlopen])
 
 AS_IF([test "$ac_liboqs" = dlopen], [
index fce6abfa8bf86570e02d05326e3cbabb0f8c5e09..9be14ab34b5716a4ef8c16db9e69af68f7a2a510 100755 (executable)
@@ -39,14 +39,6 @@ echo "Generating $DST/oqs.h"
 
 "$DLWRAP" --input /usr/include/oqs/oqs.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/oqs.syms" --license "SPDX-License-Identifier: MIT" --soname OQS_LIBRARY_SONAME_UNUSED --prefix gnutls_oqs --header-guard GNUTLS_LIB_DLWRAP_OQS_H_ --include "<oqs/oqs.h>"
 
-sed -i '/^#include <oqs\/oqs.h>/i\
-/* Local modification: remove this once liboqs 0.10.2 is released */\
-#include "config.h"\
-#if !HAVE_DECL_OQS_SHA3_SET_CALLBACKS\
-#include "liboqs/backport/sha3_ops.h"\
-#endif\
-' "$DST/oqs.h"
-
 echo "Generating $DST/tss2_esys.h"
 
 "$DLWRAP" --input /usr/include/tss2/tss2_esys.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/tss2-esys.syms" --license "SPDX-License-Identifier: BSD-2-Clause" --soname TSS2_ESYS_LIBRARY_SONAME_UNUSED --prefix gnutls_tss2_esys --header-guard GNUTLS_LIB_DLWRAP_TSS2_ESYS_H_ --include "<tss2/tss2_esys.h>"
index 1cf5d015a5e83f9d3e302c9ef3c3ec3fa6116426..c1785c7beefb10c72f2e8c902eb593798fe52958 100644 (file)
@@ -8,12 +8,6 @@
 #ifndef GNUTLS_LIB_DLWRAP_OQS_H_
 #define GNUTLS_LIB_DLWRAP_OQS_H_
 
-/* Local modification: remove this once liboqs 0.10.2 is released */
-#include "config.h"
-#if !HAVE_DECL_OQS_SHA3_SET_CALLBACKS
-#include "liboqs/backport/sha3_ops.h"
-#endif
-
 #include <oqs/oqs.h>
 
 #if defined(GNUTLS_OQS_ENABLE_DLOPEN) && GNUTLS_OQS_ENABLE_DLOPEN
index 3956c9320a4e9fb0f125431f9ccacff758811352..614aec052731b0b4eb8696ed78aceaa43238b28a 100644 (file)
@@ -37,7 +37,3 @@ endif
 noinst_LTLIBRARIES = libcrypto.la
 
 libcrypto_la_SOURCES = liboqs.h liboqs.c rand.h rand.c sha3.h sha3.c
-
-if NEED_LIBOQS_SHA3_OPS_H
-libcrypto_la_SOURCES += backport/sha3_ops.h
-endif
diff --git a/lib/liboqs/backport/sha3_ops.h b/lib/liboqs/backport/sha3_ops.h
deleted file mode 100644 (file)
index 694fc21..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/**
- * \file sha3_ops.h
- * \brief Header defining the callback API for OQS SHA3 and SHAKE
- *
- * \author John Underhill, Douglas Stebila
- *
- * SPDX-License-Identifier: MIT
- */
-
-#ifndef OQS_SHA3_OPS_H
-#define OQS_SHA3_OPS_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include <oqs/common.h>
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-/** Data structure for the state of the incremental SHA3-256 API. */
-typedef struct {
-       /** Internal state. */
-       void *ctx;
-} OQS_SHA3_sha3_256_inc_ctx;
-
-/** Data structure for the state of the incremental SHA3-384 API. */
-typedef struct {
-       /** Internal state. */
-       void *ctx;
-} OQS_SHA3_sha3_384_inc_ctx;
-
-/** Data structure for the state of the incremental SHA3-512 API. */
-typedef struct {
-       /** Internal state. */
-       void *ctx;
-} OQS_SHA3_sha3_512_inc_ctx;
-
-/** Data structure for the state of the incremental SHAKE-128 API. */
-typedef struct {
-       /** Internal state. */
-       void *ctx;
-} OQS_SHA3_shake128_inc_ctx;
-
-/** Data structure for the state of the incremental SHAKE-256 API. */
-typedef struct {
-       /** Internal state. */
-       void *ctx;
-} OQS_SHA3_shake256_inc_ctx;
-
-/** Data structure implemented by cryptographic provider for SHA-3 operations.
- */
-struct OQS_SHA3_callbacks {
-       /**
-        * Implementation of function OQS_SHA3_sha3_256.
-        */
-       void (*SHA3_sha3_256)(uint8_t *output, const uint8_t *input, size_t inplen);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_256_inc_init.
-        */
-       void (*SHA3_sha3_256_inc_init)(OQS_SHA3_sha3_256_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_256_inc_absorb.
-        */
-       void (*SHA3_sha3_256_inc_absorb)(OQS_SHA3_sha3_256_inc_ctx *state, const uint8_t *input, size_t inlen);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_256_inc_finalize.
-        */
-       void (*SHA3_sha3_256_inc_finalize)(uint8_t *output, OQS_SHA3_sha3_256_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_256_inc_ctx_release.
-        */
-       void (*SHA3_sha3_256_inc_ctx_release)(OQS_SHA3_sha3_256_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_256_inc_ctx_reset.
-        */
-       void (*SHA3_sha3_256_inc_ctx_reset)(OQS_SHA3_sha3_256_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_256_inc_ctx_clone.
-        */
-       void (*SHA3_sha3_256_inc_ctx_clone)(OQS_SHA3_sha3_256_inc_ctx *dest, const OQS_SHA3_sha3_256_inc_ctx *src);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_384.
-        */
-       void (*SHA3_sha3_384)(uint8_t *output, const uint8_t *input, size_t inplen);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_384_inc_init.
-        */
-       void (*SHA3_sha3_384_inc_init)(OQS_SHA3_sha3_384_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_384_inc_absorb.
-        */
-       void (*SHA3_sha3_384_inc_absorb)(OQS_SHA3_sha3_384_inc_ctx *state, const uint8_t *input, size_t inlen);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_384_inc_finalize.
-        */
-       void (*SHA3_sha3_384_inc_finalize)(uint8_t *output, OQS_SHA3_sha3_384_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_384_inc_ctx_release.
-        */
-       void (*SHA3_sha3_384_inc_ctx_release)(OQS_SHA3_sha3_384_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_384_inc_ctx_reset.
-        */
-       void (*SHA3_sha3_384_inc_ctx_reset)(OQS_SHA3_sha3_384_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_384_inc_ctx_clone.
-        */
-       void (*SHA3_sha3_384_inc_ctx_clone)(OQS_SHA3_sha3_384_inc_ctx *dest, const OQS_SHA3_sha3_384_inc_ctx *src);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_512.
-        */
-       void (*SHA3_sha3_512)(uint8_t *output, const uint8_t *input, size_t inplen);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_512_inc_init.
-        */
-       void (*SHA3_sha3_512_inc_init)(OQS_SHA3_sha3_512_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_512_inc_absorb.
-        */
-       void (*SHA3_sha3_512_inc_absorb)(OQS_SHA3_sha3_512_inc_ctx *state, const uint8_t *input, size_t inlen);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_512_inc_finalize.
-        */
-       void (*SHA3_sha3_512_inc_finalize)(uint8_t *output, OQS_SHA3_sha3_512_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_512_inc_ctx_release.
-        */
-       void (*SHA3_sha3_512_inc_ctx_release)(OQS_SHA3_sha3_512_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_512_inc_ctx_reset.
-        */
-       void (*SHA3_sha3_512_inc_ctx_reset)(OQS_SHA3_sha3_512_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_sha3_512_inc_ctx_clone.
-        */
-       void (*SHA3_sha3_512_inc_ctx_clone)(OQS_SHA3_sha3_512_inc_ctx *dest, const OQS_SHA3_sha3_512_inc_ctx *src);
-
-       /**
-        * Implementation of function OQS_SHA3_shake128.
-        */
-       void (*SHA3_shake128)(uint8_t *output, size_t outlen, const uint8_t *input, size_t inplen);
-
-       /**
-        * Implementation of function OQS_SHA3_shake128_inc_init.
-        */
-       void (*SHA3_shake128_inc_init)(OQS_SHA3_shake128_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake128_inc_absorb.
-        */
-       void (*SHA3_shake128_inc_absorb)(OQS_SHA3_shake128_inc_ctx *state, const uint8_t *input, size_t inlen);
-
-       /**
-        * Implementation of function OQS_SHA3_shake128_inc_finalize.
-        */
-       void (*SHA3_shake128_inc_finalize)(OQS_SHA3_shake128_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake128_inc_squeeze.
-        */
-       void (*SHA3_shake128_inc_squeeze)(uint8_t *output, size_t outlen, OQS_SHA3_shake128_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake128_inc_ctx_release.
-        */
-       void (*SHA3_shake128_inc_ctx_release)(OQS_SHA3_shake128_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake128_inc_ctx_clone.
-        */
-       void (*SHA3_shake128_inc_ctx_clone)(OQS_SHA3_shake128_inc_ctx *dest, const OQS_SHA3_shake128_inc_ctx *src);
-
-       /**
-        * Implementation of function OQS_SHA3_shake128_inc_ctx_reset.
-        */
-       void (*SHA3_shake128_inc_ctx_reset)(OQS_SHA3_shake128_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake256.
-        */
-       void (*SHA3_shake256)(uint8_t *output, size_t outlen, const uint8_t *input, size_t inplen);
-
-       /**
-        * Implementation of function OQS_SHA3_shake256_inc_init.
-        */
-       void (*SHA3_shake256_inc_init)(OQS_SHA3_shake256_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake256_inc_absorb.
-        */
-       void (*SHA3_shake256_inc_absorb)(OQS_SHA3_shake256_inc_ctx *state, const uint8_t *input, size_t inlen);
-
-       /**
-        * Implementation of function OQS_SHA3_shake256_inc_finalize.
-        */
-       void (*SHA3_shake256_inc_finalize)(OQS_SHA3_shake256_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake256_inc_squeeze.
-        */
-       void (*SHA3_shake256_inc_squeeze)(uint8_t *output, size_t outlen, OQS_SHA3_shake256_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake256_inc_ctx_release.
-        */
-       void (*SHA3_shake256_inc_ctx_release)(OQS_SHA3_shake256_inc_ctx *state);
-
-       /**
-        * Implementation of function OQS_SHA3_shake256_inc_ctx_clone.
-        */
-       void (*SHA3_shake256_inc_ctx_clone)(OQS_SHA3_shake256_inc_ctx *dest, const OQS_SHA3_shake256_inc_ctx *src);
-
-       /**
-        * Implementation of function OQS_SHA3_shake256_inc_ctx_reset.
-        */
-       void (*SHA3_shake256_inc_ctx_reset)(OQS_SHA3_shake256_inc_ctx *state);
-};
-
-/**
- * Set callback functions for SHA3 operations.
- *
- * This function may be called before OQS_init to switch the
- * cryptographic provider for SHA3 operations. If it is not called,
- * the default provider determined at build time will be used.
- *
- * @param new_callbacks Callback functions defined in OQS_SHA3_callbacks struct
- */
-OQS_API void OQS_SHA3_set_callbacks(struct OQS_SHA3_callbacks *new_callbacks);
-
-#if defined(__cplusplus)
-} // extern "C"
-#endif
-
-#endif // OQS_SHA3_OPS_H