Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue #2247; use newer kyber _R3 symbols for Botan 3.2.0 upwards #2249

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TJ-91 This should be done only if PQC is enabled, for non-PQC builds we need to support Botan 3.0.0 and 3.1.1 as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ni4 ah, I see. I hope it's good now

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