1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-24 19:37:48 +03:00

curve25519: Use mbedTLS curve25519 for ECDH, if available

Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Praneeth Sarode
2025-03-21 00:08:17 +05:30
committed by Jakub Jelen
parent 84d02e7440
commit 49a355c272
4 changed files with 249 additions and 1 deletions

View File

@@ -236,6 +236,20 @@ if (MBEDTLS_FOUND)
set(CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIR}/mbedtls")
check_include_file(chacha20.h HAVE_MBEDTLS_CHACHA20_H)
check_include_file(poly1305.h HAVE_MBEDTLS_POLY1305_H)
set(CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIR}")
check_c_source_compiles("
#include <mbedtls/ecp.h>
int main() {
#if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED)
return 0;
#else
#error \"X25519 not supported\"
#endif
}
" HAVE_MBEDTLS_CURVE25519)
if (WITH_BLOWFISH_CIPHER)
check_include_file(blowfish.h HAVE_BLOWFISH)
endif()