Skip to content

Commit

Permalink
Minor update for the Zephyr port
Browse files Browse the repository at this point in the history
* Make ML-KEM and ML-DSA user configurable using Kconfig
* Enable ML-KEM and ML-DA by default
* Disable Kyber and Dilithium Round 3 by default

Signed-off-by: Tobias Frauenschläger <[email protected]>
  • Loading branch information
Frauschi authored and dstebila committed Mar 15, 2024
1 parent 1bc6d11 commit d183ed3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
14 changes: 13 additions & 1 deletion zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,24 @@ if(CONFIG_LIBOQS)
set(OQS_ENABLE_KEM_KYBER OFF)
endif()

if(CONFIG_LIBOQS_ENABLE_KEM_ML_KEM)
set(OQS_ENABLE_KEM_ML_KEM ON)
else()
set(OQS_ENABLE_KEM_ML_KEM OFF)
endif()

if(CONFIG_LIBOQS_ENABLE_SIG_DILITHIUM)
set(OQS_ENABLE_SIG_DILITHIUM ON)
else()
set(OQS_ENABLE_SIG_DILITHIUM OFF)
endif()

if(CONFIG_LIBOQS_ENABLE_SIG_ML_DSA)
set(OQS_ENABLE_SIG_ML_DSA ON)
else()
set(OQS_ENABLE_SIG_ML_DSA OFF)
endif()

if(CONFIG_LIBOQS_ENABLE_SIG_FALCON)
set(OQS_ENABLE_SIG_FALCON ON)
else()
Expand All @@ -109,7 +121,7 @@ if(CONFIG_LIBOQS)
set(OQS_ENABLE_SIG_SPHINCS OFF)
endif()

# Add the actual liboqs targets
# Add the actual liboqs targets
add_subdirectory(.. build)

# Add target specific options to all liboqs targets
Expand Down
16 changes: 13 additions & 3 deletions zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,22 @@ config LIBOQS_ENABLE_KEM_HQC
depends on LIBOQS

config LIBOQS_ENABLE_KEM_KYBER
bool "Enable the KYBER KEM algorithm"
bool "Enable the KYBER KEM algorithm (NIST Round 3)"
default n
depends on LIBOQS

config LIBOQS_ENABLE_KEM_ML_KEM
bool "Enable the ML-KEM algorithm (ML-KEM-ipd)"
default y
depends on LIBOQS

config LIBOQS_ENABLE_SIG_DILITHIUM
bool "Enable the DILITHIUM signature algorithm"
bool "Enable the DILITHIUM signature algorithm (NIST Round 3)"
default n
depends on LIBOQS

config LIBOQS_ENABLE_SIG_ML_DSA
bool "Enable the ML-DSA signature algorithm (ML-DSA-ipd)"
default y
depends on LIBOQS

Expand Down
1 change: 1 addition & 0 deletions zephyr/samples/KEMs/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CONFIG_LIBOQS_ENABLE_KEM_FRODOKEM=y
CONFIG_LIBOQS_ENABLE_KEM_NTRUPRIME=y
CONFIG_LIBOQS_ENABLE_KEM_CLASSIC_MCELIECE=n
CONFIG_LIBOQS_ENABLE_KEM_HQC=y
CONFIG_LIBOQS_ENABLE_KEM_KYBER=y

CONFIG_PICOLIBC=y
CONFIG_TEST_RANDOM_GENERATOR=y
Expand Down
3 changes: 3 additions & 0 deletions zephyr/samples/Signatures/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

CONFIG_LIBOQS=y

# Enable all Signature algorithms that are disabled by default
CONFIG_LIBOQS_ENABLE_SIG_DILITHIUM=y

CONFIG_PICOLIBC=y
CONFIG_TEST_RANDOM_GENERATOR=y

Expand Down

0 comments on commit d183ed3

Please sign in to comment.