aboutsummaryrefslogtreecommitdiff
path: root/CMakeModules
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-10-27 09:25:53 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-10-27 09:25:53 +0200
commit25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c (patch)
tree079ea63fcc874506072a91b13d2612b510cf158e /CMakeModules
parent9eaf47d5dfa56ca79ae903aabfc2cf52bdfb981e (diff)
downloadcmix-25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c.tar.gz
cmix-25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c.tar.bz2
cmix-25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c.zip
Adds libgcrypt implementation for elgamal in multiplicative group.
Also adapts the API to both handle sodium and gcrypt libraries.
Diffstat (limited to 'CMakeModules')
-rw-r--r--CMakeModules/FindGcrypt.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/CMakeModules/FindGcrypt.cmake b/CMakeModules/FindGcrypt.cmake
new file mode 100644
index 0000000..1b4e8c8
--- /dev/null
+++ b/CMakeModules/FindGcrypt.cmake
@@ -0,0 +1,33 @@
+# - Try to find the Gcrypt library
+# Once run this will define
+#
+# Gcrypt_FOUND
+# Gcrypt_CFLAGS
+# Gcrypt_LIBRARIES
+
+FIND_PROGRAM(libgcrypt_config_executable NAMES libgcrypt-config)
+
+# if libgcrypt-config has been found
+IF(libgcrypt_config_executable)
+
+ EXEC_PROGRAM(${libgcrypt_config_executable} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE Gcrypt_LIBRARIES)
+
+ EXEC_PROGRAM(${libgcrypt_config_executable} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE Gcrypt_CFLAGS)
+
+ IF(Gcrypt_LIBRARIES AND Gcrypt_CFLAGS)
+ SET(Gcrypt_FOUND TRUE)
+ ENDIF(Gcrypt_LIBRARIES AND Gcrypt_CFLAGS)
+
+ENDIF(libgcrypt_config_executable)
+
+if(Gcrypt_FOUND)
+ if (NOT Gcrypt_FIND_QUIETLY)
+ message(STATUS "Found libgcrypt: ${Gcrypt_LIBRARIES}")
+ endif (NOT Gcrypt_FIND_QUIETLY)
+else(Gcrypt_FOUND)
+ if (Gcrypt_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find libgcrypt libraries")
+ endif (Gcrypt_FIND_REQUIRED)
+endif(Gcrypt_FOUND)
+
+MARK_AS_ADVANCED(Gcrypt_CFLAGS Gcrypt_LIBRARIES) \ No newline at end of file