Skip to content

Commit

Permalink
Minimum Botan version 3.2.0 for PQC build; fix issue #2247--
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ-91 committed Sep 23, 2024
1 parent 47fee37 commit 865e216
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
17 changes: 11 additions & 6 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ find_package(ZLIB REQUIRED)

# required packages
find_package(JSON-C 0.11 REQUIRED)
if (CRYPTO_BACKEND_BOTAN3)
find_package(Botan 3.0.0 REQUIRED)
elseif (CRYPTO_BACKEND_BOTAN)
find_package(Botan 2.14.0 REQUIRED)
if(BOTAN_VERSION VERSION_GREATER_EQUAL 3.0.0)
set(CRYPTO_BACKEND_BOTAN3 1)
if(ENABLE_PQC)
find_package(Botan 3.2.0 REQUIRED)
set(CRYPTO_BACKEND_BOTAN3 1)
else()
if (CRYPTO_BACKEND_BOTAN3)
find_package(Botan 3.0.0 REQUIRED)
elseif (CRYPTO_BACKEND_BOTAN)
find_package(Botan 2.14.0 REQUIRED)
if(BOTAN_VERSION VERSION_GREATER_EQUAL 3.0.0)
set(CRYPTO_BACKEND_BOTAN3 1)
endif()
endif()
endif()
if (CRYPTO_BACKEND_OPENSSL)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/crypto/kyber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ rnp_kyber_param_to_botan_kyber_mode(kyber_parameter_e mode)
result = Botan::KyberMode::ML_KEM_768_ipd;
}
#else
Botan::KyberMode result = Botan::KyberMode::Kyber1024;
Botan::KyberMode result = Botan::KyberMode::Kyber1024_R3;
if (mode == kyber_768) {
result = Botan::KyberMode::Kyber768;
result = Botan::KyberMode::Kyber768_R3;
}
#endif
return result;
Expand Down
17 changes: 11 additions & 6 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,17 @@ else()
endif()

find_package(JSON-C 0.11 REQUIRED)
if (CRYPTO_BACKEND_BOTAN3)
find_package(Botan 3.0.0 REQUIRED)
elseif (CRYPTO_BACKEND_BOTAN)
find_package(Botan 2.14.0 REQUIRED)
if(BOTAN_VERSION VERSION_GREATER_EQUAL 3.0.0)
set(CRYPTO_BACKEND_BOTAN3 1)
if(ENABLE_PQC)
find_package(Botan 3.2.0 REQUIRED)
set(CRYPTO_BACKEND_BOTAN3 1)
else()
if (CRYPTO_BACKEND_BOTAN3)
find_package(Botan 3.2.0 REQUIRED)
elseif (CRYPTO_BACKEND_BOTAN)
find_package(Botan 2.14.0 REQUIRED)
if(BOTAN_VERSION VERSION_GREATER_EQUAL 3.0.0)
set(CRYPTO_BACKEND_BOTAN3 1)
endif()
endif()
endif()
if (CRYPTO_BACKEND_LOWERCASE STREQUAL "openssl")
Expand Down

0 comments on commit 865e216

Please sign in to comment.