mirror of
https://github.com/open-quantum-safe/liboqs.git
synced 2025-10-04 00:02:01 -04:00
Icicle-pqc integration (#2216)
* correct build Signed-off-by: nonam3e <timur@ingonyama.com> * use interface to link Signed-off-by: nonam3e <timur@ingonyama.com> * remove load backends Signed-off-by: nonam3e <timur@ingonyama.com> * liboqs 0.14.0 release candidate 1 (#2180) * Prepare 0.14.0 release candidate 1 [full tests] [extended tests] Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca> * Update release notes with deprecation and security info [skip ci] Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca> --------- Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca> Signed-off-by: nonam3e <timur@ingonyama.com> * add icicle in scripts Signed-off-by: nonam3e <timur@ingonyama.com> * update docs Signed-off-by: nonam3e <timur@ingonyama.com> * add link Signed-off-by: nonam3e <timur@ingonyama.com> * build with local package Signed-off-by: nonam3e <timur@ingonyama.com> * update scripts Signed-off-by: nonam3e <timur@ingonyama.com> * choose alg -DOQS_ENABLE_KEM_ml_kem_512_icicle_cuda=ON -DOQS_ENABLE_KEM_ml_kem_768_icicle_cuda=OFF Signed-off-by: nonam3e <timur@ingonyama.com> * docs Signed-off-by: nonam3e <timur@ingonyama.com> * OQS_STATUS return type Signed-off-by: nonam3e <timur@ingonyama.com> * Document public / internal API split [skip ci] (#2182) Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca> Signed-off-by: nonam3e <timur@ingonyama.com> * liboqs 0.14.0 release (#2198) Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca> Signed-off-by: nonam3e <timur@ingonyama.com> * manual build Signed-off-by: nonam3e <timur@ingonyama.com> * remove tmp Signed-off-by: nonam3e <timur@ingonyama.com> * build statically with target_link_libraries Signed-off-by: nonam3e <timur@ingonyama.com> * Switch to dev mode for 0.14.1 (#2199) Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca> Signed-off-by: nonam3e <timur@ingonyama.com> * update ACVP to 1.1.0.40 (#2172) Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com> Signed-off-by: nonam3e <timur@ingonyama.com> * Added Custom Timeout to CI (#2189) * Added Custom Timeout to CI Signed-off-by: Konstantinos <konstantinos.kitsios@uzh.ch> * remove unnecessary comment Signed-off-by: Konstantinos <konstantinos.kitsios@uzh.ch> * Use correct syntax for timeout in jobs that span multiple files Signed-off-by: Konstantinos <konstantinos.kitsios@uzh.ch> --------- Signed-off-by: Konstantinos <konstantinos.kitsios@uzh.ch> Signed-off-by: nonam3e <timur@ingonyama.com> * Update nixpkgs from 24.05 to 25.05 (#2187) Signed-off-by: Aiden Fox Ivey <aiden@aidenfoxivey.com> Signed-off-by: nonam3e <timur@ingonyama.com> * update commit Signed-off-by: nonam3e <timur@ingonyama.com> * icicle pqc package cmd in CONFIGURE.md Signed-off-by: nonam3e <timur@ingonyama.com> * remove unnecessary targets from cmake config Signed-off-by: nonam3e <timur@ingonyama.com> * add SPDX-License-Identifier header Signed-off-by: nonam3e <timur@ingonyama.com> --------- Signed-off-by: nonam3e <timur@ingonyama.com> Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca> Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca> Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com> Signed-off-by: Konstantinos <konstantinos.kitsios@uzh.ch> Signed-off-by: Aiden Fox Ivey <aiden@aidenfoxivey.com> Co-authored-by: Spencer Wilson <spencer.wilson@uwaterloo.ca> Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com> Co-authored-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com> Co-authored-by: Kitsios Konstantinos <kitsios.konst@gmail.com> Co-authored-by: Aiden Fox Ivey <aiden@aidenfoxivey.com>
This commit is contained in:
parent
bee7e6b922
commit
16b8629972
@ -33,6 +33,8 @@ function(filter_algs alglist)
|
||||
string(REPLACE "_avx" "" _var_base ${_var_base})
|
||||
string(REPLACE "_x86_64" "" _var_base ${_var_base})
|
||||
string(REPLACE "_aarch64" "" _var_base ${_var_base})
|
||||
string(REPLACE "_icicle_cuda" "" _var_base ${_var_base})
|
||||
string(REPLACE "_cuda" "" _var_base ${_var_base})
|
||||
foreach (_alg ${ARGV0})
|
||||
if(${_var}_AVAILABLE)
|
||||
if(${_var_base}X STREQUAL ${_alg}X)
|
||||
@ -547,6 +549,12 @@ if(OQS_USE_CUPQC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
|
||||
if(OQS_USE_ICICLE)
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_512_icicle_cuda "" ON "OQS_ENABLE_KEM_ml_kem_512" OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
|
||||
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_768_x86_64 "" ON "OQS_ENABLE_KEM_ml_kem_768" OFF)
|
||||
@ -567,6 +575,12 @@ if(OQS_USE_CUPQC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
|
||||
if(OQS_USE_ICICLE)
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_768_icicle_cuda "" ON "OQS_ENABLE_KEM_ml_kem_768" OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
|
||||
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_1024_x86_64 "" ON "OQS_ENABLE_KEM_ml_kem_1024" OFF)
|
||||
@ -587,6 +601,12 @@ if(OQS_USE_CUPQC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
|
||||
if(OQS_USE_ICICLE)
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda "" ON "OQS_ENABLE_KEM_ml_kem_1024" OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
|
||||
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
|
||||
|
@ -28,6 +28,7 @@ option(OQS_PERMIT_UNSUPPORTED_ARCHITECTURE "Permit compilation on an an unsuppor
|
||||
option(OQS_STRICT_WARNINGS "Enable all compiler warnings." OFF)
|
||||
option(OQS_EMBEDDED_BUILD "Compile liboqs for an Embedded environment without a full standard library." OFF)
|
||||
option(OQS_USE_CUPQC "Utilize cuPQC as the backend for supported PQC algorithms." OFF)
|
||||
option(OQS_USE_ICICLE "Utilize ICICLE as the backend for supported PQC algorithms." OFF)
|
||||
|
||||
# Libfuzzer isn't supported on gcc
|
||||
if('${CMAKE_C_COMPILER_ID}' STREQUAL 'Clang')
|
||||
@ -151,6 +152,15 @@ if(${OQS_USE_CUPQC})
|
||||
find_package(cuPQC 0.2.0 REQUIRED)
|
||||
endif()
|
||||
|
||||
if(OQS_USE_ICICLE)
|
||||
enable_language(CXX)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(icicle_pqc_package REQUIRED)
|
||||
endif()
|
||||
|
||||
|
||||
if (NOT ((CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") AND (ARCH_X86_64 STREQUAL "ON")) AND (OQS_LIBJADE_BUILD STREQUAL "ON"))
|
||||
message(FATAL_ERROR "Building liboqs with libjade implementations from libjade is only supported on Linux and Darwin on x86_64.")
|
||||
endif()
|
||||
|
27
CONFIGURE.md
27
CONFIGURE.md
@ -14,6 +14,7 @@ The following options can be passed to CMake before the build file generation pr
|
||||
- [OQS_USE_CPUFEATURE_INSTRUCTIONS](#OQS_USE_CPUFEATURE_INSTRUCTIONS)
|
||||
- [OQS_USE_OPENSSL](#OQS_USE_OPENSSL)
|
||||
- [OQS_USE_CUPQC](#OQS_USE_CUPQC)
|
||||
- [OQS_USE_ICICLE](#OQS_USE_ICICLE)
|
||||
- [OQS_OPT_TARGET](#OQS_OPT_TARGET)
|
||||
- [OQS_SPEED_USE_ARM_PMU](#OQS_SPEED_USE_ARM_PMU)
|
||||
- [USE_COVERAGE](#USE_COVERAGE)
|
||||
@ -134,6 +135,32 @@ Can be `ON` or `OFF`. When `ON`, use NVIDIA's cuPQC library where able (current
|
||||
|
||||
**Default**: `OFF`
|
||||
|
||||
### OQS_USE_ICICLE
|
||||
|
||||
This CMake option can be set to `ON` or `OFF`. When enabled (`ON`), it configures liboqs to use ICICLE as the backend for supported post-quantum cryptographic (PQC) algorithms — currently ML-KEM.
|
||||
ICICLE is a GPU-accelerated cryptographic library developed by Ingonyama. It provides CUDA-based implementations of PQC algorithms to boost the performance on systems with compatible NVIDIA GPUs.
|
||||
To use ICICLE, the user needs to build and install the `icicle_pqc_package`, which contains the necessary CUDA kernels and runtime support. This package must be compiled separately before configuring liboqs with `OQS_USE_ICICLE` enabled, and its installation path should be made available to CMake.
|
||||
|
||||
Enabling this option also automatically enables C++ support in CMake, as required by ICICLE’s implementations.
|
||||
|
||||
To build ICICLE with the required PQC package:
|
||||
|
||||
```bash
|
||||
cmake -S icicle -B "$BUILD_DIR" \
|
||||
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
||||
-DCPU_BACKEND=OFF \
|
||||
-DDISABLE_ALL_FEATURES=ON \
|
||||
-DPQC=ON \
|
||||
-DCUDA_PQC_BACKEND=ON \
|
||||
-DICICLE_STATIC_LINK=ON \
|
||||
-DPQC_PACKAGE=ON
|
||||
cmake --build "$BUILD_DIR"
|
||||
cmake --install "$BUILD_DIR"
|
||||
```
|
||||
|
||||
For full documentation, setup instructions, and backend support details, see the [Ingonyama documentation](https://dev.ingonyama.com/)
|
||||
|
||||
**Default**: `OFF`.
|
||||
|
||||
## Stateful Hash Based Signatures
|
||||
|
||||
|
@ -13,6 +13,9 @@
|
||||
- **cupqc-cuda**:<a name="cupqc-cuda"></a>
|
||||
- **Source**: https://github.com/open-quantum-safe/liboqs-cupqc-meta/commit/b026f4e5475cd9c20c2082c7d9bad80e5b0ba89e
|
||||
- **Implementation license (SPDX-Identifier)**: Apache-2.0
|
||||
- **icicle-icicle_cuda**:<a name="icicle-icicle_cuda"></a>
|
||||
- **Source**: https://github.com/ingonyama-zk/icicle-liboqs/commit/8f215fd845928abfc2bb7d5ca15db76b839bee5c
|
||||
- **Implementation license (SPDX-Identifier)**: MIT
|
||||
|
||||
|
||||
## Parameter set summary
|
||||
|
@ -23,6 +23,9 @@ optimized-upstreams:
|
||||
cupqc-cuda:
|
||||
source: https://github.com/open-quantum-safe/liboqs-cupqc-meta/commit/b026f4e5475cd9c20c2082c7d9bad80e5b0ba89e
|
||||
spdx-license-identifier: Apache-2.0
|
||||
icicle-icicle_cuda:
|
||||
source: https://github.com/ingonyama-zk/icicle-liboqs/commit/8f215fd845928abfc2bb7d5ca15db76b839bee5c
|
||||
spdx-license-identifier: MIT
|
||||
parameter-sets:
|
||||
- name: ML-KEM-512
|
||||
claimed-nist-level: 1
|
||||
|
@ -16,12 +16,22 @@ endif()
|
||||
{%- for platform in impl['supported_platforms'] if platform['architecture'] == 'CUDA' %}
|
||||
{% if platform['operating_systems'] %}if(CMAKE_SYSTEM_NAME MATCHES "{{ platform['operating_systems']|join('|') }}")
|
||||
{% endif -%}
|
||||
{% if impl['name'] == 'cuda' -%}
|
||||
if(OQS_USE_CUPQC)
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['scheme'] }}_{{ impl['name'] }} "" ON "OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['scheme'] }}" OFF)
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['scheme'] }}_{{ impl['name'] }} "" ON "OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['scheme'] }}" OFF)
|
||||
{%- if 'alias_scheme' in scheme %}
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }} "" ON "OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['alias_scheme'] }}" OFF)
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }} "" ON "OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['alias_scheme'] }}" OFF)
|
||||
{%- endif %}
|
||||
endif()
|
||||
{% endif %}
|
||||
{%- if impl['name'] == 'icicle_cuda' -%}
|
||||
if(OQS_USE_ICICLE)
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_{{ family.name }}_{{ scheme.scheme }}_{{ impl.name }} "" ON "OQS_ENABLE_KEM_{{ family.name }}_{{ scheme.scheme }}" OFF)
|
||||
{%- if scheme.alias_scheme is defined -%}
|
||||
cmake_dependent_option(OQS_ENABLE_KEM_{{ family.name }}_{{ scheme.alias_scheme }}_{{ impl.name }} "" ON "OQS_ENABLE_KEM_{{ family.name }}_{{ scheme.alias_scheme }}" OFF)
|
||||
{%- endif %}
|
||||
endif()
|
||||
{% endif -%}
|
||||
{% if platform['operating_systems'] %}endif()
|
||||
{% endif -%}
|
||||
{%- endfor -%}
|
||||
|
@ -46,6 +46,14 @@ upstreams:
|
||||
kem_meta_path: '{pretty_name_full}_META.yml'
|
||||
kem_scheme_path: '.'
|
||||
patches: []
|
||||
-
|
||||
name: icicle
|
||||
git_url: https://github.com/ingonyama-zk/icicle-liboqs.git
|
||||
git_branch: main
|
||||
git_commit: 8f215fd845928abfc2bb7d5ca15db76b839bee5c
|
||||
kem_meta_path: '{pretty_name_full}_META.yml'
|
||||
kem_scheme_path: '.'
|
||||
patches: []
|
||||
-
|
||||
name: pqcrystals-dilithium
|
||||
git_url: https://github.com/pq-crystals/dilithium.git
|
||||
@ -191,8 +199,10 @@ kems:
|
||||
default_implementation: ref
|
||||
arch_specific_implementations:
|
||||
cuda: cuda
|
||||
icicle_cuda: icicle_cuda
|
||||
arch_specific_upstream_locations:
|
||||
cuda: cupqc
|
||||
icicle_cuda: icicle
|
||||
upstream_location: mlkem-native
|
||||
derandomized_keypair: true
|
||||
schemes:
|
||||
|
@ -40,12 +40,18 @@ if(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme_c'] }}_{{ impl['name'] }}{%- if
|
||||
target_link_libraries({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} cupqc)
|
||||
set_property(TARGET {{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} PROPERTY CUDA_ARCHITECTURES OFF)
|
||||
target_compile_options({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} PRIVATE {{ impl['compile_opts'] }})
|
||||
|
||||
{%- elif impl['name'] == 'icicle_cuda' %}
|
||||
|
||||
if(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme_c'] }}_{{ impl['name'] }}{%- if 'alias_scheme' in scheme %} OR OQS_ENABLE_KEM_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}{%- endif %})
|
||||
add_library({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} OBJECT icicle_{{ scheme['pqclean_scheme'] }}_{{ impl['name'] }}/icicle_ml-kem.cpp)
|
||||
target_link_libraries({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} PRIVATE icicle::icicle_pqc_package)
|
||||
{%- else %}
|
||||
|
||||
if(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme_c'] }}_{{ impl['name'] }}{%- if 'alias_scheme' in scheme %} OR OQS_ENABLE_KEM_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}{%- endif %})
|
||||
add_library({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} OBJECT {% for source_file in impl['sources']|sort -%}{{ impl['upstream']['name'] }}_{{ scheme['pqclean_scheme'] }}_{{ impl['name'] }}/{{ source_file }}{%- if not loop.last %} {% endif -%}{%- endfor -%})
|
||||
{%- endif %}
|
||||
{%- if impl['name'] != 'cuda' %}
|
||||
{%- if impl['name'] != 'cuda' and impl['name'] != 'icicle_cuda' %}
|
||||
target_include_directories({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/{{ impl['upstream']['name'] }}_{{ scheme['pqclean_scheme'] }}_{{ impl['name'] }})
|
||||
target_include_directories({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
|
||||
{%- if impl['name'] != scheme['default_implementation'] and impl['required_flags'] -%}
|
||||
|
@ -105,6 +105,9 @@ extern int {{ scheme['metadata']['default_dec_signature'] }}(uint8_t *ss, const
|
||||
{% if impl['name'] == 'cuda'%}
|
||||
#if defined(OQS_USE_CUPQC)
|
||||
{%- endif %}
|
||||
{%- if impl['name'] == 'icicle_cuda'%}
|
||||
#if defined(OQS_USE_ICICLE)
|
||||
{%- endif %}
|
||||
#if defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}){%- endif %}
|
||||
{%- if impl['signature_keypair'] %}
|
||||
extern int {{ impl['signature_keypair'] }}(uint8_t *pk, uint8_t *sk);
|
||||
@ -131,6 +134,9 @@ extern int PQCLEAN_{{ scheme['pqclean_scheme_c']|upper }}_{{ impl['name']|upper
|
||||
{%- if impl['name'] == 'cuda'%}
|
||||
#endif /* OQS_USE_CUPQC */
|
||||
{%- endif %}
|
||||
{%- if impl['name'] == 'icicle_cuda'%}
|
||||
#endif /* OQS_USE_ICICLE */
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
{%- if libjade_implementation is defined and scheme['libjade_implementation'] %}
|
||||
@ -230,7 +236,12 @@ OQS_API OQS_STATUS OQS_KEM_{{ family }}_{{ scheme['scheme'] }}_keypair(uint8_t *
|
||||
return (OQS_STATUS) {{ impl['signature_keypair'] }}(public_key, secret_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} */
|
||||
{%- endfor %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if (impl['name'] != scheme['default_implementation'] and impl['name'] != 'cuda') %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if impl['name'] == 'icicle_cuda' %}
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }})
|
||||
return (OQS_STATUS) {{ impl['signature_keypair'] }}(public_key, secret_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} */
|
||||
{%- endfor %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if (impl['name'] != scheme['default_implementation'] and impl['name'] != 'cuda' and impl['name'] != 'icicle_cuda') %}
|
||||
{%- if loop.first %}
|
||||
#if defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}){%- endif %}
|
||||
{%- else %}
|
||||
@ -309,7 +320,12 @@ OQS_API OQS_STATUS OQS_KEM_{{ family }}_{{ scheme['scheme'] }}_encaps(uint8_t *c
|
||||
return (OQS_STATUS) {{ impl['signature_enc'] }}(ciphertext, shared_secret, public_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} */
|
||||
{%- endfor %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if (impl['name'] != scheme['default_implementation'] and impl['name'] != 'cuda') %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if impl['name'] == 'icicle_cuda' %}
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }})
|
||||
return (OQS_STATUS) {{ impl['signature_enc'] }}(ciphertext, shared_secret, public_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} */
|
||||
{%- endfor %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if (impl['name'] != scheme['default_implementation'] and impl['name'] != 'cuda' and impl['name'] != 'icicle_cuda') %}
|
||||
{%- if loop.first %}
|
||||
#if defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}){%- endif %}
|
||||
{%- else %}
|
||||
@ -388,7 +404,12 @@ OQS_API OQS_STATUS OQS_KEM_{{ family }}_{{ scheme['scheme'] }}_decaps(uint8_t *s
|
||||
return (OQS_STATUS) {{ impl['signature_dec'] }}(shared_secret, ciphertext, secret_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} */
|
||||
{%- endfor %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if (impl['name'] != scheme['default_implementation'] and impl['name'] != 'cuda') %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if impl['name'] == 'icicle_cuda' %}
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }})
|
||||
return (OQS_STATUS) {{ impl['signature_dec'] }}(shared_secret, ciphertext, secret_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} */
|
||||
{%- endfor %}
|
||||
{%- for impl in scheme['metadata']['implementations'] if (impl['name'] != scheme['default_implementation'] and impl['name'] != 'cuda' and impl['name'] != 'icicle_cuda') %}
|
||||
{%- if loop.first %}
|
||||
#if defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}){%- endif %}
|
||||
{%- else %}
|
||||
|
@ -117,6 +117,9 @@ if(${OQS_USE_CUPQC})
|
||||
target_link_libraries(oqs PRIVATE cupqc)
|
||||
target_link_options(oqs PRIVATE $<DEVICE_LINK: -dlto>)
|
||||
endif()
|
||||
if(${OQS_USE_ICICLE})
|
||||
target_link_libraries(oqs PRIVATE icicle::icicle_pqc_package)
|
||||
endif()
|
||||
|
||||
target_include_directories(oqs
|
||||
PUBLIC
|
||||
|
@ -39,6 +39,12 @@ if(OQS_ENABLE_KEM_ml_kem_512_cuda)
|
||||
set(_ML_KEM_OBJS ${_ML_KEM_OBJS} $<TARGET_OBJECTS:ml_kem_512_cuda>)
|
||||
endif()
|
||||
|
||||
if(OQS_ENABLE_KEM_ml_kem_512_icicle_cuda)
|
||||
add_library(ml_kem_512_icicle_cuda OBJECT icicle_ml-kem-512_icicle_cuda/icicle_ml-kem.cpp)
|
||||
target_link_libraries(ml_kem_512_icicle_cuda PRIVATE icicle::icicle_pqc_package)
|
||||
set(_ML_KEM_OBJS ${_ML_KEM_OBJS} $<TARGET_OBJECTS:ml_kem_512_icicle_cuda>)
|
||||
endif()
|
||||
|
||||
if(OQS_ENABLE_KEM_ml_kem_768)
|
||||
add_library(ml_kem_768_ref OBJECT kem_ml_kem_768.c mlkem-native_ml-kem-768_ref/mlkem/src/compress.c mlkem-native_ml-kem-768_ref/mlkem/src/debug.c mlkem-native_ml-kem-768_ref/mlkem/src/indcpa.c mlkem-native_ml-kem-768_ref/mlkem/src/kem.c mlkem-native_ml-kem-768_ref/mlkem/src/poly.c mlkem-native_ml-kem-768_ref/mlkem/src/poly_k.c mlkem-native_ml-kem-768_ref/mlkem/src/sampling.c mlkem-native_ml-kem-768_ref/mlkem/src/verify.c)
|
||||
target_compile_options(ml_kem_768_ref PUBLIC -DMLK_CONFIG_PARAMETER_SET=768 -DMLK_CONFIG_FILE="../../integration/liboqs/config_c.h")
|
||||
@ -73,6 +79,12 @@ if(OQS_ENABLE_KEM_ml_kem_768_cuda)
|
||||
set(_ML_KEM_OBJS ${_ML_KEM_OBJS} $<TARGET_OBJECTS:ml_kem_768_cuda>)
|
||||
endif()
|
||||
|
||||
if(OQS_ENABLE_KEM_ml_kem_768_icicle_cuda)
|
||||
add_library(ml_kem_768_icicle_cuda OBJECT icicle_ml-kem-768_icicle_cuda/icicle_ml-kem.cpp)
|
||||
target_link_libraries(ml_kem_768_icicle_cuda PRIVATE icicle::icicle_pqc_package)
|
||||
set(_ML_KEM_OBJS ${_ML_KEM_OBJS} $<TARGET_OBJECTS:ml_kem_768_icicle_cuda>)
|
||||
endif()
|
||||
|
||||
if(OQS_ENABLE_KEM_ml_kem_1024)
|
||||
add_library(ml_kem_1024_ref OBJECT kem_ml_kem_1024.c mlkem-native_ml-kem-1024_ref/mlkem/src/compress.c mlkem-native_ml-kem-1024_ref/mlkem/src/debug.c mlkem-native_ml-kem-1024_ref/mlkem/src/indcpa.c mlkem-native_ml-kem-1024_ref/mlkem/src/kem.c mlkem-native_ml-kem-1024_ref/mlkem/src/poly.c mlkem-native_ml-kem-1024_ref/mlkem/src/poly_k.c mlkem-native_ml-kem-1024_ref/mlkem/src/sampling.c mlkem-native_ml-kem-1024_ref/mlkem/src/verify.c)
|
||||
target_compile_options(ml_kem_1024_ref PUBLIC -DMLK_CONFIG_PARAMETER_SET=1024 -DMLK_CONFIG_FILE="../../integration/liboqs/config_c.h")
|
||||
@ -107,4 +119,10 @@ if(OQS_ENABLE_KEM_ml_kem_1024_cuda)
|
||||
set(_ML_KEM_OBJS ${_ML_KEM_OBJS} $<TARGET_OBJECTS:ml_kem_1024_cuda>)
|
||||
endif()
|
||||
|
||||
if(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda)
|
||||
add_library(ml_kem_1024_icicle_cuda OBJECT icicle_ml-kem-1024_icicle_cuda/icicle_ml-kem.cpp)
|
||||
target_link_libraries(ml_kem_1024_icicle_cuda PRIVATE icicle::icicle_pqc_package)
|
||||
set(_ML_KEM_OBJS ${_ML_KEM_OBJS} $<TARGET_OBJECTS:ml_kem_1024_icicle_cuda>)
|
||||
endif()
|
||||
|
||||
set(ML_KEM_OBJS ${_ML_KEM_OBJS} PARENT_SCOPE)
|
||||
|
@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdint.h>
|
||||
#include <oqs/rand.h>
|
||||
#include "icicle/pqc/ml_kem.h"
|
||||
#include "icicle/runtime.h"
|
||||
#include "icicle/device.h"
|
||||
#include "icicle/errors.h"
|
||||
|
||||
extern "C" {
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda)
|
||||
OQS_STATUS icicle_ml_kem_1024_keypair(uint8_t *pk, uint8_t *sk) {
|
||||
uint8_t coins[icicle::pqc::ml_kem::ENTROPY_BYTES];
|
||||
OQS_randombytes(coins, icicle::pqc::ml_kem::ENTROPY_BYTES);
|
||||
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::keygen<icicle::pqc::ml_kem::Kyber1024Params>((std::byte*)coins, config, (std::byte*)pk, (std::byte*)sk) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
|
||||
OQS_STATUS icicle_ml_kem_1024_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
|
||||
uint8_t coins[icicle::pqc::ml_kem::MESSAGE_BYTES];
|
||||
OQS_randombytes(coins, icicle::pqc::ml_kem::MESSAGE_BYTES);
|
||||
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::encapsulate<icicle::pqc::ml_kem::Kyber1024Params>((std::byte*)coins, (std::byte*)pk, config, (std::byte*)ct, (std::byte*)ss) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
|
||||
OQS_STATUS icicle_ml_kem_1024_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::decapsulate<icicle::pqc::ml_kem::Kyber1024Params>((std::byte*)sk, (std::byte*)ct, config, (std::byte*)ss) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
#endif
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdint.h>
|
||||
#include <oqs/rand.h>
|
||||
#include "icicle/pqc/ml_kem.h"
|
||||
#include "icicle/runtime.h"
|
||||
#include "icicle/device.h"
|
||||
#include "icicle/errors.h"
|
||||
|
||||
extern "C" {
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_512_icicle_cuda)
|
||||
OQS_STATUS icicle_ml_kem_512_keypair(uint8_t *pk, uint8_t *sk) {
|
||||
uint8_t coins[icicle::pqc::ml_kem::ENTROPY_BYTES];
|
||||
OQS_randombytes(coins, icicle::pqc::ml_kem::ENTROPY_BYTES);
|
||||
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::keygen<icicle::pqc::ml_kem::Kyber512Params>((std::byte*)coins, config, (std::byte*)pk, (std::byte*)sk) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
|
||||
OQS_STATUS icicle_ml_kem_512_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
|
||||
uint8_t coins[icicle::pqc::ml_kem::MESSAGE_BYTES];
|
||||
OQS_randombytes(coins, icicle::pqc::ml_kem::MESSAGE_BYTES);
|
||||
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::encapsulate<icicle::pqc::ml_kem::Kyber512Params>((std::byte*)coins, (std::byte*)pk, config, (std::byte*)ct, (std::byte*)ss) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
|
||||
OQS_STATUS icicle_ml_kem_512_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::decapsulate<icicle::pqc::ml_kem::Kyber512Params>((std::byte*)sk, (std::byte*)ct, config, (std::byte*)ss) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
#endif
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdint.h>
|
||||
#include <oqs/rand.h>
|
||||
#include "icicle/pqc/ml_kem.h"
|
||||
#include "icicle/runtime.h"
|
||||
#include "icicle/device.h"
|
||||
#include "icicle/errors.h"
|
||||
|
||||
extern "C" {
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda)
|
||||
OQS_STATUS icicle_ml_kem_1024_keypair(uint8_t *pk, uint8_t *sk) {
|
||||
uint8_t coins[icicle::pqc::ml_kem::ENTROPY_BYTES];
|
||||
OQS_randombytes(coins, icicle::pqc::ml_kem::ENTROPY_BYTES);
|
||||
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::keygen<icicle::pqc::ml_kem::Kyber1024Params>((std::byte*)coins, config, (std::byte*)pk, (std::byte*)sk) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
|
||||
OQS_STATUS icicle_ml_kem_1024_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
|
||||
uint8_t coins[icicle::pqc::ml_kem::MESSAGE_BYTES];
|
||||
OQS_randombytes(coins, icicle::pqc::ml_kem::MESSAGE_BYTES);
|
||||
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::encapsulate<icicle::pqc::ml_kem::Kyber1024Params>((std::byte*)coins, (std::byte*)pk, config, (std::byte*)ct, (std::byte*)ss) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
|
||||
OQS_STATUS icicle_ml_kem_1024_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
|
||||
icicle::pqc::ml_kem::MlKemConfig config;
|
||||
return icicle::pqc::ml_kem::decapsulate<icicle::pqc::ml_kem::Kyber1024Params>((std::byte*)sk, (std::byte*)ct, config, (std::byte*)ss) == icicle::eIcicleError::SUCCESS ? OQS_SUCCESS : OQS_ERROR;
|
||||
}
|
||||
#endif
|
||||
}
|
@ -59,6 +59,14 @@ extern int cupqc_ml_kem_1024_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *
|
||||
#endif
|
||||
#endif /* OQS_USE_CUPQC */
|
||||
|
||||
#if defined(OQS_USE_ICICLE)
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda)
|
||||
extern int icicle_ml_kem_1024_keypair(uint8_t *pk, uint8_t *sk);
|
||||
extern int icicle_ml_kem_1024_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
extern int icicle_ml_kem_1024_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
#endif
|
||||
#endif /* OQS_USE_ICICLE */
|
||||
|
||||
OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_1024_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
@ -82,6 +90,8 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_keypair_derand(uint8_t *public_key, uint8
|
||||
#endif /* OQS_DIST_BUILD */
|
||||
#elif defined(OQS_ENABLE_KEM_ml_kem_1024_cuda)
|
||||
return (OQS_STATUS) PQCLEAN_MLKEM1024_CUDA_crypto_kem_keypair_derand(public_key, secret_key, seed);
|
||||
#elif defined(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda)
|
||||
return (OQS_STATUS) PQCLEAN_MLKEM1024_ICICLE_CUDA_crypto_kem_keypair_derand(public_key, secret_key, seed);
|
||||
#else
|
||||
return (OQS_STATUS) PQCP_MLKEM_NATIVE_MLKEM1024_C_keypair_derand(public_key, secret_key, seed);
|
||||
#endif
|
||||
@ -91,6 +101,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_keypair(uint8_t *public_key, uint8_t *sec
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_1024_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_1024_keypair(public_key, secret_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_1024_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_1024_keypair(public_key, secret_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_1024_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
@ -120,6 +133,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_encaps(uint8_t *ciphertext, uint8_t *shar
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_1024_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_1024_enc(ciphertext, shared_secret, public_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_1024_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_1024_enc(ciphertext, shared_secret, public_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_1024_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
@ -149,6 +165,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_1024_decaps(uint8_t *shared_secret, const uint
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_1024_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_1024_dec(shared_secret, ciphertext, secret_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_1024_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_1024_dec(shared_secret, ciphertext, secret_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_1024_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
|
@ -59,6 +59,14 @@ extern int cupqc_ml_kem_512_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *s
|
||||
#endif
|
||||
#endif /* OQS_USE_CUPQC */
|
||||
|
||||
#if defined(OQS_USE_ICICLE)
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_512_icicle_cuda)
|
||||
extern int icicle_ml_kem_512_keypair(uint8_t *pk, uint8_t *sk);
|
||||
extern int icicle_ml_kem_512_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
extern int icicle_ml_kem_512_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
#endif
|
||||
#endif /* OQS_USE_ICICLE */
|
||||
|
||||
OQS_API OQS_STATUS OQS_KEM_ml_kem_512_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_512_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
@ -82,6 +90,8 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_512_keypair_derand(uint8_t *public_key, uint8_
|
||||
#endif /* OQS_DIST_BUILD */
|
||||
#elif defined(OQS_ENABLE_KEM_ml_kem_512_cuda)
|
||||
return (OQS_STATUS) PQCLEAN_MLKEM512_CUDA_crypto_kem_keypair_derand(public_key, secret_key, seed);
|
||||
#elif defined(OQS_ENABLE_KEM_ml_kem_512_icicle_cuda)
|
||||
return (OQS_STATUS) PQCLEAN_MLKEM512_ICICLE_CUDA_crypto_kem_keypair_derand(public_key, secret_key, seed);
|
||||
#else
|
||||
return (OQS_STATUS) PQCP_MLKEM_NATIVE_MLKEM512_C_keypair_derand(public_key, secret_key, seed);
|
||||
#endif
|
||||
@ -91,6 +101,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_512_keypair(uint8_t *public_key, uint8_t *secr
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_512_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_512_keypair(public_key, secret_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_512_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_512_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_512_keypair(public_key, secret_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_512_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_512_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
@ -120,6 +133,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_512_encaps(uint8_t *ciphertext, uint8_t *share
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_512_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_512_enc(ciphertext, shared_secret, public_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_512_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_512_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_512_enc(ciphertext, shared_secret, public_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_512_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_512_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
@ -149,6 +165,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_512_decaps(uint8_t *shared_secret, const uint8
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_512_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_512_dec(shared_secret, ciphertext, secret_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_512_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_512_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_512_dec(shared_secret, ciphertext, secret_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_512_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_512_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
|
@ -59,6 +59,14 @@ extern int cupqc_ml_kem_768_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *s
|
||||
#endif
|
||||
#endif /* OQS_USE_CUPQC */
|
||||
|
||||
#if defined(OQS_USE_ICICLE)
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_768_icicle_cuda)
|
||||
extern int icicle_ml_kem_768_keypair(uint8_t *pk, uint8_t *sk);
|
||||
extern int icicle_ml_kem_768_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
|
||||
extern int icicle_ml_kem_768_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
|
||||
#endif
|
||||
#endif /* OQS_USE_ICICLE */
|
||||
|
||||
OQS_API OQS_STATUS OQS_KEM_ml_kem_768_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_768_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
@ -82,6 +90,8 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_768_keypair_derand(uint8_t *public_key, uint8_
|
||||
#endif /* OQS_DIST_BUILD */
|
||||
#elif defined(OQS_ENABLE_KEM_ml_kem_768_cuda)
|
||||
return (OQS_STATUS) PQCLEAN_MLKEM768_CUDA_crypto_kem_keypair_derand(public_key, secret_key, seed);
|
||||
#elif defined(OQS_ENABLE_KEM_ml_kem_768_icicle_cuda)
|
||||
return (OQS_STATUS) PQCLEAN_MLKEM768_ICICLE_CUDA_crypto_kem_keypair_derand(public_key, secret_key, seed);
|
||||
#else
|
||||
return (OQS_STATUS) PQCP_MLKEM_NATIVE_MLKEM768_C_keypair_derand(public_key, secret_key, seed);
|
||||
#endif
|
||||
@ -91,6 +101,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_768_keypair(uint8_t *public_key, uint8_t *secr
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_768_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_768_keypair(public_key, secret_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_768_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_768_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_768_keypair(public_key, secret_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_768_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_768_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
@ -120,6 +133,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_768_encaps(uint8_t *ciphertext, uint8_t *share
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_768_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_768_enc(ciphertext, shared_secret, public_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_768_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_768_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_768_enc(ciphertext, shared_secret, public_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_768_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_768_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
@ -149,6 +165,9 @@ OQS_API OQS_STATUS OQS_KEM_ml_kem_768_decaps(uint8_t *shared_secret, const uint8
|
||||
#if defined(OQS_USE_CUPQC) && defined(OQS_ENABLE_KEM_ml_kem_768_cuda)
|
||||
return (OQS_STATUS) cupqc_ml_kem_768_dec(shared_secret, ciphertext, secret_key);
|
||||
#endif /* OQS_USE_CUPQC && OQS_ENABLE_KEM_ml_kem_768_cuda */
|
||||
#if defined(OQS_USE_ICICLE) && defined(OQS_ENABLE_KEM_ml_kem_768_icicle_cuda)
|
||||
return (OQS_STATUS) icicle_ml_kem_768_dec(shared_secret, ciphertext, secret_key);
|
||||
#endif /* OQS_USE_ICICLE && OQS_ENABLE_KEM_ml_kem_768_icicle_cuda */
|
||||
#if defined(OQS_ENABLE_KEM_ml_kem_768_x86_64)
|
||||
#if defined(OQS_DIST_BUILD)
|
||||
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
|
||||
|
@ -72,6 +72,7 @@
|
||||
#cmakedefine OQS_USE_SHA3_AVX512VL 1
|
||||
|
||||
#cmakedefine01 OQS_USE_CUPQC
|
||||
#cmakedefine01 OQS_USE_ICICLE
|
||||
|
||||
#cmakedefine OQS_ENABLE_KEM_BIKE 1
|
||||
#cmakedefine OQS_ENABLE_KEM_bike_l1 1
|
||||
@ -135,14 +136,17 @@
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_512_x86_64 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_512_aarch64 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_512_cuda 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_512_icicle_cuda 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_768 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_768_x86_64 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_768_aarch64 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_768_cuda 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_768_icicle_cuda 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_1024 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_1024_x86_64 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_1024_aarch64 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_1024_cuda 1
|
||||
#cmakedefine OQS_ENABLE_KEM_ml_kem_1024_icicle_cuda 1
|
||||
|
||||
#cmakedefine OQS_ENABLE_SIG_DILITHIUM 1
|
||||
#cmakedefine OQS_ENABLE_SIG_dilithium_2 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user