Debian Codegraph @

m4/acx_openssl_eddsa.m4

raw
1 AC_DEFUN([ACX_OPENSSL_EDDSA],[
2 AC_MSG_CHECKING(for OpenSSL EDDSA ED25519 support)
3
4 tmp_CPPFLAGS=$CPPFLAGS
5 tmp_LIBS=$LIBS
6
7 CPPFLAGS="$CPPFLAGS $CRYPTO_INCLUDES"
8 LIBS="$CRYPTO_LIBS $LIBS"
9
10 AC_LANG_PUSH([C])
11 AC_CACHE_VAL([acx_cv_lib_openssl_ed25519_support],[
12 acx_cv_lib_openssl_ed25519_support=no
13 AC_RUN_IFELSE([
14 AC_LANG_SOURCE([[
15 #include <openssl/evp.h>
16 #include <openssl/objects.h>
17 int main()
18 {
19 EVP_PKEY_CTX *ctx;
20
21 ctx = EVP_PKEY_CTX_new_id(NID_ED25519, NULL);
22 if (ctx == NULL)
23 return 1;
24 return 0;
25 }
26 ]])
27 ],[
28 AC_MSG_RESULT([Found ED25519])
29 acx_cv_lib_openssl_ed25519_support=yes
30 ],[
31 AC_MSG_RESULT([Cannot find ED25519])
32 acx_cv_lib_openssl_ed25519_support=no
33 ],[
34 AC_MSG_WARN([Cannot test, ED25519])
35 acx_cv_lib_openssl_ed25519_support=yes
36 ])
37 ])
38
39 AC_MSG_CHECKING(for OpenSSL EDDSA ED448 support)
40 AC_CACHE_VAL([acx_cv_lib_openssl_ed448_support],[
41 acx_cv_lib_openssl_ed448_support=no
42 AC_RUN_IFELSE([
43 AC_LANG_SOURCE([[
44 #include <openssl/evp.h>
45 #include <openssl/objects.h>
46 int main()
47 {
48 EVP_PKEY_CTX *ctx;
49
50 ctx = EVP_PKEY_CTX_new_id(NID_ED448, NULL);
51 if (ctx == NULL)
52 return 1;
53 return 0;
54 }
55 ]])
56 ],[
57 AC_MSG_RESULT([Found ED448])
58 acx_cv_lib_openssl_ed448_support=yes
59 ],[
60 AC_MSG_RESULT([Cannot find ED448])
61 acx_cv_lib_openssl_ed448_support=no
62 ],[
63 AC_MSG_WARN([Cannot test, ED448])
64 acx_cv_lib_openssl_ed448_support=yes
65 ])
66 ])
67 AC_LANG_POP([C])
68
69 CPPFLAGS=$tmp_CPPFLAGS
70 LIBS=$tmp_LIBS
71 have_lib_openssl_ed25519_support="${acx_cv_lib_openssl_ed25519_support}"
72 have_lib_openssl_ed448_support="${acx_cv_lib_openssl_ed448_support}"
73 ])