1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2026-04-19 13:31:17 +03:00

Add IKEv2 (RFC 7296) support for IPsec VPN

Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-20 09:50:38 +00:00
parent bc2d951000
commit 476638b7d9
79 changed files with 10252 additions and 25 deletions
+92
View File
@@ -0,0 +1,92 @@
# This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. The list of available CPACK_xxx variables and their associated
# documentation may be obtained using
# cpack --help-variable-list
#
# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME)
# and some are specific to a generator
# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables
# usually begin with CPACK_<GENNAME>_xxxx.
set(CPACK_BINARY_DEB "OFF")
set(CPACK_BINARY_FREEBSD "OFF")
set(CPACK_BINARY_IFW "OFF")
set(CPACK_BINARY_NSIS "OFF")
set(CPACK_BINARY_RPM "OFF")
set(CPACK_BINARY_STGZ "ON")
set(CPACK_BINARY_TBZ2 "OFF")
set(CPACK_BINARY_TGZ "ON")
set(CPACK_BINARY_TXZ "OFF")
set(CPACK_BINARY_TZ "ON")
set(CPACK_BUILD_SOURCE_DIRS "/home/runner/work/SoftEtherVPN/SoftEtherVPN;/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir")
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
set(CPACK_COMPONENTS_ALL "common;vpnserver;vpnclient;vpnbridge;vpncmd")
set(CPACK_COMPONENTS_ALL_SET_BY_USER "TRUE")
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Unknown")
set(CPACK_DEBIAN_PACKAGE_SECTION "net")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE "/usr/local/share/cmake-3.31/Templates/CPack.GenericDescription.txt")
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY "SoftEther VPN built using CMake")
set(CPACK_GENERATOR "STGZ;TGZ;TZ")
set(CPACK_INNOSETUP_ARCHITECTURE "x64")
set(CPACK_INSTALL_CMAKE_PROJECTS "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir;SoftEther VPN;ALL;/")
set(CPACK_INSTALL_PREFIX "/usr/local")
set(CPACK_MODULE_PATH "")
set(CPACK_NSIS_DISPLAY_NAME "softether 5.2.5187")
set(CPACK_NSIS_INSTALLER_ICON_CODE "")
set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_NSIS_PACKAGE_NAME "softether 5.2.5187")
set(CPACK_NSIS_UNINSTALL_NAME "Uninstall")
set(CPACK_OBJCOPY_EXECUTABLE "/usr/bin/objcopy")
set(CPACK_OBJDUMP_EXECUTABLE "/usr/bin/objdump")
set(CPACK_OUTPUT_CONFIG_FILE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/CPackConfig.cmake")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
set(CPACK_PACKAGE_DESCRIPTION_FILE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/description")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SoftEther VPN is an open-source cross-platform multi-protocol VPN program, created as an academic project in the University of Tsukuba.")
set(CPACK_PACKAGE_DIRECTORY "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir")
set(CPACK_PACKAGE_FILE_NAME "softether-5.2.5187-Linux")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "softether 5.2.5187")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "softether 5.2.5187")
set(CPACK_PACKAGE_NAME "softether")
set(CPACK_PACKAGE_RELOCATABLE "true")
set(CPACK_PACKAGE_VENDOR "SoftEther")
set(CPACK_PACKAGE_VERSION "5.2.5187")
set(CPACK_PACKAGE_VERSION_MAJOR "5")
set(CPACK_PACKAGE_VERSION_MINOR "2")
set(CPACK_PACKAGE_VERSION_PATCH "5187")
set(CPACK_READELF_EXECUTABLE "/usr/bin/readelf")
set(CPACK_RESOURCE_FILE_LICENSE "/usr/local/share/cmake-3.31/Templates/CPack.GenericLicense.txt")
set(CPACK_RESOURCE_FILE_README "/usr/local/share/cmake-3.31/Templates/CPack.GenericDescription.txt")
set(CPACK_RESOURCE_FILE_WELCOME "/usr/local/share/cmake-3.31/Templates/CPack.GenericWelcome.txt")
set(CPACK_RPM_COMPONENT_INSTALL "ON")
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Internet")
set(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0")
set(CPACK_SET_DESTDIR "OFF")
set(CPACK_SOURCE_GENERATOR "TBZ2;TGZ;TXZ;TZ")
set(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/CPackSourceConfig.cmake")
set(CPACK_SOURCE_RPM "OFF")
set(CPACK_SOURCE_TBZ2 "ON")
set(CPACK_SOURCE_TGZ "ON")
set(CPACK_SOURCE_TXZ "ON")
set(CPACK_SOURCE_TZ "ON")
set(CPACK_SOURCE_ZIP "OFF")
set(CPACK_SYSTEM_NAME "Linux")
set(CPACK_THREADS "1")
set(CPACK_TOPLEVEL_TAG "Linux")
set(CPACK_WIX_SIZEOF_VOID_P "8")
if(NOT CPACK_PROPERTIES_FILE)
set(CPACK_PROPERTIES_FILE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/CPackProperties.cmake")
endif()
if(EXISTS ${CPACK_PROPERTIES_FILE})
include(${CPACK_PROPERTIES_FILE})
endif()
+100
View File
@@ -0,0 +1,100 @@
# This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. The list of available CPACK_xxx variables and their associated
# documentation may be obtained using
# cpack --help-variable-list
#
# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME)
# and some are specific to a generator
# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables
# usually begin with CPACK_<GENNAME>_xxxx.
set(CPACK_BINARY_DEB "OFF")
set(CPACK_BINARY_FREEBSD "OFF")
set(CPACK_BINARY_IFW "OFF")
set(CPACK_BINARY_NSIS "OFF")
set(CPACK_BINARY_RPM "OFF")
set(CPACK_BINARY_STGZ "ON")
set(CPACK_BINARY_TBZ2 "OFF")
set(CPACK_BINARY_TGZ "ON")
set(CPACK_BINARY_TXZ "OFF")
set(CPACK_BINARY_TZ "ON")
set(CPACK_BUILD_SOURCE_DIRS "/home/runner/work/SoftEtherVPN/SoftEtherVPN;/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir")
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
set(CPACK_COMPONENTS_ALL "common;vpnserver;vpnclient;vpnbridge;vpncmd")
set(CPACK_COMPONENTS_ALL_SET_BY_USER "TRUE")
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Unknown")
set(CPACK_DEBIAN_PACKAGE_SECTION "net")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE "/usr/local/share/cmake-3.31/Templates/CPack.GenericDescription.txt")
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY "SoftEther VPN built using CMake")
set(CPACK_GENERATOR "TBZ2;TGZ;TXZ;TZ")
set(CPACK_IGNORE_FILES "/CVS/;/\\.svn/;/\\.bzr/;/\\.hg/;/\\.git/;\\.swp\$;\\.#;/#")
set(CPACK_INNOSETUP_ARCHITECTURE "x64")
set(CPACK_INSTALLED_DIRECTORIES "/home/runner/work/SoftEtherVPN/SoftEtherVPN;/")
set(CPACK_INSTALL_CMAKE_PROJECTS "")
set(CPACK_INSTALL_PREFIX "/usr/local")
set(CPACK_MODULE_PATH "")
set(CPACK_NSIS_DISPLAY_NAME "softether 5.2.5187")
set(CPACK_NSIS_INSTALLER_ICON_CODE "")
set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_NSIS_PACKAGE_NAME "softether 5.2.5187")
set(CPACK_NSIS_UNINSTALL_NAME "Uninstall")
set(CPACK_OBJCOPY_EXECUTABLE "/usr/bin/objcopy")
set(CPACK_OBJDUMP_EXECUTABLE "/usr/bin/objdump")
set(CPACK_OUTPUT_CONFIG_FILE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/CPackConfig.cmake")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
set(CPACK_PACKAGE_DESCRIPTION_FILE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/description")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SoftEther VPN is an open-source cross-platform multi-protocol VPN program, created as an academic project in the University of Tsukuba.")
set(CPACK_PACKAGE_DIRECTORY "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir")
set(CPACK_PACKAGE_FILE_NAME "softether-5.2.5187-Source")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "softether 5.2.5187")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "softether 5.2.5187")
set(CPACK_PACKAGE_NAME "softether")
set(CPACK_PACKAGE_RELOCATABLE "true")
set(CPACK_PACKAGE_VENDOR "SoftEther")
set(CPACK_PACKAGE_VERSION "5.2.5187")
set(CPACK_PACKAGE_VERSION_MAJOR "5")
set(CPACK_PACKAGE_VERSION_MINOR "2")
set(CPACK_PACKAGE_VERSION_PATCH "5187")
set(CPACK_READELF_EXECUTABLE "/usr/bin/readelf")
set(CPACK_RESOURCE_FILE_LICENSE "/usr/local/share/cmake-3.31/Templates/CPack.GenericLicense.txt")
set(CPACK_RESOURCE_FILE_README "/usr/local/share/cmake-3.31/Templates/CPack.GenericDescription.txt")
set(CPACK_RESOURCE_FILE_WELCOME "/usr/local/share/cmake-3.31/Templates/CPack.GenericWelcome.txt")
set(CPACK_RPM_COMPONENT_INSTALL "ON")
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Internet")
set(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0")
set(CPACK_RPM_PACKAGE_SOURCES "ON")
set(CPACK_SET_DESTDIR "OFF")
set(CPACK_SOURCE_GENERATOR "TBZ2;TGZ;TXZ;TZ")
set(CPACK_SOURCE_IGNORE_FILES "/CVS/;/\\.svn/;/\\.bzr/;/\\.hg/;/\\.git/;\\.swp\$;\\.#;/#")
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "/home/runner/work/SoftEtherVPN/SoftEtherVPN;/")
set(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/CPackSourceConfig.cmake")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "softether-5.2.5187-Source")
set(CPACK_SOURCE_RPM "OFF")
set(CPACK_SOURCE_TBZ2 "ON")
set(CPACK_SOURCE_TGZ "ON")
set(CPACK_SOURCE_TOPLEVEL_TAG "Linux-Source")
set(CPACK_SOURCE_TXZ "ON")
set(CPACK_SOURCE_TZ "ON")
set(CPACK_SOURCE_ZIP "OFF")
set(CPACK_STRIP_FILES "")
set(CPACK_SYSTEM_NAME "Linux")
set(CPACK_THREADS "1")
set(CPACK_TOPLEVEL_TAG "Linux-Source")
set(CPACK_WIX_SIZEOF_VOID_P "8")
if(NOT CPACK_PROPERTIES_FILE)
set(CPACK_PROPERTIES_FILE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/CPackProperties.cmake")
endif()
if(EXISTS ${CPACK_PROPERTIES_FILE})
include(${CPACK_PROPERTIES_FILE})
endif()
+71
View File
@@ -0,0 +1,71 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/cmake_install.cmake")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
if(CMAKE_INSTALL_COMPONENT)
if(CMAKE_INSTALL_COMPONENT MATCHES "^[a-zA-Z0-9_.+-]+$")
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
string(MD5 CMAKE_INST_COMP_HASH "${CMAKE_INSTALL_COMPONENT}")
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INST_COMP_HASH}.txt")
unset(CMAKE_INST_COMP_HASH)
endif()
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
@@ -0,0 +1 @@
# placeholder
@@ -0,0 +1 @@
# placeholder
@@ -0,0 +1 @@
# placeholder
@@ -0,0 +1,77 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Cedar
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "common" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcedar.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcedar.so")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcedar.so"
RPATH "/usr/local/lib")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/libcedar.so")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcedar.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcedar.so")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcedar.so"
OLD_RPATH "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir:"
NEW_RPATH "/usr/local/lib")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcedar.so")
endif()
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "common" OR NOT CMAKE_INSTALL_COMPONENT)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "common" OR NOT CMAKE_INSTALL_COMPONENT)
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Cedar/CMakeFiles/cedar.dir/install-cxx-module-bmi-Release.cmake" OPTIONAL)
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Cedar/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/cpu_features
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/cpu_features/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,55 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/cmake_install.cmake")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,24 @@
# As per https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
if(NOT EXISTS "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/install_manifest.txt")
endif()
file(READ "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"/usr/local/bin/cmake" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()
@@ -0,0 +1,202 @@
/**
* \file aes.h
* \brief Header defining the API for OQS AES; not part of the public OQS API
*
* <b>Note this is not part of the OQS public API: implementations within liboqs can use these
* functions, but external consumers of liboqs should not use these functions.</b>
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_AES_H
#define OQS_AES_H
#include <stdint.h>
#include <stdlib.h>
#include <oqs/aes_ops.h>
#if defined(__cplusplus)
extern "C" {
#endif
/**
* Function to fill a key schedule given an initial key for use in ECB mode.
*
* @param key Initial Key.
* @param ctx Abstract data structure for a key schedule.
*/
void OQS_AES128_ECB_load_schedule(const uint8_t *key, void **ctx);
/**
* Function to initialize a context and fill a key schedule given an initial key for
* use in CTR mode.
*
* @param key Initial Key.
* @param ctx Abstract data structure for a key schedule.
*/
void OQS_AES128_CTR_inc_init(const uint8_t *key, void **ctx);
/**
* Function to fill a context given an IV for use in CTR mode.
*
* Handles a 12- or 16-byte IV. If a 12-byte IV is given, then 4 counter
* bytes are initialized to all zeros.
*
* @param iv Initialization Vector.
* @param iv_len Length of the initialization vector.
* @param ctx Abstract data structure for IV.
*/
void OQS_AES128_CTR_inc_iv(const uint8_t *iv, size_t iv_len, void *ctx);
/**
* Function to fill a context given an IV for use in CTR mode.
* Handles an 8-byte IV passed as a 64-bit unsigned integer,
* counter bytes are initialized to zero.
*
* @param iv Initialization Vector as 64-bit integer.
* @param ctx Abstract data structure for IV.
*/
void OQS_AES128_CTR_inc_ivu64(uint64_t iv, void *ctx);
/**
* Function to free a key schedule.
*
* @param ctx Context generated with OQS_AES128_ECB_load_schedule().
*/
void OQS_AES128_free_schedule(void *ctx);
/**
* Function to encrypt blocks of plaintext using ECB mode.
* A schedule based on the key is generated and used internally.
*
* @param plaintext Plaintext to be encrypted.
* @param plaintext_len Length on the plaintext in bytes. Must be a multiple of 16.
* @param key Key to be used for encryption.
* @param ciphertext Pointer to a block of memory which >= in size to the plaintext block. The result will be written here.
* @warning plaintext_len must be a multiple of 16.
*/
void OQS_AES128_ECB_enc(const uint8_t *plaintext, const size_t plaintext_len, const uint8_t *key, uint8_t *ciphertext);
/**
* Same as OQS_AES128_ECB_enc() except a schedule generated by
* OQS_AES128_ECB_load_schedule() is passed rather then a key. This is faster
* if the same schedule is used for multiple encryptions since it does
* not have to be regenerated from the key.
*/
void OQS_AES128_ECB_enc_sch(const uint8_t *plaintext, const size_t plaintext_len, const void *schedule, uint8_t *ciphertext);
/**
* AES counter mode keystream generator. A context generated by
* OQS_AES128_CTR_inc_init() is passed rather then a key.
*
* Handles a 12- or 16-byte IV. If a 12-byte IV is given, then 4 counter
* bytes are initialized to all zeros.
*
* @param iv 12- or 16-byte initialization vector.
* @param iv_len Lengh of IV in bytes.
* @param ctx Abstract data structure for a key schedule.
* @param out Pointer to a block of memory which is big enough to contain out_len bytes; the result will be written here.
* @param out_len Length of output bytes to generate.
*/
void OQS_AES128_CTR_inc_stream_iv(const uint8_t *iv, size_t iv_len, const void *ctx, uint8_t *out, size_t out_len);
/**
* Function to fill a key schedule given an initial key for use in ECB mode encryption.
*
* @param key Initial Key.
* @param ctx Abstract data structure for a key schedule.
*/
void OQS_AES256_ECB_load_schedule(const uint8_t *key, void **ctx);
/**
* Function to initialize a context and fill a key schedule given an initial key for
* use in CTR mode.
*
* @param key Initial Key.
* @param ctx Abstract data structure for a key schedule.
*/
void OQS_AES256_CTR_inc_init(const uint8_t *key, void **ctx);
/**
* Function to fill a context given an IV for use in CTR mode.
*
* Handles a 12- or 16-byte IV. If a 12-byte IV is given, then 4 counter
* bytes are initialized to all zeros.
*
* @param iv Initialization Vector.
* @param iv_len Length of the initialization vector.
* @param ctx Abstract data structure for IV.
*/
void OQS_AES256_CTR_inc_iv(const uint8_t *iv, size_t iv_len, void *ctx);
/**
* Function to fill a context given an IV for use in CTR mode.
* Handles an 8-byte IV passed as a 64-bit unsigned integer,
* counter bytes are initialized to zero.
*
* @param iv Initialization Vector as 64-bit integer.
* @param ctx Abstract data structure for IV.
*/
void OQS_AES256_CTR_inc_ivu64(uint64_t iv, void *ctx);
/**
* Function to free a key schedule.
*
* @param ctx Schedule generated with OQS_AES256_ECB_load_schedule
* or OQS_AES256_CTR_inc_init.
*/
void OQS_AES256_free_schedule(void *ctx);
/**
* Function to encrypt blocks of plaintext using ECB mode.
* A schedule based on the key is generated and used internally.
*
* @param plaintext Plaintext to be encrypted.
* @param plaintext_len Length on the plaintext in bytes. Must be a multiple of 16.
* @param key Key to be used for encryption.
* @param ciphertext Pointer to a block of memory which >= in size to the plaintext block. The result will be written here.
* @warning plaintext_len must be a multiple of 16.
*/
void OQS_AES256_ECB_enc(const uint8_t *plaintext, const size_t plaintext_len, const uint8_t *key, uint8_t *ciphertext);
/**
* Same as OQS_AES256_ECB_enc() except a schedule generated by
* OQS_AES256_ECB_load_schedule() is passed rather then a key. This is faster
* if the same schedule is used for multiple encryptions since it does
* not have to be regenerated from the key.
*/
void OQS_AES256_ECB_enc_sch(const uint8_t *plaintext, const size_t plaintext_len, const void *schedule, uint8_t *ciphertext);
/**
* AES counter mode keystream generator. A context generated by
* OQS_AES256_CTR_inc_init() is passed rather then a key.
*
* Handles a 12- or 16-byte IV. If a 12-byte IV is given, then 4 counter
* bytes are initialized to all zeros.
*
* @param iv 12- or 16-byte initialization vector.
* @param iv_len Lengh of IV in bytes.
* @param ctx Abstract data structure for a key schedule.
* @param out Pointer to a block of memory which is big enough to contain out_len bytes; the result will be written here.
* @param out_len Length of output bytes to generate.
*/
void OQS_AES256_CTR_inc_stream_iv(const uint8_t *iv, size_t iv_len, const void *ctx, uint8_t *out, size_t out_len);
/**
* AES counter mode keystream generator. A context generated by
* OQS_AES256_CTR_inc_init() and OQS_AES256_CTR_inc_iv() is passed
* rather than a key and an IV. The counter is internally updated, which allows
* the function to be called multiple times.
*
* @param ctx Abstract data structure for key schedule and IV.
* @param out Pointer to a block of memory which is big enough to contain out_blks*16 bytes; the result will be written here.
* @param out_blks Length of output blocks to generate, where one block is 16 bytes.
*/
void OQS_AES256_CTR_inc_stream_blks(void *ctx, uint8_t *out, size_t out_blks);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_AES_H
@@ -0,0 +1,124 @@
/**
* \file aes_ops.h
* \brief Header defining the callback API for OQS AES
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_AES_OPS_H
#define OQS_AES_OPS_H
#include <stdint.h>
#include <stdlib.h>
#include <oqs/common.h>
#if defined(__cplusplus)
extern "C" {
#endif
/** Data structure implemented by cryptographic provider for AES operations.
*/
struct OQS_AES_callbacks {
/**
* Implementation of function OQS_AES128_ECB_load_schedule.
*/
void (*AES128_ECB_load_schedule)(const uint8_t *key, void **ctx);
/**
* Implementation of function OQS_AES256_CTR_inc_init.
*/
void (*AES128_CTR_inc_init)(const uint8_t *key, void **ctx);
/**
* Implementation of function OQS_AES256_CTR_inc_iv.
*/
void (*AES128_CTR_inc_iv)(const uint8_t *iv, size_t iv_len, void *ctx);
/**
* Implementation of function OQS_AES256_CTR_inc_ivu64.
*/
void (*AES128_CTR_inc_ivu64)(uint64_t iv, void *ctx);
/**
* Implementation of function OQS_AES128_free_schedule.
*/
void (*AES128_free_schedule)(void *ctx);
/**
* Implementation of function OQS_AES128_ECB_enc.
*/
void (*AES128_ECB_enc)(const uint8_t *plaintext, const size_t plaintext_len, const uint8_t *key, uint8_t *ciphertext);
/**
* Implementation of function OQS_AES128_ECB_enc_sch.
*/
void (*AES128_ECB_enc_sch)(const uint8_t *plaintext, const size_t plaintext_len, const void *schedule, uint8_t *ciphertext);
/**
* Implementation of function OQS_AES128_CTR_inc_stream_iv.
*/
void (*AES128_CTR_inc_stream_iv)(const uint8_t *iv, size_t iv_len, const void *ctx, uint8_t *out, size_t out_len);
/**
* Implementation of function OQS_AES256_ECB_load_schedule.
*/
void (*AES256_ECB_load_schedule)(const uint8_t *key, void **ctx);
/**
* Implementation of function OQS_AES256_CTR_inc_init.
*/
void (*AES256_CTR_inc_init)(const uint8_t *key, void **ctx);
/**
* Implementation of function OQS_AES256_CTR_inc_iv.
*/
void (*AES256_CTR_inc_iv)(const uint8_t *iv, size_t iv_len, void *ctx);
/**
* Implementation of function OQS_AES256_CTR_inc_ivu64.
*/
void (*AES256_CTR_inc_ivu64)(uint64_t iv, void *ctx);
/**
* Implementation of function OQS_AES256_free_schedule.
*/
void (*AES256_free_schedule)(void *ctx);
/**
* Implementation of function OQS_AES256_ECB_enc.
*/
void (*AES256_ECB_enc)(const uint8_t *plaintext, const size_t plaintext_len, const uint8_t *key, uint8_t *ciphertext);
/**
* Implementation of function OQS_AES256_ECB_enc_sch.
*/
void (*AES256_ECB_enc_sch)(const uint8_t *plaintext, const size_t plaintext_len, const void *schedule, uint8_t *ciphertext);
/**
* Implementation of function OQS_AES256_CTR_inc_stream_iv.
*/
void (*AES256_CTR_inc_stream_iv)(const uint8_t *iv, size_t iv_len, const void *ctx, uint8_t *out, size_t out_len);
/**
* Implementation of function OQS_AES256_CTR_inc_stream_blks.
*/
void (*AES256_CTR_inc_stream_blks)(void *ctx, uint8_t *out, size_t out_blks);
};
/**
* Set callback functions for AES operations.
*
* This function may be called before OQS_init to switch the
* cryptographic provider for AES operations. If it is not called, the
* default provider determined at build time will be used.
*
* @param[in] new_callbacks Callback functions defined in OQS_AES_callbacks
*/
OQS_API void OQS_AES_set_callbacks(struct OQS_AES_callbacks *new_callbacks);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_AES_OPS_H
@@ -0,0 +1,286 @@
/**
* \file common.h
* \brief Utility functions for use in liboqs.
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_COMMON_H
#define OQS_COMMON_H
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <oqs/oqsconfig.h>
#if defined(__cplusplus)
extern "C" {
#endif
/**
* Macro for terminating the program if x is
* a null pointer.
*/
#define OQS_EXIT_IF_NULLPTR(x, loc) \
do { \
if ((x) == (void *)0) { \
fprintf(stderr, "Unexpected NULL returned from %s API. Exiting.\n", \
loc); \
exit(EXIT_FAILURE); \
} \
} while (0)
/**
* This macro is intended to replace those assert()s
* involving side-effecting statements in aes/aes_ossl.c.
*
* assert() becomes a no-op when -DNDEBUG is defined,
* which causes compilation failures when the statement
* being checked also results in side-effects.
*
* This is a temporary workaround until a better error
* handling strategy is developed.
*/
#ifdef OQS_USE_OPENSSL
#ifdef OPENSSL_NO_STDIO
#define OQS_OPENSSL_GUARD(x) \
do { \
if (1 != (x)) { \
fprintf(stderr, "Error return value from OpenSSL API: %d. Exiting.\n", \
x); \
exit(EXIT_FAILURE); \
} \
} while (0)
#else // OPENSSL_NO_STDIO
#define OQS_OPENSSL_GUARD(x) \
do { \
if (1 != (x)) { \
fprintf(stderr, "Error return value from OpenSSL API: %d. Exiting.\n", \
x); \
OSSL_FUNC(ERR_print_errors_fp)(stderr); \
exit(EXIT_FAILURE); \
} \
} while (0)
#endif // OPENSSL_NO_STDIO
#endif // OQS_USE_OPENSSL
/**
* Certain functions (such as OQS_randombytes_openssl in
* src/rand/rand.c) take in a size_t parameter, but can
* only handle values up to INT_MAX for those parameters.
* This macro is a temporary workaround for such functions.
*/
#define SIZE_T_TO_INT_OR_EXIT(size_t_var_name, int_var_name) \
int int_var_name = 0; \
if (size_t_var_name <= INT_MAX) { \
int_var_name = (int)size_t_var_name; \
} else { \
exit(EXIT_FAILURE); \
}
/**
* Defines which functions should be exposed outside the LibOQS library
*
* By default the visibility of all the symbols is defined to "hidden"
* Only the library API should be marked as default
*
* Example: OQS_API return_value function_name(void);
*/
#if defined(_WIN32)
#define OQS_API __declspec(dllexport)
#else
#define OQS_API __attribute__((visibility("default")))
#endif
#if defined(OQS_SYS_UEFI)
#undef OQS_API
#define OQS_API
#endif
/**
* Represents return values from functions.
*
* Callers should compare with the symbol rather than the individual value.
* For example,
*
* ret = OQS_KEM_encaps(...);
* if (ret == OQS_SUCCESS) { ... }
*
* rather than
*
* if (!OQS_KEM_encaps(...) { ... }
*
*/
typedef enum {
/** Used to indicate that some undefined error occurred. */
OQS_ERROR = -1,
/** Used to indicate successful return from function. */
OQS_SUCCESS = 0,
/** Used to indicate failures in external libraries (e.g., OpenSSL). */
OQS_EXTERNAL_LIB_ERROR_OPENSSL = 50,
} OQS_STATUS;
/**
* CPU runtime detection flags
*/
typedef enum {
OQS_CPU_EXT_INIT, /* Must be first */
/* Start extension list */
OQS_CPU_EXT_ADX,
OQS_CPU_EXT_AES,
OQS_CPU_EXT_AVX,
OQS_CPU_EXT_AVX2,
OQS_CPU_EXT_AVX512,
OQS_CPU_EXT_BMI1,
OQS_CPU_EXT_BMI2,
OQS_CPU_EXT_PCLMULQDQ,
OQS_CPU_EXT_VPCLMULQDQ,
OQS_CPU_EXT_POPCNT,
OQS_CPU_EXT_SSE,
OQS_CPU_EXT_SSE2,
OQS_CPU_EXT_SSE3,
OQS_CPU_EXT_ARM_AES,
OQS_CPU_EXT_ARM_SHA2,
OQS_CPU_EXT_ARM_SHA3,
OQS_CPU_EXT_ARM_NEON,
/* End extension list */
OQS_CPU_EXT_COUNT, /* Must be last */
} OQS_CPU_EXT;
/**
* Checks if the CPU supports a given extension
*
* \return 1 if the given CPU extension is available, 0 otherwise.
*/
OQS_API int OQS_CPU_has_extension(OQS_CPU_EXT ext);
/**
* This currently sets the values in the OQS_CPU_EXTENSIONS
* and prefetches the OpenSSL objects if necessary.
*/
OQS_API void OQS_init(void);
/**
* This function stops OpenSSL threads, which allows resources
* to be cleaned up in the correct order.
* @note When liboqs is used in a multithreaded application,
* each thread should call this function prior to stopping.
*/
OQS_API void OQS_thread_stop(void);
/**
* This function frees prefetched OpenSSL objects
*/
OQS_API void OQS_destroy(void);
/**
* Return library version string.
*/
OQS_API const char *OQS_version(void);
/**
* @brief Memory allocation and deallocation functions.
*
* These functions provide a unified interface for memory operations,
* using OpenSSL functions when OQS_USE_OPENSSL is defined, and
* standard C library functions otherwise.
*/
/**
* Allocates memory of a given size.
* @param size The size of the memory to be allocated in bytes.
* @return A pointer to the allocated memory.
*/
OQS_API void *OQS_MEM_malloc(size_t size);
/**
* Allocates memory for an array of elements of a given size.
* @param num_elements The number of elements to allocate.
* @param element_size The size of each element in bytes.
* @return A pointer to the allocated memory.
*/
OQS_API void *OQS_MEM_calloc(size_t num_elements, size_t element_size);
/**
* Duplicates a string.
* @param str The string to be duplicated.
* @return A pointer to the newly allocated string.
*/
OQS_API char *OQS_MEM_strdup(const char *str);
/**
* Constant time comparison of byte sequences `a` and `b` of length `len`.
* Returns 0 if the byte sequences are equal or if `len`=0.
* Returns 1 otherwise.
*
* @param[in] a A byte sequence of length at least `len`.
* @param[in] b A byte sequence of length at least `len`.
* @param[in] len The number of bytes to compare.
*/
OQS_API int OQS_MEM_secure_bcmp(const void *a, const void *b, size_t len);
/**
* Zeros out `len` bytes of memory starting at `ptr`.
*
* Designed to be protected against optimizing compilers which try to remove
* "unnecessary" operations. Should be used for all buffers containing secret
* data.
*
* @param[in] ptr The start of the memory to zero out.
* @param[in] len The number of bytes to zero out.
*/
OQS_API void OQS_MEM_cleanse(void *ptr, size_t len);
/**
* Zeros out `len` bytes of memory starting at `ptr`, then frees `ptr`.
*
* Can be called with `ptr = NULL`, in which case no operation is performed.
*
* Designed to be protected against optimizing compilers which try to remove
* "unnecessary" operations. Should be used for all buffers containing secret
* data.
*
* @param[in] ptr The start of the memory to zero out and free.
* @param[in] len The number of bytes to zero out.
*/
OQS_API void OQS_MEM_secure_free(void *ptr, size_t len);
/**
* Frees `ptr`.
*
* Can be called with `ptr = NULL`, in which case no operation is performed.
*
* Should only be used on non-secret data.
*
* @param[in] ptr The start of the memory to free.
*/
OQS_API void OQS_MEM_insecure_free(void *ptr);
/**
* Internal implementation of C11 aligned_alloc to work around compiler quirks.
*
* Allocates size bytes of uninitialized memory with a base pointer that is
* a multiple of alignment. Alignment must be a power of two and a multiple
* of sizeof(void *). Size must be a multiple of alignment.
* @note The allocated memory should be freed with `OQS_MEM_aligned_free` when
* it is no longer needed.
*/
void *OQS_MEM_aligned_alloc(size_t alignment, size_t size);
/**
* Free memory allocated with OQS_MEM_aligned_alloc.
*/
void OQS_MEM_aligned_free(void *ptr);
/**
* Free and zeroize memory allocated with OQS_MEM_aligned_alloc.
*/
void OQS_MEM_aligned_secure_free(void *ptr, size_t len);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_COMMON_H
@@ -0,0 +1,326 @@
/**
* \file kem.h
* \brief Key encapsulation mechanisms
*
* The file `tests/example_kem.c` contains two examples on using the OQS_KEM API.
*
* The first example uses the individual scheme's algorithms directly and uses
* no dynamic memory allocation -- all buffers are allocated on the stack, with
* sizes indicated using preprocessor macros. Since algorithms can be disabled at
* compile-time, the programmer should wrap the code in \#ifdefs.
*
* The second example uses an OQS_KEM object to use an algorithm specified at
* runtime. Therefore it uses dynamic memory allocation -- all buffers must be
* malloc'ed by the programmer, with sizes indicated using the corresponding length
* member of the OQS_KEM object in question. Since algorithms can be disabled at
* compile-time, the programmer should check that the OQS_KEM object is not `NULL`.
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_KEM_H
#define OQS_KEM_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <oqs/oqs.h>
#if defined(__cplusplus)
extern "C" {
#endif
/** Algorithm identifier for BIKE-L1 KEM (Round-4). */
#define OQS_KEM_alg_bike_l1 "BIKE-L1"
/** Algorithm identifier for BIKE-L3 KEM (Round-4). */
#define OQS_KEM_alg_bike_l3 "BIKE-L3"
/** Algorithm identifier for BIKE-L5 KEM (Round-4). */
#define OQS_KEM_alg_bike_l5 "BIKE-L5"
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALG_IDENTIFIER_START
/** Algorithm identifier for Classic-McEliece-348864 KEM. */
#define OQS_KEM_alg_classic_mceliece_348864 "Classic-McEliece-348864"
/** Algorithm identifier for Classic-McEliece-348864f KEM. */
#define OQS_KEM_alg_classic_mceliece_348864f "Classic-McEliece-348864f"
/** Algorithm identifier for Classic-McEliece-460896 KEM. */
#define OQS_KEM_alg_classic_mceliece_460896 "Classic-McEliece-460896"
/** Algorithm identifier for Classic-McEliece-460896f KEM. */
#define OQS_KEM_alg_classic_mceliece_460896f "Classic-McEliece-460896f"
/** Algorithm identifier for Classic-McEliece-6688128 KEM. */
#define OQS_KEM_alg_classic_mceliece_6688128 "Classic-McEliece-6688128"
/** Algorithm identifier for Classic-McEliece-6688128f KEM. */
#define OQS_KEM_alg_classic_mceliece_6688128f "Classic-McEliece-6688128f"
/** Algorithm identifier for Classic-McEliece-6960119 KEM. */
#define OQS_KEM_alg_classic_mceliece_6960119 "Classic-McEliece-6960119"
/** Algorithm identifier for Classic-McEliece-6960119f KEM. */
#define OQS_KEM_alg_classic_mceliece_6960119f "Classic-McEliece-6960119f"
/** Algorithm identifier for Classic-McEliece-8192128 KEM. */
#define OQS_KEM_alg_classic_mceliece_8192128 "Classic-McEliece-8192128"
/** Algorithm identifier for Classic-McEliece-8192128f KEM. */
#define OQS_KEM_alg_classic_mceliece_8192128f "Classic-McEliece-8192128f"
/** Algorithm identifier for HQC-128 KEM. */
#define OQS_KEM_alg_hqc_128 "HQC-128"
/** Algorithm identifier for HQC-192 KEM. */
#define OQS_KEM_alg_hqc_192 "HQC-192"
/** Algorithm identifier for HQC-256 KEM. */
#define OQS_KEM_alg_hqc_256 "HQC-256"
/** Algorithm identifier for Kyber512 KEM. */
#define OQS_KEM_alg_kyber_512 "Kyber512"
/** Algorithm identifier for Kyber768 KEM. */
#define OQS_KEM_alg_kyber_768 "Kyber768"
/** Algorithm identifier for Kyber1024 KEM. */
#define OQS_KEM_alg_kyber_1024 "Kyber1024"
/** Algorithm identifier for ML-KEM-512 KEM. */
#define OQS_KEM_alg_ml_kem_512 "ML-KEM-512"
/** Algorithm identifier for ML-KEM-768 KEM. */
#define OQS_KEM_alg_ml_kem_768 "ML-KEM-768"
/** Algorithm identifier for ML-KEM-1024 KEM. */
#define OQS_KEM_alg_ml_kem_1024 "ML-KEM-1024"
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALG_IDENTIFIER_END
/** Algorithm identifier for sntrup761 KEM. */
#define OQS_KEM_alg_ntruprime_sntrup761 "sntrup761"
/** Algorithm identifier for FrodoKEM-640-AES KEM. */
#define OQS_KEM_alg_frodokem_640_aes "FrodoKEM-640-AES"
/** Algorithm identifier for FrodoKEM-640-SHAKE KEM. */
#define OQS_KEM_alg_frodokem_640_shake "FrodoKEM-640-SHAKE"
/** Algorithm identifier for FrodoKEM-976-AES KEM. */
#define OQS_KEM_alg_frodokem_976_aes "FrodoKEM-976-AES"
/** Algorithm identifier for FrodoKEM-976-SHAKE KEM. */
#define OQS_KEM_alg_frodokem_976_shake "FrodoKEM-976-SHAKE"
/** Algorithm identifier for FrodoKEM-1344-AES KEM. */
#define OQS_KEM_alg_frodokem_1344_aes "FrodoKEM-1344-AES"
/** Algorithm identifier for FrodoKEM-1344-SHAKE KEM. */
#define OQS_KEM_alg_frodokem_1344_shake "FrodoKEM-1344-SHAKE"
// EDIT-WHEN-ADDING-KEM
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALGS_LENGTH_START
/** Number of algorithm identifiers above. */
#define OQS_KEM_algs_length 29
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALGS_LENGTH_END
/**
* Returns identifiers for available key encapsulation mechanisms in liboqs. Used with OQS_KEM_new.
*
* Note that algorithm identifiers are present in this list even when the algorithm is disabled
* at compile time.
*
* @param[in] i Index of the algorithm identifier to return, 0 <= i < OQS_KEM_algs_length
* @return Algorithm identifier as a string, or NULL.
*/
OQS_API const char *OQS_KEM_alg_identifier(size_t i);
/**
* Returns the number of key encapsulation mechanisms in liboqs. They can be enumerated with
* OQS_KEM_alg_identifier.
*
* Note that some mechanisms may be disabled at compile time.
*
* @return The number of key encapsulation mechanisms.
*/
OQS_API int OQS_KEM_alg_count(void);
/**
* Indicates whether the specified algorithm was enabled at compile-time or not.
*
* @param[in] method_name Name of the desired algorithm; one of the names in `OQS_KEM_algs`.
* @return 1 if enabled, 0 if disabled or not found
*/
OQS_API int OQS_KEM_alg_is_enabled(const char *method_name);
/**
* Key encapsulation mechanism object
*/
typedef struct OQS_KEM {
/** Printable string representing the name of the key encapsulation mechanism. */
const char *method_name;
/**
* Printable string representing the version of the cryptographic algorithm.
*
* Implementations with the same method_name and same alg_version will be interoperable.
* See README.md for information about algorithm compatibility.
*/
const char *alg_version;
/** The NIST security level (1, 2, 3, 4, 5) claimed in this algorithm's original NIST submission. */
uint8_t claimed_nist_level;
/** Whether the KEM offers IND-CCA security (TRUE) or IND-CPA security (FALSE). */
bool ind_cca;
/** The length, in bytes, of public keys for this KEM. */
size_t length_public_key;
/** The length, in bytes, of secret keys for this KEM. */
size_t length_secret_key;
/** The length, in bytes, of ciphertexts for this KEM. */
size_t length_ciphertext;
/** The length, in bytes, of shared secrets for this KEM. */
size_t length_shared_secret;
/** The length, in bytes, of seeds for derandomized keypair generation for this KEM. */
size_t length_keypair_seed;
/**
* Derandomized keypair generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `public_key` and
* `secret_key`, based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_KEM_*_length_*`.
*
* @param[out] public_key The public key represented as a byte string.
* @param[out] secret_key The secret key represented as a byte string.
* @param[in] seed The input randomness represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*keypair_derand)(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
/**
* Keypair generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `public_key` and
* `secret_key`, based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_KEM_*_length_*`.
*
* @param[out] public_key The public key represented as a byte string.
* @param[out] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*keypair)(uint8_t *public_key, uint8_t *secret_key);
/**
* Encapsulation algorithm.
*
* Caller is responsible for allocating sufficient memory for `ciphertext` and
* `shared_secret`, based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_KEM_*_length_*`.
*
* @param[out] ciphertext The ciphertext (encapsulation) represented as a byte string.
* @param[out] shared_secret The shared secret represented as a byte string.
* @param[in] public_key The public key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*encaps)(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key);
/**
* Decapsulation algorithm.
*
* Caller is responsible for allocating sufficient memory for `shared_secret`, based
* on the `length_*` members in this object or the per-scheme compile-time macros
* `OQS_KEM_*_length_*`.
*
* @param[out] shared_secret The shared secret represented as a byte string.
* @param[in] ciphertext The ciphertext (encapsulation) represented as a byte string.
* @param[in] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*decaps)(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key);
} OQS_KEM;
/**
* Constructs an OQS_KEM object for a particular algorithm.
*
* Callers should always check whether the return value is `NULL`, which indicates either than an
* invalid algorithm name was provided, or that the requested algorithm was disabled at compile-time.
*
* @param[in] method_name Name of the desired algorithm; one of the names in `OQS_KEM_algs`.
* @return An OQS_KEM for the particular algorithm, or `NULL` if the algorithm has been disabled at compile-time.
*/
OQS_API OQS_KEM *OQS_KEM_new(const char *method_name);
/**
* Derandomized keypair generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `public_key` and
* `secret_key`, based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_KEM_*_length_*`.
*
* @param[in] kem The OQS_KEM object representing the KEM.
* @param[out] public_key The public key represented as a byte string.
* @param[out] secret_key The secret key represented as a byte string.
* @param[in] seed The input randomness represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_KEM_keypair_derand(const OQS_KEM *kem, uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
/**
* Keypair generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `public_key` and
* `secret_key`, based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_KEM_*_length_*`.
*
* @param[in] kem The OQS_KEM object representing the KEM.
* @param[out] public_key The public key represented as a byte string.
* @param[out] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_KEM_keypair(const OQS_KEM *kem, uint8_t *public_key, uint8_t *secret_key);
/**
* Encapsulation algorithm.
*
* Caller is responsible for allocating sufficient memory for `ciphertext` and
* `shared_secret`, based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_KEM_*_length_*`.
*
* @param[in] kem The OQS_KEM object representing the KEM.
* @param[out] ciphertext The ciphertext (encapsulation) represented as a byte string.
* @param[out] shared_secret The shared secret represented as a byte string.
* @param[in] public_key The public key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_KEM_encaps(const OQS_KEM *kem, uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key);
/**
* Decapsulation algorithm.
*
* Caller is responsible for allocating sufficient memory for `shared_secret`, based
* on the `length_*` members in this object or the per-scheme compile-time macros
* `OQS_KEM_*_length_*`.
*
* @param[in] kem The OQS_KEM object representing the KEM.
* @param[out] shared_secret The shared secret represented as a byte string.
* @param[in] ciphertext The ciphertext (encapsulation) represented as a byte string.
* @param[in] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_KEM_decaps(const OQS_KEM *kem, uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key);
/**
* Frees an OQS_KEM object that was constructed by OQS_KEM_new.
*
* @param[in] kem The OQS_KEM object to free.
*/
OQS_API void OQS_KEM_free(OQS_KEM *kem);
#ifdef OQS_ENABLE_KEM_BIKE
#include <oqs/kem_bike.h>
#endif /* OQS_ENABLE_KEM_BIKE */
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_INCLUDE_START
#ifdef OQS_ENABLE_KEM_CLASSIC_MCELIECE
#include <oqs/kem_classic_mceliece.h>
#endif /* OQS_ENABLE_KEM_CLASSIC_MCELIECE */
#ifdef OQS_ENABLE_KEM_HQC
#include <oqs/kem_hqc.h>
#endif /* OQS_ENABLE_KEM_HQC */
#ifdef OQS_ENABLE_KEM_KYBER
#include <oqs/kem_kyber.h>
#endif /* OQS_ENABLE_KEM_KYBER */
#ifdef OQS_ENABLE_KEM_ML_KEM
#include <oqs/kem_ml_kem.h>
#endif /* OQS_ENABLE_KEM_ML_KEM */
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_INCLUDE_END
#ifdef OQS_ENABLE_KEM_NTRUPRIME
#include <oqs/kem_ntruprime.h>
#endif /* OQS_ENABLE_KEM_NTRUPRIME */
#ifdef OQS_ENABLE_KEM_FRODOKEM
#include <oqs/kem_frodokem.h>
#endif /* OQS_ENABLE_KEM_FRODOKEM */
// EDIT-WHEN-ADDING-KEM
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_KEM_H
@@ -0,0 +1,48 @@
// SPDX-License-Identifier: MIT
#ifndef OQS_KEM_KYBER_H
#define OQS_KEM_KYBER_H
#include <oqs/oqs.h>
#if defined(OQS_ENABLE_KEM_kyber_512)
#define OQS_KEM_kyber_512_length_public_key 800
#define OQS_KEM_kyber_512_length_secret_key 1632
#define OQS_KEM_kyber_512_length_ciphertext 768
#define OQS_KEM_kyber_512_length_shared_secret 32
#define OQS_KEM_kyber_512_length_keypair_seed 0
OQS_KEM *OQS_KEM_kyber_512_new(void);
OQS_API OQS_STATUS OQS_KEM_kyber_512_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_kyber_512_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
OQS_API OQS_STATUS OQS_KEM_kyber_512_encaps(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key);
OQS_API OQS_STATUS OQS_KEM_kyber_512_decaps(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key);
#endif
#if defined(OQS_ENABLE_KEM_kyber_768)
#define OQS_KEM_kyber_768_length_public_key 1184
#define OQS_KEM_kyber_768_length_secret_key 2400
#define OQS_KEM_kyber_768_length_ciphertext 1088
#define OQS_KEM_kyber_768_length_shared_secret 32
#define OQS_KEM_kyber_768_length_keypair_seed 0
OQS_KEM *OQS_KEM_kyber_768_new(void);
OQS_API OQS_STATUS OQS_KEM_kyber_768_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_kyber_768_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
OQS_API OQS_STATUS OQS_KEM_kyber_768_encaps(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key);
OQS_API OQS_STATUS OQS_KEM_kyber_768_decaps(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key);
#endif
#if defined(OQS_ENABLE_KEM_kyber_1024)
#define OQS_KEM_kyber_1024_length_public_key 1568
#define OQS_KEM_kyber_1024_length_secret_key 3168
#define OQS_KEM_kyber_1024_length_ciphertext 1568
#define OQS_KEM_kyber_1024_length_shared_secret 32
#define OQS_KEM_kyber_1024_length_keypair_seed 0
OQS_KEM *OQS_KEM_kyber_1024_new(void);
OQS_API OQS_STATUS OQS_KEM_kyber_1024_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_kyber_1024_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
OQS_API OQS_STATUS OQS_KEM_kyber_1024_encaps(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key);
OQS_API OQS_STATUS OQS_KEM_kyber_1024_decaps(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key);
#endif
#endif
@@ -0,0 +1,48 @@
// SPDX-License-Identifier: MIT
#ifndef OQS_KEM_ML_KEM_H
#define OQS_KEM_ML_KEM_H
#include <oqs/oqs.h>
#if defined(OQS_ENABLE_KEM_ml_kem_512)
#define OQS_KEM_ml_kem_512_length_public_key 800
#define OQS_KEM_ml_kem_512_length_secret_key 1632
#define OQS_KEM_ml_kem_512_length_ciphertext 768
#define OQS_KEM_ml_kem_512_length_shared_secret 32
#define OQS_KEM_ml_kem_512_length_keypair_seed 64
OQS_KEM *OQS_KEM_ml_kem_512_new(void);
OQS_API OQS_STATUS OQS_KEM_ml_kem_512_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_ml_kem_512_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
OQS_API OQS_STATUS OQS_KEM_ml_kem_512_encaps(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key);
OQS_API OQS_STATUS OQS_KEM_ml_kem_512_decaps(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key);
#endif
#if defined(OQS_ENABLE_KEM_ml_kem_768)
#define OQS_KEM_ml_kem_768_length_public_key 1184
#define OQS_KEM_ml_kem_768_length_secret_key 2400
#define OQS_KEM_ml_kem_768_length_ciphertext 1088
#define OQS_KEM_ml_kem_768_length_shared_secret 32
#define OQS_KEM_ml_kem_768_length_keypair_seed 64
OQS_KEM *OQS_KEM_ml_kem_768_new(void);
OQS_API OQS_STATUS OQS_KEM_ml_kem_768_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_ml_kem_768_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
OQS_API OQS_STATUS OQS_KEM_ml_kem_768_encaps(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key);
OQS_API OQS_STATUS OQS_KEM_ml_kem_768_decaps(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key);
#endif
#if defined(OQS_ENABLE_KEM_ml_kem_1024)
#define OQS_KEM_ml_kem_1024_length_public_key 1568
#define OQS_KEM_ml_kem_1024_length_secret_key 3168
#define OQS_KEM_ml_kem_1024_length_ciphertext 1568
#define OQS_KEM_ml_kem_1024_length_shared_secret 32
#define OQS_KEM_ml_kem_1024_length_keypair_seed 64
OQS_KEM *OQS_KEM_ml_kem_1024_new(void);
OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_encaps(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key);
OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_decaps(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key);
#endif
#endif
@@ -0,0 +1,26 @@
/**
* \file oqs.h
* \brief Overall header file for the liboqs public API.
*
* C programs using liboqs can include just this one file, and it will include all
* other necessary headers from liboqs.
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_H
#define OQS_H
#include <oqs/oqsconfig.h>
#include <oqs/common.h>
#include <oqs/rand.h>
#include <oqs/kem.h>
#include <oqs/sig.h>
#include <oqs/sig_stfl.h>
#include <oqs/aes_ops.h>
#include <oqs/sha2_ops.h>
#include <oqs/sha3_ops.h>
#include <oqs/sha3x4_ops.h>
#endif // OQS_H
@@ -0,0 +1,405 @@
// SPDX-License-Identifier: MIT
/**
* Version of liboqs as a string. Equivalent to {MAJOR}.{MINOR}.{PATCH}{PRE_RELEASE}
*/
#define OQS_VERSION_TEXT "0.14.0"
/**
* Version levels of liboqs as integers.
*/
#define OQS_VERSION_MAJOR 0
#define OQS_VERSION_MINOR 14
#define OQS_VERSION_PATCH 0
/**
* OQS_VERSION_PRE_RELEASE is defined if this is a pre-release version of liboqs, otherwise it is undefined.
* Examples: "-dev" or "-rc1".
*/
/* #undef OQS_VERSION_PRE_RELEASE */
#define OQS_COMPILE_BUILD_TARGET "x86_64-Linux-6.11.0-1018-azure"
#define OQS_DIST_BUILD 1
#define OQS_DIST_X86_64_BUILD 1
/* #undef OQS_DIST_X86_BUILD */
/* #undef OQS_DIST_ARM64_V8_BUILD */
/* #undef OQS_DIST_ARM32_V7_BUILD */
/* #undef OQS_DIST_PPC64LE_BUILD */
/* #undef OQS_DEBUG_BUILD */
#define ARCH_X86_64 1
/* #undef ARCH_ARM64v8 */
/* #undef ARCH_ARM32v7 */
/* #undef BUILD_SHARED_LIBS */
#define OQS_BUILD_ONLY_LIB 1
#define OQS_OPT_TARGET "generic"
/* #undef USE_COVERAGE */
/* #undef USE_SANITIZER */
#define CMAKE_BUILD_TYPE "Release"
#define OQS_USE_OPENSSL 1
/* #undef OQS_USE_AES_OPENSSL */
#define OQS_USE_SHA2_OPENSSL 1
/* #undef OQS_USE_SHA3_OPENSSL */
/* #undef OQS_DLOPEN_OPENSSL */
/* #undef OQS_OPENSSL_CRYPTO_SONAME */
/* #undef OQS_EMBEDDED_BUILD */
#define OQS_USE_PTHREADS 1
/* #undef OQS_USE_ADX_INSTRUCTIONS */
/* #undef OQS_USE_AES_INSTRUCTIONS */
/* #undef OQS_USE_AVX_INSTRUCTIONS */
/* #undef OQS_USE_AVX2_INSTRUCTIONS */
/* #undef OQS_USE_AVX512_INSTRUCTIONS */
/* #undef OQS_USE_BMI1_INSTRUCTIONS */
/* #undef OQS_USE_BMI2_INSTRUCTIONS */
/* #undef OQS_USE_PCLMULQDQ_INSTRUCTIONS */
/* #undef OQS_USE_VPCLMULQDQ_INSTRUCTIONS */
/* #undef OQS_USE_POPCNT_INSTRUCTIONS */
/* #undef OQS_USE_SSE_INSTRUCTIONS */
/* #undef OQS_USE_SSE2_INSTRUCTIONS */
/* #undef OQS_USE_SSE3_INSTRUCTIONS */
/* #undef OQS_USE_ARM_AES_INSTRUCTIONS */
/* #undef OQS_USE_ARM_SHA2_INSTRUCTIONS */
/* #undef OQS_USE_ARM_SHA3_INSTRUCTIONS */
/* #undef OQS_USE_ARM_NEON_INSTRUCTIONS */
/* #undef OQS_SPEED_USE_ARM_PMU */
/* #undef OQS_ENABLE_TEST_CONSTANT_TIME */
#define OQS_ENABLE_SHA3_xkcp_low_avx2 1
#define OQS_USE_SHA3_AVX512VL 1
#define OQS_USE_CUPQC 0
/* #undef OQS_ENABLE_KEM_BIKE */
/* #undef OQS_ENABLE_KEM_bike_l1 */
/* #undef OQS_ENABLE_KEM_bike_l3 */
/* #undef OQS_ENABLE_KEM_bike_l5 */
/* #undef OQS_ENABLE_KEM_FRODOKEM */
/* #undef OQS_ENABLE_KEM_frodokem_640_aes */
/* #undef OQS_ENABLE_KEM_frodokem_640_shake */
/* #undef OQS_ENABLE_KEM_frodokem_976_aes */
/* #undef OQS_ENABLE_KEM_frodokem_976_shake */
/* #undef OQS_ENABLE_KEM_frodokem_1344_aes */
/* #undef OQS_ENABLE_KEM_frodokem_1344_shake */
/* #undef OQS_ENABLE_KEM_NTRUPRIME */
/* #undef OQS_ENABLE_KEM_ntruprime_sntrup761 */
/* #undef OQS_ENABLE_KEM_ntruprime_sntrup761_avx2 */
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ADD_ALG_ENABLE_DEFINES_START
/* #undef OQS_ENABLE_KEM_CLASSIC_MCELIECE */
/* #undef OQS_ENABLE_KEM_classic_mceliece_348864 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_348864_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_348864f */
/* #undef OQS_ENABLE_KEM_classic_mceliece_348864f_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_460896 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_460896_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_460896f */
/* #undef OQS_ENABLE_KEM_classic_mceliece_460896f_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_6688128 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_6688128_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_6688128f */
/* #undef OQS_ENABLE_KEM_classic_mceliece_6688128f_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_6960119 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_6960119_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_6960119f */
/* #undef OQS_ENABLE_KEM_classic_mceliece_6960119f_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_8192128 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_8192128_avx2 */
/* #undef OQS_ENABLE_KEM_classic_mceliece_8192128f */
/* #undef OQS_ENABLE_KEM_classic_mceliece_8192128f_avx2 */
/* #undef OQS_ENABLE_KEM_HQC */
/* #undef OQS_ENABLE_KEM_hqc_128 */
/* #undef OQS_ENABLE_KEM_hqc_192 */
/* #undef OQS_ENABLE_KEM_hqc_256 */
#define OQS_ENABLE_KEM_KYBER 1
#define OQS_ENABLE_KEM_kyber_512 1
#define OQS_ENABLE_KEM_kyber_512_avx2 1
/* #undef OQS_ENABLE_KEM_kyber_512_aarch64 */
#define OQS_ENABLE_KEM_kyber_768 1
#define OQS_ENABLE_KEM_kyber_768_avx2 1
/* #undef OQS_ENABLE_KEM_kyber_768_aarch64 */
#define OQS_ENABLE_KEM_kyber_1024 1
#define OQS_ENABLE_KEM_kyber_1024_avx2 1
/* #undef OQS_ENABLE_KEM_kyber_1024_aarch64 */
#define OQS_ENABLE_KEM_ML_KEM 1
#define OQS_ENABLE_KEM_ml_kem_512 1
#define OQS_ENABLE_KEM_ml_kem_512_x86_64 1
/* #undef OQS_ENABLE_KEM_ml_kem_512_aarch64 */
/* #undef OQS_ENABLE_KEM_ml_kem_512_cuda */
#define OQS_ENABLE_KEM_ml_kem_768 1
#define OQS_ENABLE_KEM_ml_kem_768_x86_64 1
/* #undef OQS_ENABLE_KEM_ml_kem_768_aarch64 */
/* #undef OQS_ENABLE_KEM_ml_kem_768_cuda */
#define OQS_ENABLE_KEM_ml_kem_1024 1
#define OQS_ENABLE_KEM_ml_kem_1024_x86_64 1
/* #undef OQS_ENABLE_KEM_ml_kem_1024_aarch64 */
/* #undef OQS_ENABLE_KEM_ml_kem_1024_cuda */
/* #undef OQS_ENABLE_SIG_DILITHIUM */
/* #undef OQS_ENABLE_SIG_dilithium_2 */
/* #undef OQS_ENABLE_SIG_dilithium_2_avx2 */
/* #undef OQS_ENABLE_SIG_dilithium_2_aarch64 */
/* #undef OQS_ENABLE_SIG_dilithium_3 */
/* #undef OQS_ENABLE_SIG_dilithium_3_avx2 */
/* #undef OQS_ENABLE_SIG_dilithium_3_aarch64 */
/* #undef OQS_ENABLE_SIG_dilithium_5 */
/* #undef OQS_ENABLE_SIG_dilithium_5_avx2 */
/* #undef OQS_ENABLE_SIG_dilithium_5_aarch64 */
/* #undef OQS_ENABLE_SIG_ML_DSA */
/* #undef OQS_ENABLE_SIG_ml_dsa_44 */
/* #undef OQS_ENABLE_SIG_ml_dsa_44_avx2 */
/* #undef OQS_ENABLE_SIG_ml_dsa_65 */
/* #undef OQS_ENABLE_SIG_ml_dsa_65_avx2 */
/* #undef OQS_ENABLE_SIG_ml_dsa_87 */
/* #undef OQS_ENABLE_SIG_ml_dsa_87_avx2 */
/* #undef OQS_ENABLE_SIG_FALCON */
/* #undef OQS_ENABLE_SIG_falcon_512 */
/* #undef OQS_ENABLE_SIG_falcon_512_avx2 */
/* #undef OQS_ENABLE_SIG_falcon_512_aarch64 */
/* #undef OQS_ENABLE_SIG_falcon_1024 */
/* #undef OQS_ENABLE_SIG_falcon_1024_avx2 */
/* #undef OQS_ENABLE_SIG_falcon_1024_aarch64 */
/* #undef OQS_ENABLE_SIG_falcon_padded_512 */
/* #undef OQS_ENABLE_SIG_falcon_padded_512_avx2 */
/* #undef OQS_ENABLE_SIG_falcon_padded_512_aarch64 */
/* #undef OQS_ENABLE_SIG_falcon_padded_1024 */
/* #undef OQS_ENABLE_SIG_falcon_padded_1024_avx2 */
/* #undef OQS_ENABLE_SIG_falcon_padded_1024_aarch64 */
/* #undef OQS_ENABLE_SIG_SPHINCS */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_128f_simple */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_128f_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_128s_simple */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_128s_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_192f_simple */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_192f_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_192s_simple */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_192s_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_256f_simple */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_256f_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_256s_simple */
/* #undef OQS_ENABLE_SIG_sphincs_sha2_256s_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_shake_128f_simple */
/* #undef OQS_ENABLE_SIG_sphincs_shake_128f_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_shake_128s_simple */
/* #undef OQS_ENABLE_SIG_sphincs_shake_128s_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_shake_192f_simple */
/* #undef OQS_ENABLE_SIG_sphincs_shake_192f_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_shake_192s_simple */
/* #undef OQS_ENABLE_SIG_sphincs_shake_192s_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_shake_256f_simple */
/* #undef OQS_ENABLE_SIG_sphincs_shake_256f_simple_avx2 */
/* #undef OQS_ENABLE_SIG_sphincs_shake_256s_simple */
/* #undef OQS_ENABLE_SIG_sphincs_shake_256s_simple_avx2 */
/* #undef OQS_ENABLE_SIG_MAYO */
/* #undef OQS_ENABLE_SIG_mayo_1 */
/* #undef OQS_ENABLE_SIG_mayo_1_avx2 */
/* #undef OQS_ENABLE_SIG_mayo_1_neon */
/* #undef OQS_ENABLE_SIG_mayo_2 */
/* #undef OQS_ENABLE_SIG_mayo_2_avx2 */
/* #undef OQS_ENABLE_SIG_mayo_2_neon */
/* #undef OQS_ENABLE_SIG_mayo_3 */
/* #undef OQS_ENABLE_SIG_mayo_3_avx2 */
/* #undef OQS_ENABLE_SIG_mayo_3_neon */
/* #undef OQS_ENABLE_SIG_mayo_5 */
/* #undef OQS_ENABLE_SIG_mayo_5_avx2 */
/* #undef OQS_ENABLE_SIG_mayo_5_neon */
/* #undef OQS_ENABLE_SIG_CROSS */
/* #undef OQS_ENABLE_SIG_cross_rsdp_128_balanced */
/* #undef OQS_ENABLE_SIG_cross_rsdp_128_balanced_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdp_128_fast */
/* #undef OQS_ENABLE_SIG_cross_rsdp_128_fast_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdp_128_small */
/* #undef OQS_ENABLE_SIG_cross_rsdp_128_small_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdp_192_balanced */
/* #undef OQS_ENABLE_SIG_cross_rsdp_192_balanced_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdp_192_fast */
/* #undef OQS_ENABLE_SIG_cross_rsdp_192_fast_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdp_192_small */
/* #undef OQS_ENABLE_SIG_cross_rsdp_192_small_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdp_256_balanced */
/* #undef OQS_ENABLE_SIG_cross_rsdp_256_balanced_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdp_256_fast */
/* #undef OQS_ENABLE_SIG_cross_rsdp_256_fast_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdp_256_small */
/* #undef OQS_ENABLE_SIG_cross_rsdp_256_small_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_128_balanced */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_128_balanced_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_128_fast */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_128_fast_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_128_small */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_128_small_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_192_balanced */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_192_balanced_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_192_fast */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_192_fast_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_192_small */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_192_small_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_256_balanced */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_256_balanced_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_256_fast */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_256_fast_avx2 */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_256_small */
/* #undef OQS_ENABLE_SIG_cross_rsdpg_256_small_avx2 */
/* #undef OQS_ENABLE_SIG_UOV */
/* #undef OQS_ENABLE_SIG_uov_ov_Is */
/* #undef OQS_ENABLE_SIG_uov_ov_Is_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_Is_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_III */
/* #undef OQS_ENABLE_SIG_uov_ov_III_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_III_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_V */
/* #undef OQS_ENABLE_SIG_uov_ov_V_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_V_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_Is_pkc */
/* #undef OQS_ENABLE_SIG_uov_ov_Is_pkc_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_Is_pkc_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip_pkc */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip_pkc_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip_pkc_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_III_pkc */
/* #undef OQS_ENABLE_SIG_uov_ov_III_pkc_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_III_pkc_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_V_pkc */
/* #undef OQS_ENABLE_SIG_uov_ov_V_pkc_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_V_pkc_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_Is_pkc_skc */
/* #undef OQS_ENABLE_SIG_uov_ov_Is_pkc_skc_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_Is_pkc_skc_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip_pkc_skc */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip_pkc_skc_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_Ip_pkc_skc_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_III_pkc_skc */
/* #undef OQS_ENABLE_SIG_uov_ov_III_pkc_skc_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_III_pkc_skc_avx2 */
/* #undef OQS_ENABLE_SIG_uov_ov_V_pkc_skc */
/* #undef OQS_ENABLE_SIG_uov_ov_V_pkc_skc_neon */
/* #undef OQS_ENABLE_SIG_uov_ov_V_pkc_skc_avx2 */
/* #undef OQS_ENABLE_SIG_SNOVA */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_SHAKE */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_SHAKE_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_SHAKE_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_esk */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_esk_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_esk_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_SHAKE_esk */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_SHAKE_esk_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_4_SHAKE_esk_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_37_17_2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_37_17_2_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_37_17_2_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_25_8_3 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_25_8_3_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_25_8_3_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_56_25_2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_56_25_2_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_56_25_2_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_49_11_3 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_49_11_3_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_49_11_3_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_37_8_4 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_37_8_4_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_37_8_4_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_5 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_5_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_24_5_5_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_60_10_4 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_60_10_4_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_60_10_4_neon */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_29_6_5 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_29_6_5_avx2 */
/* #undef OQS_ENABLE_SIG_snova_SNOVA_29_6_5_neon */
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ADD_ALG_ENABLE_DEFINES_END
///// OQS_COPY_FROM_LIBJADE_FRAGMENT_ADD_ALG_ENABLE_DEFINES_START
#define OQS_LIBJADE_BUILD 0
/* #undef OQS_ENABLE_LIBJADE_KEM_KYBER */
/* #undef OQS_ENABLE_LIBJADE_KEM_kyber_512 */
/* #undef OQS_ENABLE_LIBJADE_KEM_kyber_512_avx2 */
/* #undef OQS_ENABLE_LIBJADE_KEM_kyber_768 */
/* #undef OQS_ENABLE_LIBJADE_KEM_kyber_768_avx2 */
///// OQS_COPY_FROM_LIBJADE_FRAGMENT_ADD_ALG_ENABLE_DEFINES_END
/* #undef OQS_ENABLE_SIG_STFL_XMSS */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha256_h10 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha256_h16 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha256_h20 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake128_h10 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake128_h16 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake128_h20 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha512_h10 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha512_h16 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha512_h20 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h10 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h16 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h20 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha256_h10_192 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha256_h16_192 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h10_192 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h16_192 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h20_192 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h10_256 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h16_256 */
/* #undef OQS_ENABLE_SIG_STFL_xmss_shake256_h20_256 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_4 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h40_2 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h40_4 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h40_8 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h60_3 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h60_6 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h60_12 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_shake128_h20_2 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_shake128_h20_4 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_shake128_h40_2 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_shake128_h40_4 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_shake128_h40_8 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_shake128_h60_3 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_shake128_h60_6 */
/* #undef OQS_ENABLE_SIG_STFL_xmssmt_shake128_h60_12 */
/* #undef OQS_ENABLE_SIG_STFL_LMS */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h5_w1 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h5_w2 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h5_w4 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h5_w8 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h10_w1 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h10_w2 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h10_w4 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h10_w8 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h15_w1 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h15_w2 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h15_w4 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h5_w8_h5_w8 */
/* #undef OQS_ENABLE_SIG_STFL_lms_sha256_h10_w4_h5_w8 */
/* #undef OQS_HAZARDOUS_EXPERIMENTAL_ENABLE_SIG_STFL_KEY_SIG_GEN */
/* #undef OQS_ALLOW_STFL_KEY_AND_SIG_GEN */
/* #undef OQS_ALLOW_XMSS_KEY_AND_SIG_GEN */
/* #undef OQS_ALLOW_LMS_KEY_AND_SIG_GEN */
@@ -0,0 +1,66 @@
/**
* \file rand.h
* \brief Random number generator.
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_RANDOM_H
#define OQS_RANDOM_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <oqs/common.h>
#if defined(__cplusplus)
extern "C" {
#endif
/** Algorithm identifier for system PRNG. */
#define OQS_RAND_alg_system "system"
/** Algorithm identifier for using OpenSSL's PRNG. */
#define OQS_RAND_alg_openssl "OpenSSL"
/**
* Switches OQS_randombytes to use the specified algorithm.
*
* @warning In case you have set a custom algorithm using `OQS_randombytes_custom_algorithm`
* before, this function will overwrite it again. Hence, you have to set your custom
* algorithm again after calling this function.
*
* @param[in] algorithm The name of the algorithm to use.
* @return OQS_SUCCESS if `algorithm` is a supported algorithm name, OQS_ERROR otherwise.
*/
OQS_API OQS_STATUS OQS_randombytes_switch_algorithm(const char *algorithm);
/**
* Switches OQS_randombytes to use the given function.
*
* This allows additional custom RNGs besides the provided ones. The provided RNG
* function must have the same signature as `OQS_randombytes`.
*
* @param[in] algorithm_ptr Pointer to the RNG function to use.
*/
OQS_API void OQS_randombytes_custom_algorithm(void (*algorithm_ptr)(uint8_t *, size_t));
/**
* Fills the given memory with the requested number of (pseudo)random bytes.
*
* This implementation uses whichever algorithm has been selected by
* OQS_randombytes_switch_algorithm. The default is OQS_randombytes_system, which
* reads bytes from a system specific default source.
*
* The caller is responsible for providing a buffer allocated with sufficient room.
*
* @param[out] random_array Pointer to the memory to fill with (pseudo)random bytes
* @param[in] bytes_to_read The number of random bytes to read into memory
*/
OQS_API void OQS_randombytes(uint8_t *random_array, size_t bytes_to_read);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_RANDOM_H
@@ -0,0 +1,47 @@
/**
* \file rand_nist.h
* \brief NIST DRBG
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_RAND_NIST_H
#define OQS_RAND_NIST_H
#include <stddef.h>
#include <stdint.h>
typedef struct {
unsigned char Key[32];
unsigned char V[16];
int reseed_counter;
} OQS_NIST_DRBG_struct;
/**
* Initializes the NIST DRBG with a given seed and with 256-bit security.
*
* @param[in] entropy_input The seed; must be exactly 48 bytes
* @param[in] personalization_string An optional personalization string;
* may be NULL; if not NULL, must be at least 48 bytes long
*/
void OQS_randombytes_nist_kat_init_256bit(const uint8_t *entropy_input, const uint8_t *personalization_string);
/**
* Fills the given memory with the requested number of pseudorandom bytes using the NIST DRBG.
*
* @param[out] random_array Pointer to the memory to fill with (pseudo)random bytes
* @param[in] bytes_to_read The number of random bytes to read into memory
*/
void OQS_randombytes_nist_kat(uint8_t *random_array, size_t bytes_to_read);
/**
* Writes the current state of the NIST DRBG into the provided memory.
*/
void OQS_randombytes_nist_kat_get_state(void *out);
/**
* Overwrites the current state of the NIST DRBG from the provided memory.
*/
void OQS_randombytes_nist_kat_set_state(const void *in);
#endif // OQS_RAND_NIST_H
@@ -0,0 +1,246 @@
/**
* \file sha2.h
* \brief SHA2 functions; not part of the OQS public API
*
* Contains the API and documentation for SHA2 digest implementation
*
* <b>Note this is not part of the OQS public API: implementations within liboqs can use these
* functions, but external consumers of liboqs should not use these functions.</b>
*
* \author Douglas Stebila
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_SHA2_H
#define OQS_SHA2_H
#include <stddef.h>
#include <stdint.h>
#include <oqs/sha2_ops.h>
#if defined(__cplusplus)
extern "C" {
#endif
/**
* \brief Process a message with SHA-256 and return the hash code in the output byte array.
*
* \warning The output array must be at least 32 bytes in length.
*
* \param output The output byte array
* \param input The message input byte array
* \param inplen The number of message bytes to process
*/
void OQS_SHA2_sha256(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* \brief Allocate and initialize the state for the SHA-256 incremental hashing API.
*
* \warning The state must be released by OQS_SHA2_sha256_inc_finalize
* or OQS_SHA2_sha256_inc_ctx_release.
*
* \param state Pointer to the state
*/
void OQS_SHA2_sha256_inc_init(OQS_SHA2_sha256_ctx *state);
/**
* \brief Duplicate state for the SHA-256 incremental hashing API.
*
* \warning dest must be allocated by the caller. Caller is responsible
* for releasing dest by calling either OQS_SHA2_sha256_inc_finalize or
* OQS_SHA2_sha256_inc_ctx_release.
*
* \param dest The function state to copy into; must be initialized
* \param src The function state to copy; must be initialized
*/
void OQS_SHA2_sha256_inc_ctx_clone(OQS_SHA2_sha256_ctx *dest, const OQS_SHA2_sha256_ctx *src);
/**
* \brief Process blocks with SHA-256 and update the state.
*
* \warning The state must be initialized by OQS_SHA2_sha256_inc_init or OQS_SHA2_sha256_inc_ctx_clone.
*
* \param state The state to update
* \param in Message input byte array
* \param inblocks The number of 64-byte blocks of message bytes to process
*/
void OQS_SHA2_sha256_inc_blocks(OQS_SHA2_sha256_ctx *state, const uint8_t *in, size_t inblocks);
/**
* \brief Process message bytes with SHA-256 and update the state.
*
* \warning The state must be initialized by OQS_SHA2_sha256_inc_init or OQS_SHA2_sha256_inc_ctx_clone.
*
* \param state The state to update
* \param in Message input byte array
* \param len The number of bytes of message to process
*/
void OQS_SHA2_sha256_inc(OQS_SHA2_sha256_ctx *state, const uint8_t *in, size_t len);
/**
* \brief Process more message bytes with SHA-256 and return the hash code in the output byte array.
*
* \warning The output array must be at least 32 bytes in length. The state is
* deallocated by this function and can not be used again after calling
* this function without calling OQS_SHA2_sha256_inc_init again.
*
* \param out The output byte array
* \param state The state
* \param in Additional message input byte array
* \param inlen The number of additional message bytes to process
*/
void OQS_SHA2_sha256_inc_finalize(uint8_t *out, OQS_SHA2_sha256_ctx *state, const uint8_t *in, size_t inlen);
/**
* \brief Destroy state.
*
* \warning The state is deallocated by this function and can not be used again after calling
* this function without calling OQS_SHA2_sha256_inc_init again.
*
* \param state The state
*/
void OQS_SHA2_sha256_inc_ctx_release(OQS_SHA2_sha256_ctx *state);
/**
* \brief Process a message with SHA-384 and return the hash code in the output byte array.
*
* \warning The output array must be at least 48 bytes in length.
*
* \param output The output byte array
* \param input The message input byte array
* \param inplen The number of message bytes to process
*/
void OQS_SHA2_sha384(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* \brief Allocate and initialize the state for the SHA-384 incremental hashing API.
*
* \warning The state must be released by OQS_SHA2_sha384_inc_finalize
* or OQS_SHA2_sha384_inc_ctx_release.
*
* \param state Pointer to the state
*/
void OQS_SHA2_sha384_inc_init(OQS_SHA2_sha384_ctx *state);
/**
* \brief Duplicate state for the SHA-384 incremental hashing API.
*
* \warning dest must be allocated by the caller. Caller is responsible
* for releasing dest by calling either OQS_SHA2_sha384_inc_finalize or
* OQS_SHA2_sha384_inc_ctx_release.
*
* \param dest The function state to copy into; must be initialized
* \param src The function state to copy; must be initialized
*/
void OQS_SHA2_sha384_inc_ctx_clone(OQS_SHA2_sha384_ctx *dest, const OQS_SHA2_sha384_ctx *src);
/**
* \brief Process blocks with SHA-384 and update the state.
*
* \warning The state must be initialized by OQS_SHA2_sha384_inc_init or OQS_SHA2_sha384_inc_ctx_clone.
*
* \param state The state to update
* \param in Message input byte array
* \param inblocks The number of 128-byte blocks of message bytes to process
*/
void OQS_SHA2_sha384_inc_blocks(OQS_SHA2_sha384_ctx *state, const uint8_t *in, size_t inblocks);
/**
* \brief Process more message bytes with SHA-384 and return the hash code in the output byte array.
*
* \warning The output array must be at least 48 bytes in length. The state is
* deallocated by this function and can not be used again after calling
* this function without calling OQS_SHA2_sha384_inc_init again.
*
* \param out The output byte array
* \param state The state
* \param in Additional message input byte array
* \param inlen The number of additional message bytes to process
*/
void OQS_SHA2_sha384_inc_finalize(uint8_t *out, OQS_SHA2_sha384_ctx *state, const uint8_t *in, size_t inlen);
/**
* \brief Destroy state.
*
* \warning The state is deallocated by this function and can not be used again after calling
* this function without calling OQS_SHA2_sha384_inc_init again.
*
* \param state The state
*/
void OQS_SHA2_sha384_inc_ctx_release(OQS_SHA2_sha384_ctx *state);
/**
* \brief Process a message with SHA-512 and return the hash code in the output byte array.
*
* \warning The output array must be at least 64 bytes in length.
*
* \param output The output byte array
* \param input The message input byte array
* \param inplen The number of message bytes to process
*/
void OQS_SHA2_sha512(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* \brief Allocate and initialize the state for the SHA-512 incremental hashing API.
*
* \warning The state must be released by OQS_SHA2_sha512_inc_finalize
* or OQS_SHA2_sha512_inc_ctx_release.
*
* \param state Pointer to the state
*/
void OQS_SHA2_sha512_inc_init(OQS_SHA2_sha512_ctx *state);
/**
* \brief Duplicate state for the SHA-512 incremental hashing API.
*
* \warning dest must be allocated by the caller. Caller is responsible
* for releasing dest by calling either OQS_SHA2_sha512_inc_finalize or
* OQS_SHA2_sha512_inc_ctx_release.
*
* \param dest The function state to copy into; must be initialized
* \param src The function state to copy; must be initialized
*/
void OQS_SHA2_sha512_inc_ctx_clone(OQS_SHA2_sha512_ctx *dest, const OQS_SHA2_sha512_ctx *src);
/**
* \brief Process blocks with SHA-512 and update the state.
*
* \warning The state must be initialized by OQS_SHA2_sha512_inc_init or OQS_SHA2_sha512_inc_ctx_clone.
*
* \param state The state to update
* \param in Message input byte array
* \param inblocks The number of 128-byte blocks of message bytes to process
*/
void OQS_SHA2_sha512_inc_blocks(OQS_SHA2_sha512_ctx *state, const uint8_t *in, size_t inblocks);
/**
* \brief Process more message bytes with SHA-512 and return the hash code in the output byte array.
*
* \warning The output array must be at least 64 bytes in length. The state is
* deallocated by this function and can not be used again after calling
* this function without calling OQS_SHA2_sha512_inc_init again.
*
* \param out The output byte array
* \param state The state
* \param in Additional message input byte array
* \param inlen The number of additional message bytes to process
*/
void OQS_SHA2_sha512_inc_finalize(uint8_t *out, OQS_SHA2_sha512_ctx *state, const uint8_t *in, size_t inlen);
/**
* \brief Destroy state.
*
* \warning The state is deallocated by this function and can not be used again after calling
* this function without calling OQS_SHA2_sha512_inc_init again.
*
* \param state The state
*/
void OQS_SHA2_sha512_inc_ctx_release(OQS_SHA2_sha512_ctx *state);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_SHA2_H
@@ -0,0 +1,176 @@
/**
* \file sha2_ops.h
* \brief Header defining the callback API for OQS SHA2
*
* \author Douglas Stebila
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_SHA2_OPS_H
#define OQS_SHA2_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 SHA-224 incremental hashing API. */
typedef struct {
/** Internal state */
void *ctx;
/** current number of bytes in data */
size_t data_len;
/** unprocessed data buffer */
uint8_t data[128];
} OQS_SHA2_sha224_ctx;
/** Data structure for the state of the SHA-256 incremental hashing API. */
typedef struct {
/** Internal state */
void *ctx;
/** current number of bytes in data */
size_t data_len;
/** unprocessed data buffer */
uint8_t data[128];
} OQS_SHA2_sha256_ctx;
/** Data structure for the state of the SHA-384 incremental hashing API. */
typedef struct {
/** Internal state. */
void *ctx;
/** current number of bytes in data */
size_t data_len;
/** unprocessed data buffer */
uint8_t data[128];
} OQS_SHA2_sha384_ctx;
/** Data structure for the state of the SHA-512 incremental hashing API. */
typedef struct {
/** Internal state. */
void *ctx;
/** current number of bytes in data */
size_t data_len;
/** unprocessed data buffer */
uint8_t data[128];
} OQS_SHA2_sha512_ctx;
/** Data structure implemented by cryptographic provider for SHA-2 operations.
*/
struct OQS_SHA2_callbacks {
/**
* Implementation of function OQS_SHA2_sha256.
*/
void (*SHA2_sha256)(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* Implementation of function OQS_SHA2_sha256_inc_init.
*/
void (*SHA2_sha256_inc_init)(OQS_SHA2_sha256_ctx *state);
/**
* Implementation of function OQS_SHA2_sha256_inc_ctx_clone.
*/
void (*SHA2_sha256_inc_ctx_clone)(OQS_SHA2_sha256_ctx *dest, const OQS_SHA2_sha256_ctx *src);
/**
* Implementation of function OQS_SHA2_sha256_inc.
*/
void (*SHA2_sha256_inc)(OQS_SHA2_sha256_ctx *state, const uint8_t *in, size_t len);
/**
* Implementation of function OQS_SHA2_sha256_inc_blocks.
*/
void (*SHA2_sha256_inc_blocks)(OQS_SHA2_sha256_ctx *state, const uint8_t *in, size_t inblocks);
/**
* Implementation of function OQS_SHA2_sha256_inc_finalize.
*/
void (*SHA2_sha256_inc_finalize)(uint8_t *out, OQS_SHA2_sha256_ctx *state, const uint8_t *in, size_t inlen);
/**
* Implementation of function OQS_SHA2_sha256_inc_ctx_release.
*/
void (*SHA2_sha256_inc_ctx_release)(OQS_SHA2_sha256_ctx *state);
/**
* Implementation of function OQS_SHA2_sha384.
*/
void (*SHA2_sha384)(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* Implementation of function OQS_SHA2_sha384_inc_init.
*/
void (*SHA2_sha384_inc_init)(OQS_SHA2_sha384_ctx *state);
/**
* Implementation of function OQS_SHA2_sha384_inc_ctx_clone.
*/
void (*SHA2_sha384_inc_ctx_clone)(OQS_SHA2_sha384_ctx *dest, const OQS_SHA2_sha384_ctx *src);
/**
* Implementation of function OQS_SHA2_sha384_inc_blocks.
*/
void (*SHA2_sha384_inc_blocks)(OQS_SHA2_sha384_ctx *state, const uint8_t *in, size_t inblocks);
/**
* Implementation of function OQS_SHA2_sha384_inc_finalize.
*/
void (*SHA2_sha384_inc_finalize)(uint8_t *out, OQS_SHA2_sha384_ctx *state, const uint8_t *in, size_t inlen);
/**
* Implementation of function OQS_SHA2_sha384_inc_ctx_release.
*/
void (*SHA2_sha384_inc_ctx_release)(OQS_SHA2_sha384_ctx *state);
/**
* Implementation of function OQS_SHA2_sha512.
*/
void (*SHA2_sha512)(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* Implementation of function OQS_SHA2_sha512_inc_init.
*/
void (*SHA2_sha512_inc_init)(OQS_SHA2_sha512_ctx *state);
/**
* Implementation of function OQS_SHA2_sha512_inc_ctx_clone.
*/
void (*SHA2_sha512_inc_ctx_clone)(OQS_SHA2_sha512_ctx *dest, const OQS_SHA2_sha512_ctx *src);
/**
* Implementation of function OQS_SHA2_sha512_inc_blocks.
*/
void (*SHA2_sha512_inc_blocks)(OQS_SHA2_sha512_ctx *state, const uint8_t *in, size_t inblocks);
/**
* Implementation of function OQS_SHA2_sha512_inc_finalize.
*/
void (*SHA2_sha512_inc_finalize)(uint8_t *out, OQS_SHA2_sha512_ctx *state, const uint8_t *in, size_t inlen);
/**
* Implementation of function OQS_SHA2_sha512_inc_ctx_release.
*/
void (*SHA2_sha512_inc_ctx_release)(OQS_SHA2_sha512_ctx *state);
};
/**
* Set callback functions for SHA2 operations.
*
* This function may be called before OQS_init to switch the
* cryptographic provider for SHA2 operations. If it is not called,
* the default provider determined at build time will be used.
*
* @param[in] new_callbacks Callback functions defined in OQS_SHA2_callbacks
*/
OQS_API void OQS_SHA2_set_callbacks(struct OQS_SHA2_callbacks *new_callbacks);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_SHA2_OPS_H
@@ -0,0 +1,400 @@
/**
* \file sha3.h
* \brief SHA3 and SHAKE functions; not part of the OQS public API
*
* Contains the API and documentation for SHA3 digest and SHAKE implementations.
*
* <b>Note this is not part of the OQS public API: implementations within liboqs can use these
* functions, but external consumers of liboqs should not use these functions.</b>
*
* \author John Underhill, Douglas Stebila
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_SHA3_H
#define OQS_SHA3_H
#include <stddef.h>
#include <stdint.h>
#include <oqs/sha3_ops.h>
#if defined(__cplusplus)
extern "C" {
#endif
/* SHA3 */
/** The SHA-256 byte absorption rate */
#define OQS_SHA3_SHA3_256_RATE 136
/**
* \brief Process a message with SHA3-256 and return the digest in the output byte array.
*
* \warning The output array must be at least 32 bytes in length.
*
* \param output The output byte array
* \param input The message input byte array
* \param inplen The number of message bytes to process
*/
void OQS_SHA3_sha3_256(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* \brief Initialize the state for the incremental SHA3-256 API.
*
* \warning Caller is responsible for releasing state by calling
* OQS_SHA3_sha3_256_inc_ctx_release.
*
* \param state The function state to be allocated and initialized.
*/
void OQS_SHA3_sha3_256_inc_init(OQS_SHA3_sha3_256_inc_ctx *state);
/**
* \brief The SHA3-256 absorb function.
* Absorb an input into the state.
*
* \param state The function state; must be initialized
* \param input The input array
* \param inlen The length of the input
*/
void OQS_SHA3_sha3_256_inc_absorb(OQS_SHA3_sha3_256_inc_ctx *state, const uint8_t *input, size_t inlen);
/**
* \brief The SHA3-256 finalize-and-squeeze function.
* Finalizes the state and squeezes a 32 byte digest.
*
* \warning Output array must be at least 32 bytes.
* State cannot be used after this without calling OQS_SHA3_sha3_256_inc_reset.
*
* \param output The output byte array
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_256_inc_finalize(uint8_t *output, OQS_SHA3_sha3_256_inc_ctx *state);
/**
* \brief Release the state for the SHA3-256 incremental API.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_256_inc_ctx_release(OQS_SHA3_sha3_256_inc_ctx *state);
/**
* \brief Resets the state for the SHA3-256 incremental API.
* Alternative to freeing and reinitializing the state.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_256_inc_ctx_reset(OQS_SHA3_sha3_256_inc_ctx *state);
/**
* \brief Clone the state for the SHA3-256 incremental API.
*
* \param dest The function state to copy into; must be initialized
* \param src The function state to copy; must be initialized
*/
void OQS_SHA3_sha3_256_inc_ctx_clone(OQS_SHA3_sha3_256_inc_ctx *dest, const OQS_SHA3_sha3_256_inc_ctx *src);
/** The SHA-384 byte absorption rate */
#define OQS_SHA3_SHA3_384_RATE 104
/**
* \brief Process a message with SHA3-384 and return the digest in the output byte array.
*
* \warning The output array must be at least 48 bytes in length.
*
* \param output The output byte array
* \param input The message input byte array
* \param inplen The number of message bytes to process
*/
void OQS_SHA3_sha3_384(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* \brief Initialize the state for the incremental SHA3-384 API.
*
* \warning Caller is responsible for releasing state by calling
* OQS_SHA3_sha3_384_inc_ctx_release.
*
* \param state The function state to be allocated and initialized.
*/
void OQS_SHA3_sha3_384_inc_init(OQS_SHA3_sha3_384_inc_ctx *state);
/**
* \brief The SHA3-384 absorb function.
* Absorb an input into the state.
*
* \param state The function state; must be initialized
* \param input The input array
* \param inlen The length of the input
*/
void OQS_SHA3_sha3_384_inc_absorb(OQS_SHA3_sha3_384_inc_ctx *state, const uint8_t *input, size_t inlen);
/**
* \brief The SHA3-384 finalize-and-squeeze function.
* Finalizes the state and squeezes a 48 byte digest.
*
* \warning Output array must be at least 48 bytes.
* State cannot be used after this without calling OQS_SHA3_sha3_384_inc_reset.
*
* \param output The output byte array
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_384_inc_finalize(uint8_t *output, OQS_SHA3_sha3_384_inc_ctx *state);
/**
* \brief Release the state for the SHA3-384 incremental API.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_384_inc_ctx_release(OQS_SHA3_sha3_384_inc_ctx *state);
/**
* \brief Resets the state for the SHA3-384 incremental API.
* Alternative to freeing and reinitializing the state.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_384_inc_ctx_reset(OQS_SHA3_sha3_384_inc_ctx *state);
/**
* \brief Clone the state for the SHA3-384 incremental API.
*
* \param dest The function state to copy into; must be initialized
* \param src The function state to copy; must be initialized
*/
void OQS_SHA3_sha3_384_inc_ctx_clone(OQS_SHA3_sha3_384_inc_ctx *dest, const OQS_SHA3_sha3_384_inc_ctx *src);
/** The SHA-512 byte absorption rate */
#define OQS_SHA3_SHA3_512_RATE 72
/**
* \brief Process a message with SHA3-512 and return the digest in the output byte array.
*
* \warning The output array must be at least 64 bytes in length.
*
* \param output The output byte array
* \param input The message input byte array
* \param inplen The number of message bytes to process
*/
void OQS_SHA3_sha3_512(uint8_t *output, const uint8_t *input, size_t inplen);
/**
* \brief Initialize the state for the incremental SHA3-512 API.
*
* \warning Caller is responsible for releasing state by calling
* OQS_SHA3_sha3_512_inc_ctx_release.
*
* \param state The function state to be allocated and initialized.
*/
void OQS_SHA3_sha3_512_inc_init(OQS_SHA3_sha3_512_inc_ctx *state);
/**
* \brief The SHA3-512 absorb function.
* Absorb an input into the state.
*
* \param state The function state; must be initialized
* \param input The input array
* \param inlen The length of the input
*/
void OQS_SHA3_sha3_512_inc_absorb(OQS_SHA3_sha3_512_inc_ctx *state, const uint8_t *input, size_t inlen);
/**
* \brief The SHA3-512 finalize-and-squeeze function.
* Finalizes the state and squeezes a 64 byte digest.
*
* \warning Output array must be at least 64 bytes.
* State cannot be used after this without calling OQS_SHA3_sha3_512_inc_reset.
*
* \param output The output byte array
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_512_inc_finalize(uint8_t *output, OQS_SHA3_sha3_512_inc_ctx *state);
/**
* \brief Release the state for the SHA3-512 incremental API.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_512_inc_ctx_release(OQS_SHA3_sha3_512_inc_ctx *state);
/**
* \brief Resets the state for the SHA3-512 incremental API.
* Alternative to freeing and reinitializing the state.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_sha3_512_inc_ctx_reset(OQS_SHA3_sha3_512_inc_ctx *state);
/**
* \brief Clone the state for the SHA3-512 incremental API.
*
* \param dest The function state to copy into; must be initialized
* \param src The function state to copy; must be initialized
*/
void OQS_SHA3_sha3_512_inc_ctx_clone(OQS_SHA3_sha3_512_inc_ctx *dest, const OQS_SHA3_sha3_512_inc_ctx *src);
/* SHAKE */
/** The SHAKE-128 byte absorption rate */
#define OQS_SHA3_SHAKE128_RATE 168
/**
* \brief Seed a SHAKE-128 instance, and generate an array of pseudo-random bytes.
*
* \warning The output array length must not be zero.
*
* \param output The output byte array
* \param outlen The number of output bytes to generate
* \param input The input seed byte array
* \param inplen The number of seed bytes to process
*/
void OQS_SHA3_shake128(uint8_t *output, size_t outlen, const uint8_t *input, size_t inplen);
/**
* \brief Initialize the state for the incremental SHAKE-128 API.
*
* \warning Caller is responsible for releasing state by calling
* OQS_SHA3_shake128_inc_ctx_release.
*
* \param state The function state to be initialized; must be allocated
*/
void OQS_SHA3_shake128_inc_init(OQS_SHA3_shake128_inc_ctx *state);
/**
* \brief The SHAKE-128 absorb function.
* Absorb an input into the state.
*
* \warning State must be initialized.
*
* \param state The function state; must be initialized
* \param input input buffer
* \param inlen length of input buffer
*/
void OQS_SHA3_shake128_inc_absorb(OQS_SHA3_shake128_inc_ctx *state, const uint8_t *input, size_t inlen);
/**
* \brief The SHAKE-128 finalize function.
* Prepares the state for squeezing.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake128_inc_finalize(OQS_SHA3_shake128_inc_ctx *state);
/**
* \brief The SHAKE-128 squeeze function.
* Extracts to an output byte array.
*
* \param output output buffer
* \param outlen bytes of outbut buffer
* \param state The function state; must be initialized and finalized
*/
void OQS_SHA3_shake128_inc_squeeze(uint8_t *output, size_t outlen, OQS_SHA3_shake128_inc_ctx *state);
/**
* \brief Frees the state for the incremental SHAKE-128 API.
*
* \param state The state to free
*/
void OQS_SHA3_shake128_inc_ctx_release(OQS_SHA3_shake128_inc_ctx *state);
/**
* \brief Copies the state for the SHAKE-128 incremental API.
*
* \warning Caller is responsible for releasing dest by calling
* OQS_SHA3_shake128_inc_ctx_release.
*
* \param dest The function state to copy into; must be initialized
* \param src The function state to copy; must be initialized
*/
void OQS_SHA3_shake128_inc_ctx_clone(OQS_SHA3_shake128_inc_ctx *dest, const OQS_SHA3_shake128_inc_ctx *src);
/**
* \brief Resets the state for the SHAKE-128 incremental API. Allows a context
* to be re-used without free and init calls.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake128_inc_ctx_reset(OQS_SHA3_shake128_inc_ctx *state);
/** The SHAKE-256 byte absorption rate */
#define OQS_SHA3_SHAKE256_RATE 136
/**
* \brief Seed a SHAKE-256 instance, and generate an array of pseudo-random bytes.
*
* \warning The output array length must not be zero.
*
* \param output The output byte array
* \param outlen The number of output bytes to generate
* \param input The input seed byte array
* \param inplen The number of seed bytes to process
*/
void OQS_SHA3_shake256(uint8_t *output, size_t outlen, const uint8_t *input, size_t inplen);
/**
* \brief Initialize the state for the incremental SHAKE-256 API.
*
* \param state The function state to be initialized; must be allocated
*/
void OQS_SHA3_shake256_inc_init(OQS_SHA3_shake256_inc_ctx *state);
/**
* \brief The SHAKE-256 absorb function.
* Absorb an input message array directly into the state.
*
* \warning State must be initialized by the caller.
*
* \param state The function state; must be initialized
* \param input input buffer
* \param inlen length of input buffer
*/
void OQS_SHA3_shake256_inc_absorb(OQS_SHA3_shake256_inc_ctx *state, const uint8_t *input, size_t inlen);
/**
* \brief The SHAKE-256 finalize function.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake256_inc_finalize(OQS_SHA3_shake256_inc_ctx *state);
/**
* \brief The SHAKE-256 squeeze function.
* Extracts to an output byte array.
*
* \param output output buffer
* \param outlen bytes of outbut buffer
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake256_inc_squeeze(uint8_t *output, size_t outlen, OQS_SHA3_shake256_inc_ctx *state);
/**
* \brief Frees the state for the incremental SHAKE-256 API.
*
* \param state The state to free
*/
void OQS_SHA3_shake256_inc_ctx_release(OQS_SHA3_shake256_inc_ctx *state);
/**
* \brief Copies the state for the incremental SHAKE-256 API.
*
* \warning dest must be allocated. dest must be freed by calling
* OQS_SHA3_shake256_inc_ctx_release.
*
* \param dest The state to copy into; must be initialized
* \param src The state to copy from; must be initialized
*/
void OQS_SHA3_shake256_inc_ctx_clone(OQS_SHA3_shake256_inc_ctx *dest, const OQS_SHA3_shake256_inc_ctx *src);
/**
* \brief Resets the state for the SHAKE-256 incremental API. Allows a context
* to be re-used without free and init calls.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake256_inc_ctx_reset(OQS_SHA3_shake256_inc_ctx *state);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_SHA3_H
@@ -0,0 +1,256 @@
/**
* \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
@@ -0,0 +1,252 @@
/**
* \file sha3x4.h
* \brief SHA3, SHAKE, and cSHAKE functions; not part of the OQS public API
*
* Contains the API and documentation for SHA3 digest and SHAKE implementations.
*
* <b>Note this is not part of the OQS public API: implementations within liboqs can use these
* functions, but external consumers of liboqs should not use these functions.</b>
*
* \author John Underhill, Douglas Stebila
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_SHA3X4_H
#define OQS_SHA3X4_H
#include <stddef.h>
#include <stdint.h>
#include <oqs/sha3x4_ops.h>
#if defined(__cplusplus)
extern "C" {
#endif
/**
* \brief Seed 4 parallel SHAKE-128 instances, and generate 4 arrays of pseudo-random bytes.
*
* \warning The output array length must not be zero.
*
* \param out0 The first output byte array
* \param out1 The second output byte array
* \param out2 The third output byte array
* \param out3 The fourth output byte array
* \param outlen The number of output bytes to generate in every output array
* \param in0 The first input seed byte array
* \param in1 The second input seed byte array
* \param in2 The third input seed byte array
* \param in3 The fourth input seed byte array
* \param inlen The number of seed bytes to process from every input array
*/
void OQS_SHA3_shake128_x4(
uint8_t *out0,
uint8_t *out1,
uint8_t *out2,
uint8_t *out3,
size_t outlen,
const uint8_t *in0,
const uint8_t *in1,
const uint8_t *in2,
const uint8_t *in3,
size_t inlen);
/**
* \brief Initialize the state for four-way parallel incremental SHAKE-128 API.
*
* \param state The function state to be initialized; must be allocated
*/
void OQS_SHA3_shake128_x4_inc_init(OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* \brief Four-way parallel SHAKE-128 absorb function.
* Absorb four input messages of the same length into four parallel states.
*
* \warning State must be initialized by the caller.
*
* \param state The function state; must be initialized
* \param in0 The input to be absorbed into first instance
* \param in1 The input to be absorbed into first instance
* \param in2 The input to be absorbed into first instance
* \param in3 The input to be absorbed into first instance
* \param inlen The number of bytes to process from each input array
*/
void OQS_SHA3_shake128_x4_inc_absorb(
OQS_SHA3_shake128_x4_inc_ctx *state,
const uint8_t *in0,
const uint8_t *in1,
const uint8_t *in2,
const uint8_t *in3,
size_t inlen);
/**
* \brief Four-way parallel SHAKE-128 finalize function.
* Prepares the states for squeezing.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake128_x4_inc_finalize(OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* \brief Four-way parallel SHAKE-128 squeeze function.
* Extracts from four parallel states into four output buffers
*
* \param out0 output buffer for the first instance
* \param out1 output buffer for the second instance
* \param out2 output buffer for the third instance
* \param out3 output buffer for the fourth instance
* \param outlen bytes of outbut buffer
* \param state The function state; must be initialized and finalized.
*/
void OQS_SHA3_shake128_x4_inc_squeeze(
uint8_t *out0,
uint8_t *out1,
uint8_t *out2,
uint8_t *out3,
size_t outlen,
OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* \brief Frees the state for the four-way parallel incremental SHAKE-128 API.
*
* \param state The state to free
*/
void OQS_SHA3_shake128_x4_inc_ctx_release(OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* \brief Copies the state for the four-way parallel incremental SHAKE-128 API.
*
* \param dest The state to copy into; must be initialized
* \param src The state to copy from; must be initialized
*/
void OQS_SHA3_shake128_x4_inc_ctx_clone(
OQS_SHA3_shake128_x4_inc_ctx *dest,
const OQS_SHA3_shake128_x4_inc_ctx *src);
/**
* \brief Resets the state for the four-way parallel incremental SHAKE-128 API.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake128_x4_inc_ctx_reset(OQS_SHA3_shake128_x4_inc_ctx *state);
/* SHAKE256 */
/**
* \brief Seed 4 parallel SHAKE-256 instances, and generate 4 arrays of pseudo-random bytes.
*
* Uses a vectorized (AVX2) implementation of SHAKE-256 if available.
*
* \warning The output array length must not be zero.
*
* \param out0 The first output byte array
* \param out1 The second output byte array
* \param out2 The third output byte array
* \param out3 The fourth output byte array
* \param outlen The number of output bytes to generate in every output array
* \param in0 The first input seed byte array
* \param in1 The second input seed byte array
* \param in2 The third input seed byte array
* \param in3 The fourth input seed byte array
* \param inlen The number of seed bytes to process from every input array
*/
void OQS_SHA3_shake256_x4(
uint8_t *out0,
uint8_t *out1,
uint8_t *out2,
uint8_t *out3,
size_t outlen,
const uint8_t *in0,
const uint8_t *in1,
const uint8_t *in2,
const uint8_t *in3,
size_t inlen);
/**
* \brief Initialize the state for four-way parallel incremental SHAKE-256 API.
*
* \param state The function state to be initialized; must be allocated
*/
void OQS_SHA3_shake256_x4_inc_init(OQS_SHA3_shake256_x4_inc_ctx *state);
/**
* \brief Four-way parallel SHAKE-256 absorb function.
* Absorb four input messages of the same length into four parallel states.
*
* \warning State must be initialized by the caller.
*
* \param state The function state; must be initialized
* \param in0 The input to be absorbed into first instance
* \param in1 The input to be absorbed into first instance
* \param in2 The input to be absorbed into first instance
* \param in3 The input to be absorbed into first instance
* \param inlen The number of bytes to process from each input array
*/
void OQS_SHA3_shake256_x4_inc_absorb(
OQS_SHA3_shake256_x4_inc_ctx *state,
const uint8_t *in0,
const uint8_t *in1,
const uint8_t *in2,
const uint8_t *in3,
size_t inlen);
/**
* \brief Four-way parallel SHAKE-256 finalize function.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake256_x4_inc_finalize(OQS_SHA3_shake256_x4_inc_ctx *state);
/**
* \brief Four-way parallel SHAKE-256 squeeze function.
* Extracts from four parallel states into four output buffers
*
* \param out0 output buffer for the first instance
* \param out1 output buffer for the second instance
* \param out2 output buffer for the third instance
* \param out3 output buffer for the fourth instance
* \param outlen bytes of outbut buffer
* \param state The function state; must be initialized and finalized
*/
void OQS_SHA3_shake256_x4_inc_squeeze(
uint8_t *out0,
uint8_t *out1,
uint8_t *out2,
uint8_t *out3,
size_t outlen,
OQS_SHA3_shake256_x4_inc_ctx *state);
/**
* \brief Frees the state for the four-way parallel incremental SHAKE-256 API.
*
* \param state The state to free
*/
void OQS_SHA3_shake256_x4_inc_ctx_release(OQS_SHA3_shake256_x4_inc_ctx *state);
/**
* \brief Copies the state for the four-way parallel incremental SHAKE-256 API.
*
* \warning dest must be allocated. dest must be freed by calling
* OQS_SHA3_shake256_inc_ctx_release.
*
* \param dest The state to copy into; must be initialized
* \param src The state to copy from; must be initialized
*/
void OQS_SHA3_shake256_x4_inc_ctx_clone(
OQS_SHA3_shake256_x4_inc_ctx *dest,
const OQS_SHA3_shake256_x4_inc_ctx *src);
/**
* \brief Resets the state for the four-way parallel incremental SHAKE-256 API.
* Allows a context to be re-used without free and init calls.
*
* \param state The function state; must be initialized
*/
void OQS_SHA3_shake256_x4_inc_ctx_reset(OQS_SHA3_shake256_x4_inc_ctx *state);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_SHA3X4_H
@@ -0,0 +1,182 @@
/**
* \file sha3x4_ops.h
* \brief Header defining the callback API for OQS SHA3 and SHAKE
*
* \author John Underhill, Douglas Stebila
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_SHA3X4_OPS_H
#define OQS_SHA3X4_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 four-way parallel incremental SHAKE-128 API. */
typedef struct {
/** Internal state. */
void *ctx;
} OQS_SHA3_shake128_x4_inc_ctx;
/** Data structure for the state of the four-way parallel incremental SHAKE-256 API. */
typedef struct {
/** Internal state. */
void *ctx;
} OQS_SHA3_shake256_x4_inc_ctx;
/** Data structure implemented by cryptographic provider for the
* four-way parallel incremental SHAKE-256 operations.
*/
struct OQS_SHA3_x4_callbacks {
/**
* Implementation of function OQS_SHA3_shake128_x4.
*/
void (*SHA3_shake128_x4)(
uint8_t *out0,
uint8_t *out1,
uint8_t *out2,
uint8_t *out3,
size_t outlen,
const uint8_t *in0,
const uint8_t *in1,
const uint8_t *in2,
const uint8_t *in3,
size_t inlen);
/**
* Implementation of function OQS_SHA3_shake128_x4_inc_init.
*/
void (*SHA3_shake128_x4_inc_init)(OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake128_x4_inc_absorb.
*/
void (*SHA3_shake128_x4_inc_absorb)(
OQS_SHA3_shake128_x4_inc_ctx *state,
const uint8_t *in0,
const uint8_t *in1,
const uint8_t *in2,
const uint8_t *in3,
size_t inlen);
/**
* Implementation of function OQS_SHA3_shake128_x4_inc_finalize.
*/
void (*SHA3_shake128_x4_inc_finalize)(OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake128_x4_inc_squeeze.
*/
void (*SHA3_shake128_x4_inc_squeeze)(
uint8_t *out0,
uint8_t *out1,
uint8_t *out2,
uint8_t *out3,
size_t outlen,
OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake128_x4_inc_ctx_release.
*/
void (*SHA3_shake128_x4_inc_ctx_release)(OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake128_x4_inc_ctx_clone.
*/
void (*SHA3_shake128_x4_inc_ctx_clone)(
OQS_SHA3_shake128_x4_inc_ctx *dest,
const OQS_SHA3_shake128_x4_inc_ctx *src);
/**
* Implementation of function OQS_SHA3_shake128_x4_inc_ctx_reset.
*/
void (*SHA3_shake128_x4_inc_ctx_reset)(OQS_SHA3_shake128_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake256_x4.
*/
void (*SHA3_shake256_x4)(
uint8_t *out0,
uint8_t *out1,
uint8_t *out2,
uint8_t *out3,
size_t outlen,
const uint8_t *in0,
const uint8_t *in1,
const uint8_t *in2,
const uint8_t *in3,
size_t inlen);
/**
* Implementation of function OQS_SHA3_shake256_x4_inc_init.
*/
void (*SHA3_shake256_x4_inc_init)(OQS_SHA3_shake256_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake256_x4_inc_absorb.
*/
void (*SHA3_shake256_x4_inc_absorb)(
OQS_SHA3_shake256_x4_inc_ctx *state,
const uint8_t *in0,
const uint8_t *in1,
const uint8_t *in2,
const uint8_t *in3,
size_t inlen);
/**
* Implementation of function OQS_SHA3_shake256_x4_inc_finalize.
*/
void (*SHA3_shake256_x4_inc_finalize)(OQS_SHA3_shake256_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake256_x4_inc_squeeze.
*/
void (*SHA3_shake256_x4_inc_squeeze)(
uint8_t *out0,
uint8_t *out1,
uint8_t *out2,
uint8_t *out3,
size_t outlen,
OQS_SHA3_shake256_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake256_x4_inc_ctx_release.
*/
void (*SHA3_shake256_x4_inc_ctx_release)(OQS_SHA3_shake256_x4_inc_ctx *state);
/**
* Implementation of function OQS_SHA3_shake256_x4_inc_ctx_clone.
*/
void (*SHA3_shake256_x4_inc_ctx_clone)(
OQS_SHA3_shake256_x4_inc_ctx *dest,
const OQS_SHA3_shake256_x4_inc_ctx *src);
/**
* Implementation of function OQS_SHA3_shake256_x4_inc_ctx_reset.
*/
void (*SHA3_shake256_x4_inc_ctx_reset)(OQS_SHA3_shake256_x4_inc_ctx *state);
};
/**
* Set callback functions for 4-parallel SHA3 operations.
*
* This function may be called before OQS_init to switch the
* cryptographic provider for 4-parallel 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_x4_callbacks struct
*/
OQS_API void OQS_SHA3_x4_set_callbacks(struct OQS_SHA3_x4_callbacks *new_callbacks);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_SHA3X4_OPS_H
@@ -0,0 +1,455 @@
/**
* \file sig.h
* \brief Signature schemes
*
* The file `tests/example_sig.c` contains two examples on using the OQS_SIG API.
*
* The first example uses the individual scheme's algorithms directly and uses
* no dynamic memory allocation -- all buffers are allocated on the stack, with
* sizes indicated using preprocessor macros. Since algorithms can be disabled at
* compile-time, the programmer should wrap the code in \#ifdefs.
*
* The second example uses an OQS_SIG object to use an algorithm specified at
* runtime. Therefore it uses dynamic memory allocation -- all buffers must be
* malloc'ed by the programmer, with sizes indicated using the corresponding length
* member of the OQS_SIG object in question. Since algorithms can be disabled at
* compile-time, the programmer should check that the OQS_SIG object is not `NULL`.
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_SIG_H
#define OQS_SIG_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <oqs/oqs.h>
#if defined(__cplusplus)
extern "C" {
#endif
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALG_IDENTIFIER_START
/** Algorithm identifier for Dilithium2 */
#define OQS_SIG_alg_dilithium_2 "Dilithium2"
/** Algorithm identifier for Dilithium3 */
#define OQS_SIG_alg_dilithium_3 "Dilithium3"
/** Algorithm identifier for Dilithium5 */
#define OQS_SIG_alg_dilithium_5 "Dilithium5"
/** Algorithm identifier for ML-DSA-44 */
#define OQS_SIG_alg_ml_dsa_44 "ML-DSA-44"
/** Algorithm identifier for ML-DSA-65 */
#define OQS_SIG_alg_ml_dsa_65 "ML-DSA-65"
/** Algorithm identifier for ML-DSA-87 */
#define OQS_SIG_alg_ml_dsa_87 "ML-DSA-87"
/** Algorithm identifier for Falcon-512 */
#define OQS_SIG_alg_falcon_512 "Falcon-512"
/** Algorithm identifier for Falcon-1024 */
#define OQS_SIG_alg_falcon_1024 "Falcon-1024"
/** Algorithm identifier for Falcon-padded-512 */
#define OQS_SIG_alg_falcon_padded_512 "Falcon-padded-512"
/** Algorithm identifier for Falcon-padded-1024 */
#define OQS_SIG_alg_falcon_padded_1024 "Falcon-padded-1024"
/** Algorithm identifier for SPHINCS+-SHA2-128f-simple */
#define OQS_SIG_alg_sphincs_sha2_128f_simple "SPHINCS+-SHA2-128f-simple"
/** Algorithm identifier for SPHINCS+-SHA2-128s-simple */
#define OQS_SIG_alg_sphincs_sha2_128s_simple "SPHINCS+-SHA2-128s-simple"
/** Algorithm identifier for SPHINCS+-SHA2-192f-simple */
#define OQS_SIG_alg_sphincs_sha2_192f_simple "SPHINCS+-SHA2-192f-simple"
/** Algorithm identifier for SPHINCS+-SHA2-192s-simple */
#define OQS_SIG_alg_sphincs_sha2_192s_simple "SPHINCS+-SHA2-192s-simple"
/** Algorithm identifier for SPHINCS+-SHA2-256f-simple */
#define OQS_SIG_alg_sphincs_sha2_256f_simple "SPHINCS+-SHA2-256f-simple"
/** Algorithm identifier for SPHINCS+-SHA2-256s-simple */
#define OQS_SIG_alg_sphincs_sha2_256s_simple "SPHINCS+-SHA2-256s-simple"
/** Algorithm identifier for SPHINCS+-SHAKE-128f-simple */
#define OQS_SIG_alg_sphincs_shake_128f_simple "SPHINCS+-SHAKE-128f-simple"
/** Algorithm identifier for SPHINCS+-SHAKE-128s-simple */
#define OQS_SIG_alg_sphincs_shake_128s_simple "SPHINCS+-SHAKE-128s-simple"
/** Algorithm identifier for SPHINCS+-SHAKE-192f-simple */
#define OQS_SIG_alg_sphincs_shake_192f_simple "SPHINCS+-SHAKE-192f-simple"
/** Algorithm identifier for SPHINCS+-SHAKE-192s-simple */
#define OQS_SIG_alg_sphincs_shake_192s_simple "SPHINCS+-SHAKE-192s-simple"
/** Algorithm identifier for SPHINCS+-SHAKE-256f-simple */
#define OQS_SIG_alg_sphincs_shake_256f_simple "SPHINCS+-SHAKE-256f-simple"
/** Algorithm identifier for SPHINCS+-SHAKE-256s-simple */
#define OQS_SIG_alg_sphincs_shake_256s_simple "SPHINCS+-SHAKE-256s-simple"
/** Algorithm identifier for MAYO-1 */
#define OQS_SIG_alg_mayo_1 "MAYO-1"
/** Algorithm identifier for MAYO-2 */
#define OQS_SIG_alg_mayo_2 "MAYO-2"
/** Algorithm identifier for MAYO-3 */
#define OQS_SIG_alg_mayo_3 "MAYO-3"
/** Algorithm identifier for MAYO-5 */
#define OQS_SIG_alg_mayo_5 "MAYO-5"
/** Algorithm identifier for cross-rsdp-128-balanced */
#define OQS_SIG_alg_cross_rsdp_128_balanced "cross-rsdp-128-balanced"
/** Algorithm identifier for cross-rsdp-128-fast */
#define OQS_SIG_alg_cross_rsdp_128_fast "cross-rsdp-128-fast"
/** Algorithm identifier for cross-rsdp-128-small */
#define OQS_SIG_alg_cross_rsdp_128_small "cross-rsdp-128-small"
/** Algorithm identifier for cross-rsdp-192-balanced */
#define OQS_SIG_alg_cross_rsdp_192_balanced "cross-rsdp-192-balanced"
/** Algorithm identifier for cross-rsdp-192-fast */
#define OQS_SIG_alg_cross_rsdp_192_fast "cross-rsdp-192-fast"
/** Algorithm identifier for cross-rsdp-192-small */
#define OQS_SIG_alg_cross_rsdp_192_small "cross-rsdp-192-small"
/** Algorithm identifier for cross-rsdp-256-balanced */
#define OQS_SIG_alg_cross_rsdp_256_balanced "cross-rsdp-256-balanced"
/** Algorithm identifier for cross-rsdp-256-fast */
#define OQS_SIG_alg_cross_rsdp_256_fast "cross-rsdp-256-fast"
/** Algorithm identifier for cross-rsdp-256-small */
#define OQS_SIG_alg_cross_rsdp_256_small "cross-rsdp-256-small"
/** Algorithm identifier for cross-rsdpg-128-balanced */
#define OQS_SIG_alg_cross_rsdpg_128_balanced "cross-rsdpg-128-balanced"
/** Algorithm identifier for cross-rsdpg-128-fast */
#define OQS_SIG_alg_cross_rsdpg_128_fast "cross-rsdpg-128-fast"
/** Algorithm identifier for cross-rsdpg-128-small */
#define OQS_SIG_alg_cross_rsdpg_128_small "cross-rsdpg-128-small"
/** Algorithm identifier for cross-rsdpg-192-balanced */
#define OQS_SIG_alg_cross_rsdpg_192_balanced "cross-rsdpg-192-balanced"
/** Algorithm identifier for cross-rsdpg-192-fast */
#define OQS_SIG_alg_cross_rsdpg_192_fast "cross-rsdpg-192-fast"
/** Algorithm identifier for cross-rsdpg-192-small */
#define OQS_SIG_alg_cross_rsdpg_192_small "cross-rsdpg-192-small"
/** Algorithm identifier for cross-rsdpg-256-balanced */
#define OQS_SIG_alg_cross_rsdpg_256_balanced "cross-rsdpg-256-balanced"
/** Algorithm identifier for cross-rsdpg-256-fast */
#define OQS_SIG_alg_cross_rsdpg_256_fast "cross-rsdpg-256-fast"
/** Algorithm identifier for cross-rsdpg-256-small */
#define OQS_SIG_alg_cross_rsdpg_256_small "cross-rsdpg-256-small"
/** Algorithm identifier for OV-Is */
#define OQS_SIG_alg_uov_ov_Is "OV-Is"
/** Algorithm identifier for OV-Ip */
#define OQS_SIG_alg_uov_ov_Ip "OV-Ip"
/** Algorithm identifier for OV-III */
#define OQS_SIG_alg_uov_ov_III "OV-III"
/** Algorithm identifier for OV-V */
#define OQS_SIG_alg_uov_ov_V "OV-V"
/** Algorithm identifier for OV-Is-pkc */
#define OQS_SIG_alg_uov_ov_Is_pkc "OV-Is-pkc"
/** Algorithm identifier for OV-Ip-pkc */
#define OQS_SIG_alg_uov_ov_Ip_pkc "OV-Ip-pkc"
/** Algorithm identifier for OV-III-pkc */
#define OQS_SIG_alg_uov_ov_III_pkc "OV-III-pkc"
/** Algorithm identifier for OV-V-pkc */
#define OQS_SIG_alg_uov_ov_V_pkc "OV-V-pkc"
/** Algorithm identifier for OV-Is-pkc-skc */
#define OQS_SIG_alg_uov_ov_Is_pkc_skc "OV-Is-pkc-skc"
/** Algorithm identifier for OV-Ip-pkc-skc */
#define OQS_SIG_alg_uov_ov_Ip_pkc_skc "OV-Ip-pkc-skc"
/** Algorithm identifier for OV-III-pkc-skc */
#define OQS_SIG_alg_uov_ov_III_pkc_skc "OV-III-pkc-skc"
/** Algorithm identifier for OV-V-pkc-skc */
#define OQS_SIG_alg_uov_ov_V_pkc_skc "OV-V-pkc-skc"
/** Algorithm identifier for SNOVA_24_5_4 */
#define OQS_SIG_alg_snova_SNOVA_24_5_4 "SNOVA_24_5_4"
/** Algorithm identifier for SNOVA_24_5_4_SHAKE */
#define OQS_SIG_alg_snova_SNOVA_24_5_4_SHAKE "SNOVA_24_5_4_SHAKE"
/** Algorithm identifier for SNOVA_24_5_4_esk */
#define OQS_SIG_alg_snova_SNOVA_24_5_4_esk "SNOVA_24_5_4_esk"
/** Algorithm identifier for SNOVA_24_5_4_SHAKE_esk */
#define OQS_SIG_alg_snova_SNOVA_24_5_4_SHAKE_esk "SNOVA_24_5_4_SHAKE_esk"
/** Algorithm identifier for SNOVA_37_17_2 */
#define OQS_SIG_alg_snova_SNOVA_37_17_2 "SNOVA_37_17_2"
/** Algorithm identifier for SNOVA_25_8_3 */
#define OQS_SIG_alg_snova_SNOVA_25_8_3 "SNOVA_25_8_3"
/** Algorithm identifier for SNOVA_56_25_2 */
#define OQS_SIG_alg_snova_SNOVA_56_25_2 "SNOVA_56_25_2"
/** Algorithm identifier for SNOVA_49_11_3 */
#define OQS_SIG_alg_snova_SNOVA_49_11_3 "SNOVA_49_11_3"
/** Algorithm identifier for SNOVA_37_8_4 */
#define OQS_SIG_alg_snova_SNOVA_37_8_4 "SNOVA_37_8_4"
/** Algorithm identifier for SNOVA_24_5_5 */
#define OQS_SIG_alg_snova_SNOVA_24_5_5 "SNOVA_24_5_5"
/** Algorithm identifier for SNOVA_60_10_4 */
#define OQS_SIG_alg_snova_SNOVA_60_10_4 "SNOVA_60_10_4"
/** Algorithm identifier for SNOVA_29_6_5 */
#define OQS_SIG_alg_snova_SNOVA_29_6_5 "SNOVA_29_6_5"
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALG_IDENTIFIER_END
// EDIT-WHEN-ADDING-SIG
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALGS_LENGTH_START
/** Number of algorithm identifiers above. */
#define OQS_SIG_algs_length 68
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALGS_LENGTH_END
/**
* Returns identifiers for available signature schemes in liboqs. Used with OQS_SIG_new.
*
* Note that algorithm identifiers are present in this list even when the algorithm is disabled
* at compile time.
*
* @param[in] i Index of the algorithm identifier to return, 0 <= i < OQS_SIG_algs_length
* @return Algorithm identifier as a string, or NULL.
*/
OQS_API const char *OQS_SIG_alg_identifier(size_t i);
/**
* Returns the number of signature mechanisms in liboqs. They can be enumerated with
* OQS_SIG_alg_identifier.
*
* Note that some mechanisms may be disabled at compile time.
*
* @return The number of signature mechanisms.
*/
OQS_API int OQS_SIG_alg_count(void);
/**
* Indicates whether the specified algorithm was enabled at compile-time or not.
*
* @param[in] method_name Name of the desired algorithm; one of the names in `OQS_SIG_algs`.
* @return 1 if enabled, 0 if disabled or not found
*/
OQS_API int OQS_SIG_alg_is_enabled(const char *method_name);
/**
* Signature schemes object
*/
typedef struct OQS_SIG {
/** Printable string representing the name of the signature scheme. */
const char *method_name;
/**
* Printable string representing the version of the cryptographic algorithm.
*
* Implementations with the same method_name and same alg_version will be interoperable.
* See README.md for information about algorithm compatibility.
*/
const char *alg_version;
/** The NIST security level (1, 2, 3, 4, 5) claimed in this algorithm's original NIST submission. */
uint8_t claimed_nist_level;
/** Whether the signature offers EUF-CMA security (TRUE) or not (FALSE). */
bool euf_cma;
/** Whether the signature offers SUF-CMA security (TRUE) or not (FALSE). */
bool suf_cma;
/** Whether the signature supports signing with a context string (TRUE) or not (FALSE). */
bool sig_with_ctx_support;
/** The length, in bytes, of public keys for this signature scheme. */
size_t length_public_key;
/** The length, in bytes, of secret keys for this signature scheme. */
size_t length_secret_key;
/** The (maximum) length, in bytes, of signatures for this signature scheme. */
size_t length_signature;
/**
* Keypair generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `public_key` and
* `secret_key`, based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_*_length_*`.
*
* @param[out] public_key The public key represented as a byte string.
* @param[out] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*keypair)(uint8_t *public_key, uint8_t *secret_key);
/**
* Signature generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `signature`,
* based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_*_length_*`.
*
* @param[out] signature The signature on the message represented as a byte string.
* @param[out] signature_len The actual length of the signature. May be smaller than `length_signature` for some algorithms since some algorithms have variable length signatures.
* @param[in] message The message to sign represented as a byte string.
* @param[in] message_len The length of the message to sign.
* @param[in] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*sign)(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key);
/**
* Signature generation algorithm, with custom context string.
*
* Caller is responsible for allocating sufficient memory for `signature`,
* based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_*_length_*`.
*
* @param[out] signature The signature on the message represented as a byte string.
* @param[out] signature_len The actual length of the signature. May be smaller than `length_signature` for some algorithms since some algorithms have variable length signatures.
* @param[in] message The message to sign represented as a byte string.
* @param[in] message_len The length of the message to sign.
* @param[in] ctx_str The context string used for the signature. This value can be set to NULL if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used).
* @param[in] ctx_str_len The context string used for the signature. This value can be set to 0 if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used).
* @param[in] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*sign_with_ctx_str)(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *ctx_str, size_t ctx_str_len, const uint8_t *secret_key);
/**
* Signature verification algorithm.
*
* @param[in] message The message represented as a byte string.
* @param[in] message_len The length of the message.
* @param[in] signature The signature on the message represented as a byte string.
* @param[in] signature_len The length of the signature.
* @param[in] public_key The public key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*verify)(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key);
/**
* Signature verification algorithm, with custom context string.
*
* @param[in] message The message represented as a byte string.
* @param[in] message_len The length of the message.
* @param[in] signature The signature on the message represented as a byte string.
* @param[in] signature_len The length of the signature.
* @param[in] ctx_str The context string for the signature. This value can be set to NULL if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used).
* @param[in] ctx_str_len The length of the context string. This value can be set to 0 if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used).
* @param[in] public_key The public key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*verify_with_ctx_str)(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *ctx_str, size_t ctx_str_len, const uint8_t *public_key);
} OQS_SIG;
/**
* Constructs an OQS_SIG object for a particular algorithm.
*
* Callers should always check whether the return value is `NULL`, which indicates either than an
* invalid algorithm name was provided, or that the requested algorithm was disabled at compile-time.
*
* @param[in] method_name Name of the desired algorithm; one of the names in `OQS_SIG_algs`.
* @return An OQS_SIG for the particular algorithm, or `NULL` if the algorithm has been disabled at compile-time.
*/
OQS_API OQS_SIG *OQS_SIG_new(const char *method_name);
/**
* Keypair generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `public_key` and
* `secret_key`, based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_*_length_*`.
*
* @param[in] sig The OQS_SIG object representing the signature scheme.
* @param[out] public_key The public key represented as a byte string.
* @param[out] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_keypair(const OQS_SIG *sig, uint8_t *public_key, uint8_t *secret_key);
/**
* Signature generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `signnature`,
* based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_*_length_*`.
*
* @param[in] sig The OQS_SIG object representing the signature scheme.
* @param[out] signature The signature on the message represented as a byte string.
* @param[out] signature_len The length of the signature.
* @param[in] message The message to sign represented as a byte string.
* @param[in] message_len The length of the message to sign.
* @param[in] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_sign(const OQS_SIG *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key);
/**
* Signature generation algorithm, with custom context string.
*
* Caller is responsible for allocating sufficient memory for `signature`,
* based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_*_length_*`.
*
* @param[in] sig The OQS_SIG object representing the signature scheme.
* @param[out] signature The signature on the message represented as a byte string.
* @param[out] signature_len The actual length of the signature. May be smaller than `length_signature` for some algorithms since some algorithms have variable length signatures.
* @param[in] message The message to sign represented as a byte string.
* @param[in] message_len The length of the message to sign.
* @param[in] ctx_str The context string used for the signature. This value can be set to NULL if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used).
* @param[in] ctx_str_len The context string used for the signature. This value can be set to 0 if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used).
* @param[in] secret_key The secret key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_sign_with_ctx_str(const OQS_SIG *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *ctx_str, size_t ctx_str_len, const uint8_t *secret_key);
/**
* Signature verification algorithm.
*
* @param[in] sig The OQS_SIG object representing the signature scheme.
* @param[in] message The message represented as a byte string.
* @param[in] message_len The length of the message.
* @param[in] signature The signature on the message represented as a byte string.
* @param[in] signature_len The length of the signature.
* @param[in] public_key The public key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_verify(const OQS_SIG *sig, const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key);
/**
* Signature verification algorithm, with custom context string.
*
* @param[in] sig The OQS_SIG object representing the signature scheme.
* @param[in] message The message represented as a byte string.
* @param[in] message_len The length of the message.
* @param[in] signature The signature on the message represented as a byte string.
* @param[in] signature_len The length of the signature.
* @param[in] ctx_str The context string used for the signature. This value can be set to NULL if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used).
* @param[in] ctx_str_len The context string used for the signature. This value can be set to 0 if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used).
* @param[in] public_key The public key represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_verify_with_ctx_str(const OQS_SIG *sig, const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *ctx_str, size_t ctx_str_len, const uint8_t *public_key);
/**
* Frees an OQS_SIG object that was constructed by OQS_SIG_new.
*
* @param[in] sig The OQS_SIG object to free.
*/
OQS_API void OQS_SIG_free(OQS_SIG *sig);
/**
* Indicates whether the specified signature algorithm supports signing with a context string.
*
* @param[in] alg_name Name of the desired algorithm; one of the names in `OQS_SIG_algs`.
* @return true if the algorithm supports context string signing, false otherwise.
*/
OQS_API bool OQS_SIG_supports_ctx_str(const char *alg_name);
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_INCLUDE_START
#ifdef OQS_ENABLE_SIG_DILITHIUM
#include <oqs/sig_dilithium.h>
#endif /* OQS_ENABLE_SIG_DILITHIUM */
#ifdef OQS_ENABLE_SIG_ML_DSA
#include <oqs/sig_ml_dsa.h>
#endif /* OQS_ENABLE_SIG_ML_DSA */
#ifdef OQS_ENABLE_SIG_FALCON
#include <oqs/sig_falcon.h>
#endif /* OQS_ENABLE_SIG_FALCON */
#ifdef OQS_ENABLE_SIG_SPHINCS
#include <oqs/sig_sphincs.h>
#endif /* OQS_ENABLE_SIG_SPHINCS */
#ifdef OQS_ENABLE_SIG_MAYO
#include <oqs/sig_mayo.h>
#endif /* OQS_ENABLE_SIG_MAYO */
#ifdef OQS_ENABLE_SIG_CROSS
#include <oqs/sig_cross.h>
#endif /* OQS_ENABLE_SIG_CROSS */
#ifdef OQS_ENABLE_SIG_UOV
#include <oqs/sig_uov.h>
#endif /* OQS_ENABLE_SIG_UOV */
#ifdef OQS_ENABLE_SIG_SNOVA
#include <oqs/sig_snova.h>
#endif /* OQS_ENABLE_SIG_SNOVA */
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_INCLUDE_END
// EDIT-WHEN-ADDING-SIG
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // OQS_SIG_H
@@ -0,0 +1,740 @@
/**
* \file sig_stfl.h
* \brief Stateful Signature schemes
*
* The file `tests/example_sig_stfl.c` contains an example on using the OQS_SIG_STFL API.
*
* SPDX-License-Identifier: MIT
*/
#ifndef OQS_SIG_STATEFUL_H
#define OQS_SIG_STATEFUL_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <oqs/oqs.h>
/*
* Developer's Notes:
* Stateful signatures are based on the one-time use of a secret key. A pool of secret keys is created for this purpose.
* The state of these keys is tracked to ensure that they are used only once to generate a signature.
*
* As such, product-specific environments do play a role in ensuring the safety of the keys.
* Secret keys must be stored securely.
* The key index/counter must be updated after each signature generation.
* The secret key must be protected in a thread-safe manner.
*
* Applications therefore are required to provide environment-specific callback functions to
* - store private key
* - lock/unlock private key
*
* See below for details
* OQS_SIG_STFL_SECRET_KEY_SET_lock
* OQS_SIG_STFL_SECRET_KEY_SET_unlock
* OQS_SIG_STFL_SECRET_KEY_SET_mutex
* OQS_SIG_STFL_SECRET_KEY_SET_store_cb
*
*/
#if defined(__cplusplus)
extern "C"
{
#endif
/** Algorithm identifier for XMSS-SHA2_10_256 */
#define OQS_SIG_STFL_alg_xmss_sha256_h10 "XMSS-SHA2_10_256"
/** Algorithm identifier for XMSS-SHA2_16_256 */
#define OQS_SIG_STFL_alg_xmss_sha256_h16 "XMSS-SHA2_16_256"
/** Algorithm identifier for XMSS-SHA2_20_256 */
#define OQS_SIG_STFL_alg_xmss_sha256_h20 "XMSS-SHA2_20_256"
/** Algorithm identifier for XMSS-SHAKE_10_256 */
#define OQS_SIG_STFL_alg_xmss_shake128_h10 "XMSS-SHAKE_10_256"
/** Algorithm identifier for XMSS-SHAKE_16_256 */
#define OQS_SIG_STFL_alg_xmss_shake128_h16 "XMSS-SHAKE_16_256"
/** Algorithm identifier for XMSS-SHAKE_20_256 */
#define OQS_SIG_STFL_alg_xmss_shake128_h20 "XMSS-SHAKE_20_256"
/** Algorithm identifier for XMSS-SHA2_10_512 */
#define OQS_SIG_STFL_alg_xmss_sha512_h10 "XMSS-SHA2_10_512"
/** Algorithm identifier for XMSS-SHA2_16_512 */
#define OQS_SIG_STFL_alg_xmss_sha512_h16 "XMSS-SHA2_16_512"
/** Algorithm identifier for XMSS-SHA2_20_512 */
#define OQS_SIG_STFL_alg_xmss_sha512_h20 "XMSS-SHA2_20_512"
/** Algorithm identifier for XMSS-SHAKE_10_512 */
#define OQS_SIG_STFL_alg_xmss_shake256_h10 "XMSS-SHAKE_10_512"
/** Algorithm identifier for XMSS-SHAKE_16_512 */
#define OQS_SIG_STFL_alg_xmss_shake256_h16 "XMSS-SHAKE_16_512"
/** Algorithm identifier for XMSS-SHAKE_20_512 */
#define OQS_SIG_STFL_alg_xmss_shake256_h20 "XMSS-SHAKE_20_512"
/** Algorithm identifier for XMSS-SHA2_10_192 */
#define OQS_SIG_STFL_alg_xmss_sha256_h10_192 "XMSS-SHA2_10_192"
/** Algorithm identifier for XMSS-SHA2_16_192 */
#define OQS_SIG_STFL_alg_xmss_sha256_h16_192 "XMSS-SHA2_16_192"
/** Algorithm identifier for XMSS-SHA2_20_192 */
#define OQS_SIG_STFL_alg_xmss_sha256_h20_192 "XMSS-SHA2_20_192"
/** Algorithm identifier for XMSS-SHAKE256_10_192 */
#define OQS_SIG_STFL_alg_xmss_shake256_h10_192 "XMSS-SHAKE256_10_192"
/** Algorithm identifier for XMSS-SHAKE256_16_192 */
#define OQS_SIG_STFL_alg_xmss_shake256_h16_192 "XMSS-SHAKE256_16_192"
/** Algorithm identifier for XMSS-SHAKE256_20_192 */
#define OQS_SIG_STFL_alg_xmss_shake256_h20_192 "XMSS-SHAKE256_20_192"
/** Algorithm identifier for XMSS-SHAKE256_10_256 */
#define OQS_SIG_STFL_alg_xmss_shake256_h10_256 "XMSS-SHAKE256_10_256"
/** Algorithm identifier for XMSS-SHAKE256_16_256 */
#define OQS_SIG_STFL_alg_xmss_shake256_h16_256 "XMSS-SHAKE256_16_256"
/** Algorithm identifier for XMSS-SHAKE256_20_256 */
#define OQS_SIG_STFL_alg_xmss_shake256_h20_256 "XMSS-SHAKE256_20_256"
/** Algorithm identifier for XMSSMT-SHA2_20/2_256 */
#define OQS_SIG_STFL_alg_xmssmt_sha256_h20_2 "XMSSMT-SHA2_20/2_256"
/** Algorithm identifier for XMSSMT-SHA2_20/4_256 */
#define OQS_SIG_STFL_alg_xmssmt_sha256_h20_4 "XMSSMT-SHA2_20/4_256"
/** Algorithm identifier for XMSSMT-SHA2_40/2_256 */
#define OQS_SIG_STFL_alg_xmssmt_sha256_h40_2 "XMSSMT-SHA2_40/2_256"
/** Algorithm identifier for XMSSMT-SHA2_40/4_256 */
#define OQS_SIG_STFL_alg_xmssmt_sha256_h40_4 "XMSSMT-SHA2_40/4_256"
/** Algorithm identifier for XMSSMT-SHA2_40/8_256 */
#define OQS_SIG_STFL_alg_xmssmt_sha256_h40_8 "XMSSMT-SHA2_40/8_256"
/** Algorithm identifier for XMSSMT-SHA2_60/3_256 */
#define OQS_SIG_STFL_alg_xmssmt_sha256_h60_3 "XMSSMT-SHA2_60/3_256"
/** Algorithm identifier for XMSSMT-SHA2_60/6_256 */
#define OQS_SIG_STFL_alg_xmssmt_sha256_h60_6 "XMSSMT-SHA2_60/6_256"
/** Algorithm identifier for XMSSMT-SHA2_60/12_256 */
#define OQS_SIG_STFL_alg_xmssmt_sha256_h60_12 "XMSSMT-SHA2_60/12_256"
/** Algorithm identifier for XMSSMT-SHAKE_20/2_256 */
#define OQS_SIG_STFL_alg_xmssmt_shake128_h20_2 "XMSSMT-SHAKE_20/2_256"
/** Algorithm identifier for XMSSMT-SHAKE_20/4_256 */
#define OQS_SIG_STFL_alg_xmssmt_shake128_h20_4 "XMSSMT-SHAKE_20/4_256"
/** Algorithm identifier for XMSSMT-SHAKE_40/2_256 */
#define OQS_SIG_STFL_alg_xmssmt_shake128_h40_2 "XMSSMT-SHAKE_40/2_256"
/** Algorithm identifier for XMSSMT-SHAKE_40/4_256 */
#define OQS_SIG_STFL_alg_xmssmt_shake128_h40_4 "XMSSMT-SHAKE_40/4_256"
/** Algorithm identifier for XMSSMT-SHAKE_40/8_256 */
#define OQS_SIG_STFL_alg_xmssmt_shake128_h40_8 "XMSSMT-SHAKE_40/8_256"
/** Algorithm identifier for XMSSMT-SHAKE_60/3_256 */
#define OQS_SIG_STFL_alg_xmssmt_shake128_h60_3 "XMSSMT-SHAKE_60/3_256"
/** Algorithm identifier for XMSSMT-SHAKE_60/6_256 */
#define OQS_SIG_STFL_alg_xmssmt_shake128_h60_6 "XMSSMT-SHAKE_60/6_256"
/** Algorithm identifier for XMSSMT-SHAKE_60/12_256 */
#define OQS_SIG_STFL_alg_xmssmt_shake128_h60_12 "XMSSMT-SHAKE_60/12_256"
/* Defined LMS parameter identifiers */
/** Algorithm identifier for LMS-SHA256_H5_W1 */
#define OQS_SIG_STFL_alg_lms_sha256_h5_w1 "LMS_SHA256_H5_W1" //"5/1"
/** Algorithm identifier for LMS-SHA256_H5_W2 */
#define OQS_SIG_STFL_alg_lms_sha256_h5_w2 "LMS_SHA256_H5_W2" //"5/2"
/** Algorithm identifier for LMS-SHA256_H5_W4 */
#define OQS_SIG_STFL_alg_lms_sha256_h5_w4 "LMS_SHA256_H5_W4" //"5/4"
/** Algorithm identifier for LMS-SHA256_H5_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h5_w8 "LMS_SHA256_H5_W8" //"5/8"
/** Algorithm identifier for LMS-SHA256_H10_W1 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w1 "LMS_SHA256_H10_W1" //"10/1"
/** Algorithm identifier for LMS-SHA256_H10_W2 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w2 "LMS_SHA256_H10_W2" //"10/2"
/** Algorithm identifier for LMS-SHA256_H10_W4 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w4 "LMS_SHA256_H10_W4" //"10/4"
/** Algorithm identifier for LMS-SHA256_H10_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w8 "LMS_SHA256_H10_W8" //"10/8"
/** Algorithm identifier for LMS-SHA256_H15_W1 */
#define OQS_SIG_STFL_alg_lms_sha256_h15_w1 "LMS_SHA256_H15_W1" //"15/1"
/** Algorithm identifier for LMS-SHA256_H15_W2 */
#define OQS_SIG_STFL_alg_lms_sha256_h15_w2 "LMS_SHA256_H15_W2" //"15/2"
/** Algorithm identifier for LMS-SHA256_H15_W4 */
#define OQS_SIG_STFL_alg_lms_sha256_h15_w4 "LMS_SHA256_H15_W4" //"15/4"
/** Algorithm identifier for LMS-SHA256_H15_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h15_w8 "LMS_SHA256_H15_W8" //"15/8"
/** Algorithm identifier for LMS-SHA256_H20_W1 */
#define OQS_SIG_STFL_alg_lms_sha256_h20_w1 "LMS_SHA256_H20_W1" //"20/1"
/** Algorithm identifier for LMS-SHA256_H20_W2 */
#define OQS_SIG_STFL_alg_lms_sha256_h20_w2 "LMS_SHA256_H20_W2" //"20/2"
/** Algorithm identifier for LMS-SHA256_H20_W4 */
#define OQS_SIG_STFL_alg_lms_sha256_h20_w4 "LMS_SHA256_H20_W4" //"20/4"
/** Algorithm identifier for LMS-SHA256_H20_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h20_w8 "LMS_SHA256_H20_W8" //"20/8"
/** Algorithm identifier for LMS-SHA256_H25_W1 */
#define OQS_SIG_STFL_alg_lms_sha256_h25_w1 "LMS_SHA256_H25_W1" //"25/1"
/** Algorithm identifier for LMS-SHA256_H25_W2 */
#define OQS_SIG_STFL_alg_lms_sha256_h25_w2 "LMS_SHA256_H25_W2" //"25/2"
/** Algorithm identifier for LMS-SHA256_H25_W4 */
#define OQS_SIG_STFL_alg_lms_sha256_h25_w4 "LMS_SHA256_H25_W4" //"25/4"
/** Algorithm identifier for LMS-SHA256_H25_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h25_w8 "LMS_SHA256_H25_W8" //"25/8"
// 2-Level LMS
/** Algorithm identifier for LMS-SHA256_H5_W8_H5_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h5_w8_h5_w8 "LMS_SHA256_H5_W8_H5_W8" //"5/8, 5/8"
// RFC 6554
/** Algorithm identifier for LMS-SHA256_H10_W4_H5_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w4_h5_w8 "LMS_SHA256_H10_W4_H5_W8" //"10/4, 5/8"
/** Algorithm identifier for LMS-SHA256_H10_W8_H5_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w8_h5_w8 "LMS_SHA256_H10_W8_H5_W8" //"10/8, 5/8"
/** Algorithm identifier for LMS-SHA256_H10_W2_H10_W2 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w2_h10_w2 "LMS_SHA256_H10_W2_H10_W2" //"10/2, 10/2"
/** Algorithm identifier for LMS-SHA256_H10_W4_H10_W4 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w4_h10_w4 "LMS_SHA256_H10_W4_H10_W4" //"10/4, 10/4"
/** Algorithm identifier for LMS-SHA256_H10_W8_H10_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h10_w8_h10_w8 "LMS_SHA256_H10_W8_H10_W8" //"10/8, 10/8"
/** Algorithm identifier for LMS-SHA256_H15_W8_H5_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h15_w8_h5_w8 "LMS_SHA256_H15_W8_H5_W8" //"15/8, 5/8"
/** Algorithm identifier for LMS-SHA256_H15_W8_H10_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h15_w8_h10_w8 "LMS_SHA256_H15_W8_H10_W8" //"15/8, 10/8"
/** Algorithm identifier for LMS-SHA256_H15_W8_H15_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h15_w8_h15_w8 "LMS_SHA256_H15_W8_H15_W8" //"15/8, 15/8"
/** Algorithm identifier for LMS-SHA256_H20_W8_H5_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h20_w8_h5_w8 "LMS_SHA256_H20_W8_H5_W8" //"20/8, 5/8"
/** Algorithm identifier for LMS-SHA256_H20_W8_H10_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h20_w8_h10_w8 "LMS_SHA256_H20_W8_H10_W8" //"20/8, 10/8"
/** Algorithm identifier for LMS-SHA256_H20_W8_H15_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h20_w8_h15_w8 "LMS_SHA256_H20_W8_H15_W8" //"20/8, 15/8"
/** Algorithm identifier for LMS-SHA256_H20_W8_H20_W8 */
#define OQS_SIG_STFL_alg_lms_sha256_h20_w8_h20_w8 "LMS_SHA256_H20_W8_H20_W8" //"20/8, 20/8"
/** Total number of stateful variants defined above, used to create the tracking array */
#define OQS_SIG_STFL_algs_length 70
typedef struct OQS_SIG_STFL_SECRET_KEY OQS_SIG_STFL_SECRET_KEY;
/**
* Application provided function to securely store data
* @param[in] sk_buf pointer to the data to be saved
* @param[in] buf_len length of the data to be stored
* @param[out] context pass back application data related to secret key data storage.
* return OQS_SUCCESS if successful, otherwise OQS_ERROR
*/
typedef OQS_STATUS (*secure_store_sk)(uint8_t *sk_buf, size_t buf_len, void *context);
/**
* Application provided function to lock secret key object serialize access
* @param[in] mutex pointer to mutex struct
* return OQS_SUCCESS if successful, otherwise OQS_ERROR
*/
typedef OQS_STATUS (*lock_key)(void *mutex);
/**
* Application provided function to unlock secret key object
* @param[in] mutex pointer to mutex struct
* return OQS_SUCCESS if successful, otherwise OQS_ERROR
*/
typedef OQS_STATUS (*unlock_key)(void *mutex);
/**
* Returns identifiers for available signature schemes in liboqs. Used with `OQS_SIG_STFL_new`.
*
* Note that algorithm identifiers are present in this list even when the algorithm is disabled
* at compile time.
*
* @param[in] i Index of the algorithm identifier to return, 0 <= i < OQS_SIG_algs_length
* @return Algorithm identifier as a string, or NULL.
*/
OQS_API const char *OQS_SIG_STFL_alg_identifier(size_t i);
/**
* Returns the number of stateful signature mechanisms in liboqs. They can be enumerated with
* OQS_SIG_STFL_alg_identifier.
*
* Note that some mechanisms may be disabled at compile time.
*
* @return The number of stateful signature mechanisms.
*/
OQS_API int OQS_SIG_STFL_alg_count(void);
/**
* Indicates whether the specified algorithm was enabled at compile-time or not.
*
* @param[in] method_name Name of the desired algorithm; one of the names in `OQS_SIG_STFL_algs`.
* @return 1 if enabled, 0 if disabled or not found
*/
OQS_API int OQS_SIG_STFL_alg_is_enabled(const char *method_name);
#ifndef OQS_ALLOW_STFL_KEY_AND_SIG_GEN
/** Signature schemes object */
typedef struct OQS_SIG OQS_SIG;
/** Stateful signature scheme object */
#define OQS_SIG_STFL OQS_SIG
#else
/** Stateful signature scheme object */
typedef struct OQS_SIG_STFL {
/**
* A local ordinal representing the LMS/XMSS OID parameter of the signature scheme.
* This OID is unrelated to ASN.1 OID, it's only for LMS/XMSS internal usage.
*/
uint32_t oid;
/** Printable string representing the name of the signature scheme. */
const char *method_name;
/**
* Printable string representing the version of the cryptographic algorithm.
*
* Implementations with the same method_name and same alg_version will be interoperable.
* See README.md for information about algorithm compatibility.
*/
const char *alg_version;
/** Whether the signature offers EUF-CMA security (TRUE) or not (FALSE). */
bool euf_cma;
/** Whether the signature offers SUF-CMA security (TRUE) or not (FALSE). */
bool suf_cma;
/** The (maximum) length, in bytes, of public keys for this signature scheme. */
size_t length_public_key;
/** The (maximum) length, in bytes, of secret keys for this signature scheme. */
size_t length_secret_key;
/** The (maximum) length, in bytes, of signatures for this signature scheme. */
size_t length_signature;
/**
* Keypair generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `public_key`
* based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_STFL_*_length_*`.
*
* @param[out] public_key The public key is represented as a byte string.
* @param[out] secret_key The secret key object
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*keypair)(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key);
/**
* Signature generation algorithm.
*
* For stateful signatures, there is always a limited number of signatures that can be used,
* The private key signature counter is increased by one once a signature is successfully generated,
* When the signature counter reaches the maximum number of available signatures, the signature generation always fails.
*
* Caller is responsible for allocating sufficient memory for `signature`,
* based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_STFL_*_length_*`.
*
* @param[out] signature The signature on the message is represented as a byte string.
* @param[out] signature_len The length of the signature.
* @param[in] message The message to sign is represented as a byte string.
* @param[in] message_len The length of the message to sign.
* @param[in] secret_key The secret key object pointer.
* @return OQS_SUCCESS or OQS_ERROR
*
* @note Internally, if `lock/unlock` functions and `mutex` are set, it will attempt to lock the private key and unlock
* the private key after the Signing operation is completed.
*/
OQS_STATUS (*sign)(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key);
/**
* Signature verification algorithm.
*
* @param[in] message The message is represented as a byte string.
* @param[in] message_len The length of the message.
* @param[in] signature The signature on the message is represented as a byte string.
* @param[in] signature_len The length of the signature.
* @param[in] public_key The public key is represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*verify)(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key);
/**
* Query the number of remaining signatures.
*
* The remaining signatures are the number of signatures available before the private key runs out of its total signature and expires.
*
* @param[out] remain The number of remaining signatures
* @param[in] secret_key The secret key object pointer.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*sigs_remaining)(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key);
/**
* Query the total number of signatures.
*
* The total number of signatures is the constant number present in how many signatures can be generated from a private key.
*
* @param[out] total The total number of signatures
* @param[in] secret_key The secret key key object pointer.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*sigs_total)(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key);
} OQS_SIG_STFL;
#endif //OQS_ALLOW_STFL_KEY_AND_SIG_GEN
/**
* @brief OQS_SIG_STFL_SECRET_KEY object for stateful signature schemes
*/
typedef struct OQS_SIG_STFL_SECRET_KEY {
/** The (maximum) length, in bytes, of secret keys for this signature scheme. */
size_t length_secret_key;
/** The variant-specific secret key data must be allocated at the initialization. */
void *secret_key_data;
/** The mutual exclusion struct */
void *mutex;
/** Application-managed data related to secure storage of secret key data */
void *context;
/**
* Serialize the stateful secret key.
*
* This function encodes the stateful secret key represented by `sk` into a byte stream
* for storage or transfer. The `sk_buf_ptr` will point to the allocated memory containing
* the byte stream. Users must free the `sk_buf_ptr` using `OQS_MEM_secure_free` after use.
* The `sk_len` will contain the length of the byte stream.
*
* @param[out] sk_buf_ptr Pointer to the byte stream representing the serialized secret key.
* @param[out] sk_buf_len Pointer to the length of the serialized byte stream.
* @param[in] sk Pointer to the `OQS_SIG_STFL_SECRET_KEY` object to serialize.
* @return The number of bytes in the serialized byte stream upon success, or an OQS error code on failure.
*
* @attention The caller is responsible for ensuring that `sk` is a valid object before calling this function.
*/
OQS_STATUS (*serialize_key)(uint8_t **sk_buf_ptr, size_t *sk_buf_len, const OQS_SIG_STFL_SECRET_KEY *sk);
/**
* Deserialize a byte stream into the internal representation of a stateful secret key.
*
* This function takes a series of bytes representing a stateful secret key and initializes
* the internal `OQS_SIG_STFL_SECRET_KEY` object with the key material. This is particularly
* useful for reconstructing key objects from persisted or transmitted state.
*
* @param[out] sk Pointer to an uninitialized `OQS_SIG_STFL_SECRET_KEY` object to hold the secret key.
* @param[in] sk_buf Pointer to the byte stream containing the serialized secret key data.
* @param[in] sk_buf_len The length of the secret key byte stream.
* @param[in] context Pointer to application-specific data, handled externally, associated with the key.
* @returns OQS_SUCCESS if the deserialization succeeds, with the `sk` object populated with the key material.
*
* @attention The caller is responsible for ensuring that `sk_buf` is securely deallocated when it's no longer needed.
*/
OQS_STATUS (*deserialize_key)(OQS_SIG_STFL_SECRET_KEY *sk, const uint8_t *sk_buf, const size_t sk_buf_len, void *context);
/**
* Secret Key Locking Function
*
* @param[in] mutex application defined mutex
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*lock_key)(void *mutex);
/**
* Secret Key Unlocking / Releasing Function
*
* @param[in] mutex application defined mutex
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_STATUS (*unlock_key)(void *mutex);
/**
* Store Secret Key Function
*
* Callback function used to securely store key data after a signature generation.
* When populated, this pointer points to the application-supplied secure storage function.
* @param[in] sk_buf The serialized secret key data to secure store
* @param[in] sk_buf_len length of data to secure
* @param[in] context application supplied data used to locate where this secret key
* is stored (passed in at the time the function pointer was set).
*
* @return OQS_SUCCESS or OQS_ERROR
* Ideally written to a secure device.
*/
OQS_STATUS (*secure_store_scrt_key)(uint8_t *sk_buf, size_t sk_buf_len, void *context);
/**
* Free internal variant-specific data
*
* @param[in] sk The secret key represented as OQS_SIG_STFL_SECRET_KEY object.
* @return None.
*/
void (*free_key)(OQS_SIG_STFL_SECRET_KEY *sk);
/**
* Set Secret Key Store Callback Function
*
* This function is used to establish a callback mechanism for secure storage
* of private keys involved in stateful signature Signing operation. The secure storage
* and the management of private keys is the responsibility of the adopting application.
* Therefore, before invoking stateful signature generation, a callback function and
* associated context data must be provided by the application to manage the storage.
*
* The `context` argument is designed to hold information requisite for private key storage,
* such as a hardware security module (HSM) context, a file path, or other relevant data.
* This context is passed to the libOQS when the callback function is registered.
*
* @param[in] sk A pointer to the secret key object that requires secure storage management
* after signature Signing operations.
* @param[in] store_cb A pointer to the callback function provided by the application
* for storing and updating the private key securely.
* @param[in] context Application-specific context information for the private key storage,
* furnished when setting the callback function via
* OQS_SIG_STFL_SECRET_KEY_set_store_cb().
* @return None.
*/
void (*set_scrt_key_store_cb)(OQS_SIG_STFL_SECRET_KEY *sk, secure_store_sk store_cb, void *context);
} OQS_SIG_STFL_SECRET_KEY;
/**
* Constructs an OQS_SIG_STFL object for a particular algorithm.
*
* Callers should always check whether the return value is `NULL`, which indicates either than an
* invalid algorithm name was provided, or that the requested algorithm was disabled at compile-time.
*
* @param[in] method_name Name of the desired algorithm; one of the names in `OQS_SIG_STFL_algs`.
* @return An OQS_SIG_STFL for the particular algorithm, or `NULL` if the algorithm has been disabled at compile-time.
*/
OQS_API OQS_SIG_STFL *OQS_SIG_STFL_new(const char *method_name);
/**
* Keypair generation algorithm.
*
* Caller is responsible for allocating sufficient memory for `public_key` based
* on the `length_*` members in this object or the per-scheme compile-time macros
* `OQS_SIG_STFL_*_length_*`. The caller is also responsible for initializing
* `secret_key` using the OQS_SIG_STFL_SECRET_KEY(*) function.
*
* @param[in] sig The OQS_SIG_STFL object representing the signature scheme.
* @param[out] public_key The public key is represented as a byte string.
* @param[out] secret_key The secret key object pointer.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_STFL_keypair(const OQS_SIG_STFL *sig, uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key);
/**
* Signature generation algorithm.
*
* For stateful signatures, there is always a limited number of signatures that can be used,
* The private key signature counter is increased by one once a signature is successfully generated,
* When the signature counter reaches the maximum number of available signatures, the signature generation always fails.
*
* Caller is responsible for allocating sufficient memory for `signature`,
* based on the `length_*` members in this object or the per-scheme
* compile-time macros `OQS_SIG_STFL_*_length_*`.
*
* @param[in] sig The OQS_SIG_STFL object representing the signature scheme.
* @param[out] signature The signature on the message is represented as a byte string.
* @param[out] signature_len The length of the signature.
* @param[in] message The message to sign is represented as a byte string.
* @param[in] message_len The length of the message to sign.
* @param[in] secret_key The secret key object pointer.
* @return OQS_SUCCESS or OQS_ERROR
*
* @note Internally, if `lock/unlock` functions and `mutex` are set, it will attempt to lock the private key and unlock
* the private key after the Signing operation is completed.
*/
OQS_API OQS_STATUS OQS_SIG_STFL_sign(const OQS_SIG_STFL *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key);
/**
* Signature verification algorithm.
*
* @param[in] sig The OQS_SIG_STFL object representing the signature scheme.
* @param[in] message The message is represented as a byte string.
* @param[in] message_len The length of the message.
* @param[in] signature The signature on the message is represented as a byte string.
* @param[in] signature_len The length of the signature.
* @param[in] public_key The public key is represented as a byte string.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_STFL_verify(const OQS_SIG_STFL *sig, const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key);
/**
* Query the number of remaining signatures.
*
* The remaining signatures are the number of signatures available before the private key runs out of its total signature and expires.
*
* @param[in] sig The OQS_SIG_STFL object representing the signature scheme.
* @param[in] remain The number of remaining signatures.
* @param[in] secret_key The secret key object.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_STFL_sigs_remaining(const OQS_SIG_STFL *sig, unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key);
/**
* Query the total number of signatures.
*
* The total number of signatures is the constant number present in how many signatures can be generated from a private key.
*
* @param[in] sig The OQS_SIG_STFL object representing the signature scheme.
* @param[out] max The number of remaining signatures
* @param[in] secret_key The secret key object.
* @return OQS_SUCCESS or OQS_ERROR
*/
OQS_API OQS_STATUS OQS_SIG_STFL_sigs_total(const OQS_SIG_STFL *sig, unsigned long long *max, const OQS_SIG_STFL_SECRET_KEY *secret_key);
/**
* Free an OQS_SIG_STFL object that was constructed by OQS_SIG_STFL_new.
*
*/
OQS_API void OQS_SIG_STFL_free(OQS_SIG_STFL *sig);
/**
* Construct an OQS_SIG_STFL_SECRET_KEY object for a particular algorithm.
*
* Callers should always check whether the return value is `NULL`, which indicates either than an
* invalid algorithm name was provided, or that the requested algorithm was disabled at compile-time.
*
* @param[in] method_name Name of the desired algorithm; one of the names in `OQS_SIG_STFL_algs`.
* @return An OQS_SIG_STFL_SECRET_KEY for the particular algorithm, or `NULL` if the algorithm has been disabled at compile-time.
*/
OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SIG_STFL_SECRET_KEY_new(const char *method_name);
/**
* Free an OQS_SIG_STFL_SECRET_KEY object that was constructed by OQS_SECRET_KEY_new.
*
* @param[in] sk The OQS_SIG_STFL_SECRET_KEY object to free.
*/
OQS_API void OQS_SIG_STFL_SECRET_KEY_free(OQS_SIG_STFL_SECRET_KEY *sk);
/**
* Attach a locking mechanism to a secret key object.
*
* This allows for proper synchronization in a multi-threaded or multi-process environment,
* by ensuring that a secret key is not used concurrently by multiple entities, which could otherwise lead to security issues.
*
* @param[in] sk Pointer to the secret key object whose lock function is to be set.
* @param[in] lock Function pointer to the locking routine provided by the application.
*
* @note It's not required to set the lock and unlock functions in a single-threaded environment.
*
* @note Once the `lock` function is set, users must also set the `mutex` and `unlock` functions.
*
* @note By default, the internal value of `sk->lock` is NULL, which does nothing to lock the private key.
*/
OQS_API void OQS_SIG_STFL_SECRET_KEY_SET_lock(OQS_SIG_STFL_SECRET_KEY *sk, lock_key lock);
/**
* Attach an unlock mechanism to a secret key object.
*
* This allows for proper synchronization in a multi-threaded or multi-process environment,
* by ensuring that a secret key is not used concurrently by multiple entities, which could otherwise lead to security issues.
*
* @param[in] sk Pointer to the secret key object whose unlock function is to be set.
* @param[in] unlock Function pointer to the unlock routine provided by the application.
*
* @note It's not required to set the lock and unlock functions in a single-threaded environment.
*
* @note Once the `unlock` function is set, users must also set the `mutex` and `lock` functions.
*
* @note By default, the internal value of `sk->unlock` is NULL, which does nothing to unlock the private key.
*/
OQS_API void OQS_SIG_STFL_SECRET_KEY_SET_unlock(OQS_SIG_STFL_SECRET_KEY *sk, unlock_key unlock);
/**
* Assign a mutex function to handle concurrency control over the secret key.
*
* This is to ensure that only one process can access or modify the key at any given time.
*
* @param[in] sk A pointer to the secret key that the mutex functionality will protect.
* @param[in] mutex A function pointer to the desired concurrency control mechanism.
*
* @note It's not required to set the lock and unlock functions in a single-threaded environment.
*
* @note By default, the internal value of `sk->mutex` is NULL, it must be set to be used in `lock` or `unlock` the private key.
*/
OQS_API void OQS_SIG_STFL_SECRET_KEY_SET_mutex(OQS_SIG_STFL_SECRET_KEY *sk, void *mutex);
/**
* Lock the secret key to ensure exclusive access in a concurrent environment.
*
* If the `mutex` is not set, this lock operation will fail.
* This lock operation is essential in multi-threaded or multi-process contexts
* to prevent simultaneous Signing operations that could compromise the stateful signature security.
*
* @warning If the `lock` function is set and `mutex` is not set, this lock operation will fail.
*
* @param[in] sk Pointer to the secret key to be locked.
* @return OQS_SUCCESS if the lock is successfully applied; OQS_ERROR otherwise.
*
* @note It's not necessary to use this function in either Keygen or Verifying operations.
* In a concurrent environment, the user is responsible for locking and unlocking the private key,
* to make sure that only one thread can access the private key during a Signing operation.
*
* @note If the `lock` function and `mutex` are both set, proceed to lock the private key.
*/
OQS_STATUS OQS_SIG_STFL_SECRET_KEY_lock(OQS_SIG_STFL_SECRET_KEY *sk);
/**
* Unlock the secret key, making it accessible to other processes.
*
* This function is crucial in environments where multiple processes need to coordinate access to
* the secret key, as it allows a process to signal that it has finished using the key, so
* others can safely use it.
*
* @warning If the `unlock` function is set and `mutex` is not set, this unlock operation will fail.
*
* @param[in] sk Pointer to the secret key whose lock should be released.
* @return OQS_SUCCESS if the lock was successfully released; otherwise, OQS_ERROR.
*
* @note It's not necessary to use this function in either Keygen or Verifying operations.
* In a concurrent environment, the user is responsible for locking and unlocking the private key,
* to make sure that only one thread can access the private key during a Signing operation.
*
* @note If the `unlock` function and `mutex` are both set, proceed to unlock the private key.
*/
OQS_STATUS OQS_SIG_STFL_SECRET_KEY_unlock(OQS_SIG_STFL_SECRET_KEY *sk);
/**
* Set the callback and context for securely storing a stateful secret key.
*
* This function is designed to be called after a new stateful secret key
* has been generated. It enables the library to securely store secret key
* and update it every time a Signing operation occurs.
* Without properly setting this callback and context, signature generation
* will not succeed as the updated state of the secret key cannot be preserved.
*
* @param[in] sk Pointer to the stateful secret key to be managed.
* @param[in] store_cb Callback function that handles the secure storage of the key.
* @param[in] context Application-specific context that assists in the storage of secret key data.
* This context is managed by the application, which allocates it, keeps track of it,
* and deallocates it as necessary.
*/
OQS_API void OQS_SIG_STFL_SECRET_KEY_SET_store_cb(OQS_SIG_STFL_SECRET_KEY *sk, secure_store_sk store_cb, void *context);
/**
* Serialize the stateful secret key data into a byte array.
*
* Converts an OQS_SIG_STFL_SECRET_KEY object into a byte array for storage or transmission.
*
* @param[out] sk_buf_ptr Pointer to the allocated byte array containing the serialized key.
* @param[out] sk_buf_len Length of the serialized key byte array.
* @param[in] sk Pointer to the OQS_SIG_STFL_SECRET_KEY object to be serialized.
* @return OQS_SUCCESS on success, or an OQS error code on failure.
*
* @note The function allocates memory for the byte array, and it is the caller's responsibility to free this memory after use.
*/
OQS_API OQS_STATUS OQS_SIG_STFL_SECRET_KEY_serialize(uint8_t **sk_buf_ptr, size_t *sk_buf_len, const OQS_SIG_STFL_SECRET_KEY *sk);
/**
* Deserialize a byte array into an OQS_SIG_STFL_SECRET_KEY object.
*
* Transforms a binary representation of a secret key into an OQS_SIG_STFL_SECRET_KEY structure.
* After deserialization, the secret key object can be used for subsequent cryptographic operations.
*
* @param[out] sk A pointer to the secret key object that will be populated from the binary data.
* @param[in] sk_buf The buffer containing the serialized secret key data.
* @param[in] sk_buf_len The length of the binary secret key data in bytes.
* @param[in] context Application-specific data used to maintain context about the secret key.
* @return OQS_SUCCESS if deserialization was successful; otherwise, OQS_ERROR.
*
* @attention The caller is responsible for freeing the `sk_buf` memory when it is no longer needed.
*/
OQS_API OQS_STATUS OQS_SIG_STFL_SECRET_KEY_deserialize(OQS_SIG_STFL_SECRET_KEY *sk, const uint8_t *sk_buf, size_t sk_buf_len, void *context);
#if defined(__cplusplus)
// extern "C"
}
#endif
#endif /* OQS_SIG_STATEFUL_H */
Binary file not shown.
@@ -0,0 +1,121 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/common/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/kem/kyber/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/kem/ml_kem/cmake_install.cmake")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/liboqs" TYPE FILE FILES
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/liboqsConfig.cmake"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/liboqsConfigVersion.cmake"
)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig" TYPE FILE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/liboqs.pc")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/lib/liboqs.a")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/liboqs/liboqsTargets.cmake")
file(DIFFERENT _cmake_export_file_changed FILES
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/liboqs/liboqsTargets.cmake"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/CMakeFiles/Export/c7e97583fbc7c9ca02085e7795e05761/liboqsTargets.cmake")
if(_cmake_export_file_changed)
file(GLOB _cmake_old_config_files "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/liboqs/liboqsTargets-*.cmake")
if(_cmake_old_config_files)
string(REPLACE ";" ", " _cmake_old_config_files_text "${_cmake_old_config_files}")
message(STATUS "Old export file \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/liboqs/liboqsTargets.cmake\" will be replaced. Removing files [${_cmake_old_config_files_text}].")
unset(_cmake_old_config_files_text)
file(REMOVE ${_cmake_old_config_files})
endif()
unset(_cmake_old_config_files)
endif()
unset(_cmake_export_file_changed)
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/liboqs" TYPE FILE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/CMakeFiles/Export/c7e97583fbc7c9ca02085e7795e05761/liboqsTargets.cmake")
if(CMAKE_INSTALL_CONFIG_NAME MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$")
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/liboqs" TYPE FILE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/CMakeFiles/Export/c7e97583fbc7c9ca02085e7795e05761/liboqsTargets-release.cmake")
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/oqs" TYPE FILE FILES
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/oqs.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common/aes/aes_ops.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common/common.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common/rand/rand.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common/sha2/sha2_ops.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common/sha3/sha3_ops.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common/sha3/sha3x4_ops.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/kem/kem.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/sig/sig.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/sig_stfl/sig_stfl.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/kem/kyber/kem_kyber.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/kem/ml_kem/kem_ml_kem.h"
"/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/include/oqs/oqsconfig.h"
)
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,60 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/common/sha3/xkcp_low/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/common/sha3/avx512vl_low/cmake_install.cmake")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/common/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common/sha3/avx512vl_low
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/common/sha3/avx512vl_low/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/common/sha3/xkcp_low
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/common/sha3/xkcp_low/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/kem/kyber
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/kem/kyber/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src/kem/ml_kem
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/src/kem/ml_kem/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,10 @@
prefix=/usr/local
libdir=${prefix}/lib
includedir=${prefix}/include
Name: liboqs
Description: Library for quantum-safe cryptographic algorithms
Version: 0.14.0
Requires.private: openssl
Cflags: -I${includedir}
Libs: -L${libdir} -loqs
@@ -0,0 +1,31 @@
# SPDX-License-Identifier: MIT
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was Config.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
include("${CMAKE_CURRENT_LIST_DIR}/liboqsTargets.cmake")
check_required_components(oqs)
@@ -0,0 +1,43 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "0.14.0")
if (PACKAGE_FIND_VERSION_RANGE)
# Package version must be in the requested version range
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
endif()
else()
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
math(EXPR installedBits "8 * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
@@ -0,0 +1,69 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.29)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS OQS::oqs)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Create imported target OQS::oqs
add_library(OQS::oqs STATIC IMPORTED)
set_target_properties(OQS::oqs PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/liboqs/src"
INTERFACE_LINK_LIBRARIES "/usr/lib/x86_64-linux-gnu/libcrypto.so"
)
# Import target "OQS::oqs" for configuration "Release"
set_property(TARGET OQS::oqs APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(OQS::oqs PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "ASM;C"
IMPORTED_LOCATION_RELEASE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/lib/liboqs.a"
)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
@@ -0,0 +1,9 @@
# CMake generated Testfile for
# Source directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider
# Build directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
subdirs("oqsprov")
subdirs("test")
subdirs("examples")
@@ -0,0 +1,58 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/oqsprov/cmake_install.cmake")
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/test/cmake_install.cmake")
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/examples/cmake_install.cmake")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,6 @@
# CMake generated Testfile for
# Source directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider/examples
# Build directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/examples
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider/examples
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/examples/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,76 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider/oqsprov
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/lib/liboqsprovider.a")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/oqs-provider" TYPE FILE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider/oqsprov/oqs_prov.h")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
if(CMAKE_INSTALL_CONFIG_NAME MATCHES "^([Dd][Ee][Bb][Pp][Aa][Cc][Kk])$")
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/lib/liboqsprovider.a")
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
if(CMAKE_INSTALL_CONFIG_NAME MATCHES "^([Dd][Ee][Bb][Pp][Aa][Cc][Kk])$")
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/oqs-provider" TYPE FILE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider/oqsprov/oqs_prov.h")
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
if(CMAKE_INSTALL_CONFIG_NAME MATCHES "^([Dd][Ee][Bb][Pp][Aa][Cc][Kk])$")
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/oqsprov/CMakeFiles/oqsprovider.dir/install-cxx-module-bmi-Release.cmake" OPTIONAL)
endif()
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/oqsprov/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,6 @@
# CMake generated Testfile for
# Source directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider/test
# Build directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/test
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua/3rdparty/oqs-provider/test
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/test/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,92 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/Mayaqua
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/liboqs/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/oqs-provider/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/3rdparty/cpu_features/cmake_install.cmake")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "common" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmayaqua.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmayaqua.so")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmayaqua.so"
RPATH "/usr/local/lib")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/libmayaqua.so")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmayaqua.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmayaqua.so")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmayaqua.so"
OLD_RPATH "::::::::::::::"
NEW_RPATH "/usr/local/lib")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmayaqua.so")
endif()
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "common" OR NOT CMAKE_INSTALL_COMPONENT)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "common" OR NOT CMAKE_INSTALL_COMPONENT)
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/CMakeFiles/mayaqua.dir/install-cxx-module-bmi-Release.cmake" OPTIONAL)
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
+126
View File
@@ -0,0 +1,126 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Cedar/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/Mayaqua/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnserver/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnclient/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnbridge/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpncmd/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpntest/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/libhamcore/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/hamcorebuilder/cmake_install.cmake")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
message("
----------------------------------------------------------------------------------------------------------------------------")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
message("Build completed successfully.
")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
message("Execute 'vpnserver start' to run the SoftEther VPN Server background service.")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
message("Execute 'vpnbridge start' to run the SoftEther VPN Bridge background service.")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
message("Execute 'vpnclient start' to run the SoftEther VPN Client background service.")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
message("Execute 'vpncmd' to run the SoftEther VPN Command-Line Utility to configure VPN Server, VPN Bridge or VPN Client.")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
message("----------------------------------------------------------------------------------------------------------------------------
")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/hamcorebuilder
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/hamcorebuilder/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
Binary file not shown.
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/libhamcore
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/libhamcore/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
Binary file not shown.
@@ -0,0 +1,105 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/vpnbridge
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnbridge" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge"
RPATH "/usr/local/lib")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge" TYPE EXECUTABLE PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnbridge")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge"
OLD_RPATH "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir:"
NEW_RPATH "/usr/local/lib")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge")
endif()
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnbridge" OR NOT CMAKE_INSTALL_COMPONENT)
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnbridge/CMakeFiles/vpnbridge.dir/install-cxx-module-bmi-Release.cmake" OPTIONAL)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnbridge" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/hamcore.se2")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnbridge" OR NOT CMAKE_INSTALL_COMPONENT)
file(WRITE /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnbridge.sh "#!/bin/sh
exec ${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge \"$@\"
")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnbridge" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE PROGRAM RENAME "vpnbridge" FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnbridge.sh")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnbridge" OR NOT CMAKE_INSTALL_COMPONENT)
set(DIR "${CMAKE_INSTALL_PREFIX}/libexec")
configure_file(/home/runner/work/SoftEtherVPN/SoftEtherVPN/systemd/softether-vpnbridge.service /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/softether-vpnbridge.service)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnbridge" OR NOT CMAKE_INSTALL_COMPONENT)
list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
"/lib/systemd/system/softether-vpnbridge.service")
if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
file(INSTALL DESTINATION "/lib/systemd/system" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/softether-vpnbridge.service")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnbridge/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,105 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/vpnclient
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnclient" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient"
RPATH "/usr/local/lib")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient" TYPE EXECUTABLE PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnclient")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient"
OLD_RPATH "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir:"
NEW_RPATH "/usr/local/lib")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient")
endif()
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnclient" OR NOT CMAKE_INSTALL_COMPONENT)
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnclient/CMakeFiles/vpnclient.dir/install-cxx-module-bmi-Release.cmake" OPTIONAL)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnclient" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/hamcore.se2")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnclient" OR NOT CMAKE_INSTALL_COMPONENT)
file(WRITE /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnclient.sh "#!/bin/sh
exec ${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient \"$@\"
")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnclient" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE PROGRAM RENAME "vpnclient" FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnclient.sh")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnclient" OR NOT CMAKE_INSTALL_COMPONENT)
set(DIR "${CMAKE_INSTALL_PREFIX}/libexec")
configure_file(/home/runner/work/SoftEtherVPN/SoftEtherVPN/systemd/softether-vpnclient.service /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/softether-vpnclient.service)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnclient" OR NOT CMAKE_INSTALL_COMPONENT)
list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
"/lib/systemd/system/softether-vpnclient.service")
if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
file(INSTALL DESTINATION "/lib/systemd/system" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/softether-vpnclient.service")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnclient/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,88 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/vpncmd
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpncmd" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd/vpncmd" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd/vpncmd")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd/vpncmd"
RPATH "/usr/local/lib")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd" TYPE EXECUTABLE PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpncmd")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd/vpncmd" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd/vpncmd")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd/vpncmd"
OLD_RPATH "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir:"
NEW_RPATH "/usr/local/lib")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd/vpncmd")
endif()
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpncmd" OR NOT CMAKE_INSTALL_COMPONENT)
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpncmd/CMakeFiles/vpncmd.dir/install-cxx-module-bmi-Release.cmake" OPTIONAL)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpncmd" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/hamcore.se2")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpncmd" OR NOT CMAKE_INSTALL_COMPONENT)
file(WRITE /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpncmd.sh "#!/bin/sh
exec ${CMAKE_INSTALL_PREFIX}/libexec/softether/vpncmd/vpncmd \"$@\"
")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpncmd" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE PROGRAM RENAME "vpncmd" FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpncmd.sh")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpncmd/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,105 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/vpnserver
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnserver" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver"
RPATH "/usr/local/lib")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver" TYPE EXECUTABLE PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnserver")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver"
OLD_RPATH "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir:"
NEW_RPATH "/usr/local/lib")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver")
endif()
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnserver" OR NOT CMAKE_INSTALL_COMPONENT)
include("/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnserver/CMakeFiles/vpnserver.dir/install-cxx-module-bmi-Release.cmake" OPTIONAL)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnserver" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/hamcore.se2")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnserver" OR NOT CMAKE_INSTALL_COMPONENT)
file(WRITE /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnserver.sh "#!/bin/sh
exec ${CMAKE_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver \"$@\"
")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnserver" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE PROGRAM RENAME "vpnserver" FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/vpnserver.sh")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnserver" OR NOT CMAKE_INSTALL_COMPONENT)
set(DIR "${CMAKE_INSTALL_PREFIX}/libexec")
configure_file(/home/runner/work/SoftEtherVPN/SoftEtherVPN/systemd/softether-vpnserver.service /home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/softether-vpnserver.service)
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "vpnserver" OR NOT CMAKE_INSTALL_COMPONENT)
list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
"/lib/systemd/system/softether-vpnserver.service")
if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
file(INSTALL DESTINATION "/lib/systemd/system" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILES "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/softether-vpnserver.service")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpnserver/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
@@ -0,0 +1,50 @@
# Install script for directory: /home/runner/work/SoftEtherVPN/SoftEtherVPN/src/vpntest
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set path to fallback-tool for dependency-resolution.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
if(CMAKE_INSTALL_LOCAL_ONLY)
file(WRITE "/home/runner/work/SoftEtherVPN/SoftEtherVPN/_codeql_build_dir/src/vpntest/install_local_manifest.txt"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
endif()
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
# placeholder
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
# placeholder
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
# placeholder
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
# placeholder
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
.
+59 -25
View File
@@ -11,6 +11,7 @@
#include "Connection.h" #include "Connection.h"
#include "Logging.h" #include "Logging.h"
#include "Proto_EtherIP.h" #include "Proto_EtherIP.h"
#include "Proto_IKEv2.h"
#include "Proto_IPsec.h" #include "Proto_IPsec.h"
#include "Proto_L2TP.h" #include "Proto_L2TP.h"
#include "Server.h" #include "Server.h"
@@ -35,40 +36,57 @@ void ProcIKEPacketRecv(IKE_SERVER *ike, UDPPACKET *p)
if (p->Type == IKE_UDP_TYPE_ISAKMP) if (p->Type == IKE_UDP_TYPE_ISAKMP)
{ {
// ISAKMP (IKE) packet IKE_HEADER *raw_hdr;
IKE_PACKET *header;
header = ParseIKEPacketHeader(p); // Check packet is large enough for the IKE header
if (header == NULL) if (p->Size < sizeof(IKE_HEADER))
{ {
return; return;
} }
//Debug("InitiatorCookie: %I64u, ResponderCookie: %I64u\n", header->InitiatorCookie, header->ResponderCookie); raw_hdr = (IKE_HEADER *)p->Data;
switch (header->ExchangeType) // Dispatch IKEv2 packets by version field
if (raw_hdr->Version == IKEv2_VERSION)
{ {
case IKE_EXCHANGE_TYPE_MAIN: // Main mode ProcIKEv2PacketRecv(ike, p);
ProcIkeMainModePacketRecv(ike, p, header); return;
break;
case IKE_EXCHANGE_TYPE_AGGRESSIVE: // Aggressive mode
if (ike->Cedar->Server->DisableIPsecAggressiveMode == false)
{
ProcIkeAggressiveModePacketRecv(ike, p, header);
}
break;
case IKE_EXCHANGE_TYPE_QUICK: // Quick mode
ProcIkeQuickModePacketRecv(ike, p, header);
break;
case IKE_EXCHANGE_TYPE_INFORMATION: // Information exchange
ProcIkeInformationalExchangePacketRecv(ike, p, header);
break;
} }
IkeFree(header); // IKEv1 / ISAKMP packet
{
IKE_PACKET *header;
header = ParseIKEPacketHeader(p);
if (header == NULL)
{
return;
}
switch (header->ExchangeType)
{
case IKE_EXCHANGE_TYPE_MAIN: // Main mode
ProcIkeMainModePacketRecv(ike, p, header);
break;
case IKE_EXCHANGE_TYPE_AGGRESSIVE: // Aggressive mode
if (ike->Cedar->Server->DisableIPsecAggressiveMode == false)
{
ProcIkeAggressiveModePacketRecv(ike, p, header);
}
break;
case IKE_EXCHANGE_TYPE_QUICK: // Quick mode
ProcIkeQuickModePacketRecv(ike, p, header);
break;
case IKE_EXCHANGE_TYPE_INFORMATION: // Information exchange
ProcIkeInformationalExchangePacketRecv(ike, p, header);
break;
}
IkeFree(header);
}
} }
else if (p->Type == IKE_UDP_TYPE_ESP) else if (p->Type == IKE_UDP_TYPE_ESP)
{ {
@@ -5645,6 +5663,9 @@ void ProcessIKEInterrupts(IKE_SERVER *ike)
} }
while (ike->StateHasChanged); while (ike->StateHasChanged);
// IKEv2 interrupt processing
ProcessIKEv2Interrupts(ike);
// Maintenance of the thread list // Maintenance of the thread list
MaintainThreadList(ike->ThreadList); MaintainThreadList(ike->ThreadList);
/*Debug("ike->ThreadList: %u\n", LIST_NUM(ike->ThreadList)); /*Debug("ike->ThreadList: %u\n", LIST_NUM(ike->ThreadList));
@@ -5823,6 +5844,17 @@ void FreeIKEServer(IKE_SERVER *ike)
ReleaseList(ike->ClientList); ReleaseList(ike->ClientList);
// Free IKEv2 SAs
{
UINT j;
for (j = 0; j < LIST_NUM(ike->IKEv2SaList); j++)
{
IKEv2_SA *sa2 = LIST_DATA(ike->IKEv2SaList, j);
IKEv2FreeSA(ike, sa2);
}
}
ReleaseList(ike->IKEv2SaList);
ReleaseSockEvent(ike->SockEvent); ReleaseSockEvent(ike->SockEvent);
IPsecLog(ike, NULL, NULL, NULL, "LI_STOP"); IPsecLog(ike, NULL, NULL, NULL, "LI_STOP");
@@ -5869,6 +5901,8 @@ IKE_SERVER *NewIKEServer(CEDAR *cedar, IPSEC_SERVER *ipsec)
ike->ThreadList = NewThreadList(); ike->ThreadList = NewThreadList();
ike->IKEv2SaList = NewList(CmpIKEv2SA);
IPsecLog(ike, NULL, NULL, NULL, "LI_START"); IPsecLog(ike, NULL, NULL, NULL, "LI_START");
return ike; return ike;
+4
View File
@@ -268,6 +268,10 @@ struct IKE_SERVER
// Setting data // Setting data
char Secret[MAX_SIZE]; // Pre-shared key char Secret[MAX_SIZE]; // Pre-shared key
// IKEv2 state
LIST *IKEv2SaList; // IKEv2 SA list
UINT CurrentIKEv2SaId; // IKEv2 SA ID counter
}; };
File diff suppressed because it is too large Load Diff
+288
View File
@@ -0,0 +1,288 @@
// SoftEther VPN Source Code - Developer Edition Master Branch
// Cedar Communication Module
// Proto_IKEv2.h
// Header for IKEv2 (RFC 7296) implementation
#ifndef PROTO_IKEV2_H
#define PROTO_IKEV2_H
#include "Proto_IKE.h"
#include "Proto_IkePacket.h"
//// IKEv2 Header Flags (RFC 7296 Section 3.1)
#define IKEv2_FLAG_RESPONSE 0x20
#define IKEv2_FLAG_VERSION 0x10
#define IKEv2_FLAG_INITIATOR 0x08
//// IKEv2 Payload Types (RFC 7296 Section 3.3)
#define IKEv2_PAYLOAD_NONE 0
#define IKEv2_PAYLOAD_SA 33
#define IKEv2_PAYLOAD_KE 34
#define IKEv2_PAYLOAD_IDi 35
#define IKEv2_PAYLOAD_IDr 36
#define IKEv2_PAYLOAD_CERT 37
#define IKEv2_PAYLOAD_CERTREQ 38
#define IKEv2_PAYLOAD_AUTH 39
#define IKEv2_PAYLOAD_NONCE 40
#define IKEv2_PAYLOAD_NOTIFY 41
#define IKEv2_PAYLOAD_DELETE 42
#define IKEv2_PAYLOAD_VENDOR 43
#define IKEv2_PAYLOAD_TSi 44
#define IKEv2_PAYLOAD_TSr 45
#define IKEv2_PAYLOAD_SK 46
#define IKEv2_PAYLOAD_CP 47
#define IKEv2_PAYLOAD_EAP 48
//// IKEv2 Transform Types
#define IKEv2_TF_ENCR 1
#define IKEv2_TF_PRF 2
#define IKEv2_TF_INTEG 3
#define IKEv2_TF_DH 4
#define IKEv2_TF_ESN 5
//// IKEv2 Encryption Algorithm IDs
#define IKEv2_ENCR_3DES 3
#define IKEv2_ENCR_AES_CBC 12
//// IKEv2 PRF Algorithm IDs
#define IKEv2_PRF_HMAC_MD5 1
#define IKEv2_PRF_HMAC_SHA1 2
#define IKEv2_PRF_HMAC_SHA2_256 5
#define IKEv2_PRF_HMAC_SHA2_384 6
#define IKEv2_PRF_HMAC_SHA2_512 7
//// IKEv2 Integrity Algorithm IDs
#define IKEv2_INTEG_HMAC_MD5_96 1 // key=16, icv=12
#define IKEv2_INTEG_HMAC_SHA1_96 2 // key=20, icv=12
#define IKEv2_INTEG_HMAC_SHA2_256_128 12 // key=32, icv=16
#define IKEv2_INTEG_HMAC_SHA2_384_192 13 // key=48, icv=24
#define IKEv2_INTEG_HMAC_SHA2_512_256 14 // key=64, icv=32
//// IKEv2 DH Groups (same wire values as IKEv1)
#define IKEv2_DH_1024_MODP 2
#define IKEv2_DH_1536_MODP 5
#define IKEv2_DH_2048_MODP 14
#define IKEv2_DH_3072_MODP 15
#define IKEv2_DH_4096_MODP 16
//// IKEv2 ESN Values
#define IKEv2_ESN_NO_ESN 0
#define IKEv2_ESN_YES 1
//// IKEv2 Notify Message Types (error types < 16384)
#define IKEv2_NOTIFY_UNSUPPORTED_CRITICAL_PAYLOAD 1
#define IKEv2_NOTIFY_INVALID_IKE_SPI 4
#define IKEv2_NOTIFY_INVALID_MAJOR_VERSION 5
#define IKEv2_NOTIFY_INVALID_SYNTAX 7
#define IKEv2_NOTIFY_INVALID_MESSAGE_ID 9
#define IKEv2_NOTIFY_INVALID_SPI 11
#define IKEv2_NOTIFY_NO_PROPOSAL_CHOSEN 14
#define IKEv2_NOTIFY_INVALID_KE_PAYLOAD 17
#define IKEv2_NOTIFY_AUTHENTICATION_FAILED 24
#define IKEv2_NOTIFY_TS_UNACCEPTABLE 38
//// IKEv2 Notify status types (>= 16384)
#define IKEv2_NOTIFY_NAT_DETECTION_SOURCE_IP 16388
#define IKEv2_NOTIFY_NAT_DETECTION_DESTINATION_IP 16389
#define IKEv2_NOTIFY_USE_TRANSPORT_MODE 16391
#define IKEv2_NOTIFY_ESP_TFC_PADDING_NOT_SUPPORTED 16394
//// IKEv2 ID Types
#define IKEv2_ID_IPV4_ADDR 1
#define IKEv2_ID_FQDN 2
#define IKEv2_ID_RFC822_ADDR 3
#define IKEv2_ID_IPV6_ADDR 5
#define IKEv2_ID_KEY_ID 11
//// IKEv2 Authentication Methods
#define IKEv2_AUTH_RSA_SIGN 1
#define IKEv2_AUTH_PSK 2
//// IKEv2 Traffic Selector Types
#define IKEv2_TS_IPV4_ADDR_RANGE 7
#define IKEv2_TS_IPV6_ADDR_RANGE 8
//// IKEv2 Protocol IDs
#define IKEv2_PROTO_IKE 1
#define IKEv2_PROTO_AH 2
#define IKEv2_PROTO_ESP 3
//// SA states
#define IKEv2_SA_STATE_HALF_OPEN 0
#define IKEv2_SA_STATE_ESTABLISHED 1
//// Sizes and limits
#define IKEv2_MAX_KEYMAT_SIZE 128
#define IKEv2_NONCE_SIZE 32
#define IKEv2_NONCE_MIN_SIZE 16
#define IKEv2_NONCE_MAX_SIZE 256
#define IKEv2_PSK_PAD "Key Pad for IKEv2"
#define IKEv2_PSK_PAD_LEN 17
//// Timeouts
#define IKEv2_SA_TIMEOUT_HALF_OPEN 30000
#define IKEv2_SA_TIMEOUT_ESTABLISHED (86400ULL * 1000)
#define IKEv2_SA_RESEND_INTERVAL 2000
#define IKEv2_CHILD_SA_LIFETIME_SECS 3600
//// Structures
// Negotiated IKE SA transform parameters
struct IKEv2_IKETF
{
UINT EncrAlg; // Encryption algorithm
UINT EncrKeyLen; // Encryption key length (bytes)
UINT PrfAlg; // PRF algorithm
UINT IntegAlg; // Integrity algorithm
UINT DhGroup; // DH group number
UINT BlockSize; // Cipher block size (bytes)
UINT PrfKeyLen; // PRF key length (bytes)
UINT PrfOutLen; // PRF output length (bytes)
UINT IntegKeyLen; // Integrity key length (bytes)
UINT IntegIcvLen; // Integrity ICV length (bytes)
};
typedef struct IKEv2_IKETF IKEv2_IKETF;
// Negotiated Child SA transform parameters
struct IKEv2_CHILDTF
{
UINT EncrAlg; // Encryption algorithm
UINT EncrKeyLen; // Encryption key length (bytes)
UINT IntegAlg; // Integrity algorithm
UINT IntegKeyLen; // Integrity key length (bytes)
UINT IntegIcvLen; // Integrity ICV length (bytes)
UINT DhGroup; // DH group (0 if none)
bool UseTransport; // True = transport mode
UINT BlockSize; // Cipher block size
};
typedef struct IKEv2_CHILDTF IKEv2_CHILDTF;
// IKEv2 SA (one per IKEv2 connection attempt)
struct IKEv2_SA
{
UINT Id;
UINT64 InitiatorSPI;
UINT64 ResponderSPI;
IP ClientIP;
UINT ClientPort;
IP ServerIP;
UINT ServerPort;
bool IsNatT;
UINT State;
bool Deleting;
UINT64 FirstCommTick;
UINT64 LastCommTick;
IKEv2_IKETF Transform;
// Nonces
BUF *Ni;
BUF *Nr;
// DH
DH_CTX *Dh;
BUF *GxI; // initiator KE value
BUF *GxR; // responder KE value (our public key)
// Derived IKE SA keys (max 64 bytes each)
UCHAR SK_d [IKEv2_MAX_KEYMAT_SIZE];
UCHAR SK_ai[IKEv2_MAX_KEYMAT_SIZE];
UCHAR SK_ar[IKEv2_MAX_KEYMAT_SIZE];
UCHAR SK_ei[IKEv2_MAX_KEYMAT_SIZE];
UCHAR SK_er[IKEv2_MAX_KEYMAT_SIZE];
UCHAR SK_pi[IKEv2_MAX_KEYMAT_SIZE];
UCHAR SK_pr[IKEv2_MAX_KEYMAT_SIZE];
// Crypto key objects for SK payload
IKE_CRYPTO_KEY *EncKeyI; // key for SK_ei (decrypt received)
IKE_CRYPTO_KEY *EncKeyR; // key for SK_er (encrypt sent)
// Original IKE_SA_INIT messages for AUTH
BUF *InitMsg; // IKE_SA_INIT request (from initiator)
BUF *RespMsg; // IKE_SA_INIT response (from us)
// Initiator identity from IKE_AUTH
UCHAR IDi_Type;
BUF *IDi_Data;
// Message ID tracking
UINT NextExpectedMsgId;
// Retransmission: cache last response
BUF *LastResponse;
UINT LastRespMsgId;
UINT64 LastRespTick;
UINT NumResends;
// Pointer to IKEv1 IKE_CLIENT created after AUTH
IKE_CLIENT *IkeClient;
};
typedef struct IKEv2_SA IKEv2_SA;
//// Function prototypes
void ProcIKEv2PacketRecv(IKE_SERVER *ike, UDPPACKET *p);
void ProcessIKEv2Interrupts(IKE_SERVER *ike);
IKEv2_SA *IKEv2NewSA(IKE_SERVER *ike);
void IKEv2FreeSA(IKE_SERVER *ike, IKEv2_SA *sa);
void IKEv2MarkDeleting(IKE_SERVER *ike, IKEv2_SA *sa);
void IKEv2PurgeDeleting(IKE_SERVER *ike);
IKEv2_SA *IKEv2FindByInitSPI(IKE_SERVER *ike, UINT64 init_spi, IP *client_ip, UINT client_port);
IKEv2_SA *IKEv2FindBySPIPair(IKE_SERVER *ike, UINT64 init_spi, UINT64 resp_spi);
int CmpIKEv2SA(void *p1, void *p2);
void IKEv2ProcSAInit(IKE_SERVER *ike, UDPPACKET *p, IKE_HEADER *hdr);
void IKEv2ProcAuth(IKE_SERVER *ike, UDPPACKET *p, IKE_HEADER *hdr, IKEv2_SA *sa,
void *payload_data, UINT payload_size);
void IKEv2ProcInformational(IKE_SERVER *ike, UDPPACKET *p, IKE_HEADER *hdr, IKEv2_SA *sa,
void *payload_data, UINT payload_size);
bool IKEv2DeriveKeys(IKE_SERVER *ike, IKEv2_SA *sa);
void IKEv2PRF(UINT prf_alg, void *key, UINT key_len,
void *data, UINT data_len, void *out);
void IKEv2PRFPlus(UINT prf_alg, void *key, UINT key_len,
void *seed, UINT seed_len, void *out, UINT out_len);
bool IKEv2VerifyAuth(IKE_SERVER *ike, IKEv2_SA *sa,
UCHAR auth_method, void *auth_data, UINT auth_len);
void IKEv2ComputeOurAuth(IKE_SERVER *ike, IKEv2_SA *sa, void *out, UINT *out_len);
bool IKEv2CreateChildSAForClient(IKE_SERVER *ike, IKEv2_SA *sa,
IKEv2_CHILDTF *ctf, UINT spi_i, UINT spi_r,
BUF *ni, BUF *nr);
bool IKEv2ParseSAProposalIKE(void *data, UINT size, IKEv2_IKETF *out);
bool IKEv2ParseSAProposalChild(void *data, UINT size, IKEv2_CHILDTF *out, UINT *out_spi_i);
UINT IKEv2BuildSAProposalIKE(IKEv2_SA *sa, void *buf, UINT buf_size);
UINT IKEv2BuildSAProposalChild(IKEv2_CHILDTF *ctf, UINT spi_r, void *buf, UINT buf_size);
void IKEv2SendResponse(IKE_SERVER *ike, IKEv2_SA *sa, IKE_HEADER *req_hdr,
UCHAR exchange_type, void *payloads, UINT payloads_size,
bool encrypt);
void IKEv2SendNotifyError(IKE_SERVER *ike, UDPPACKET *p, IKE_HEADER *hdr,
UINT64 resp_spi, USHORT notify_type);
BUF *IKEv2EncryptSK(IKE_SERVER *ike, IKEv2_SA *sa, UCHAR next_payload,
void *inner, UINT inner_size);
BUF *IKEv2DecryptSK(IKE_SERVER *ike, IKEv2_SA *sa, bool is_init_sending,
void *sk_data, UINT sk_size, UCHAR *out_next_payload);
UINT IKEv2PrfKeyLen(UINT prf_alg);
UINT IKEv2PrfOutLen(UINT prf_alg);
UINT IKEv2IntegKeyLen(UINT integ_alg);
UINT IKEv2IntegIcvLen(UINT integ_alg);
UINT IKEv2EncrKeyLen(UINT encr_alg, UINT requested);
UINT IKEv2EncrBlockSize(UINT encr_alg);
IKE_HASH *IKEv2GetHashForPrf(IKE_SERVER *ike, UINT prf_alg);
IKE_HASH *IKEv2GetHashForInteg(IKE_SERVER *ike, UINT integ_alg);
IKE_CRYPTO *IKEv2GetCrypto(IKE_SERVER *ike, UINT encr_alg);
IKE_DH *IKEv2GetDh(IKE_SERVER *ike, UINT dh_group);
#endif // PROTO_IKEV2_H
+9
View File
@@ -651,6 +651,15 @@ struct IKE_HEADER
#define IKE_EXCHANGE_TYPE_INFORMATION 5 // Information exchange #define IKE_EXCHANGE_TYPE_INFORMATION 5 // Information exchange
#define IKE_EXCHANGE_TYPE_QUICK 32 // Quick mode #define IKE_EXCHANGE_TYPE_QUICK 32 // Quick mode
// IKEv2 version identifier (in the Version field of IKE_HEADER)
#define IKEv2_VERSION 0x20 // 2.0
// IKEv2 exchange types (RFC 7296)
#define IKEv2_EXCHANGE_IKE_SA_INIT 34
#define IKEv2_EXCHANGE_IKE_AUTH 35
#define IKEv2_EXCHANGE_CREATE_CHILD_SA 36
#define IKEv2_EXCHANGE_INFORMATIONAL 37
// DHCPv4 data // DHCPv4 data
struct DHCPV4_DATA struct DHCPV4_DATA
{ {