aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto
diff options
context:
space:
mode:
Diffstat (limited to 'libcmix-crypto')
-rw-r--r--libcmix-crypto/CMakeLists.txt2
-rw-r--r--libcmix-crypto/curve25519/CMakeLists.txt1
-rw-r--r--libcmix-crypto/curve25519/null/CMakeLists.txt1
-rw-r--r--libcmix-crypto/curve25519/sodium/CMakeLists.txt1
-rw-r--r--libcmix-crypto/elgamal/CMakeLists.txt3
-rw-r--r--libcmix-crypto/elgamal/null/CMakeLists.txt1
-rw-r--r--libcmix-crypto/elgamal/null/null_elgamal.c25
7 files changed, 29 insertions, 5 deletions
diff --git a/libcmix-crypto/CMakeLists.txt b/libcmix-crypto/CMakeLists.txt
index dea1196..0986024 100644
--- a/libcmix-crypto/CMakeLists.txt
+++ b/libcmix-crypto/CMakeLists.txt
@@ -37,4 +37,4 @@ option(UseEC "Use curve25519 instead of RSA" ON)
target_link_libraries(cmix-crypto
INTERFACE curve25519-implementation
INTERFACE elgamal-implementation
-)
+) \ No newline at end of file
diff --git a/libcmix-crypto/curve25519/CMakeLists.txt b/libcmix-crypto/curve25519/CMakeLists.txt
index ba79d87..afcc1b4 100644
--- a/libcmix-crypto/curve25519/CMakeLists.txt
+++ b/libcmix-crypto/curve25519/CMakeLists.txt
@@ -26,6 +26,7 @@ target_include_directories(curve25519-implementation
)
target_link_libraries(curve25519-implementation
+ PUBLIC curve25519-interface
PUBLIC curve25519-${curve25519_implementation}
)
diff --git a/libcmix-crypto/curve25519/null/CMakeLists.txt b/libcmix-crypto/curve25519/null/CMakeLists.txt
index 12264db..e5cefdd 100644
--- a/libcmix-crypto/curve25519/null/CMakeLists.txt
+++ b/libcmix-crypto/curve25519/null/CMakeLists.txt
@@ -11,6 +11,5 @@ target_compile_options(${target_name}
)
target_link_libraries(${target_name}
- INTERFACE cmix-crypto
PRIVATE curve25519-interface
)
diff --git a/libcmix-crypto/curve25519/sodium/CMakeLists.txt b/libcmix-crypto/curve25519/sodium/CMakeLists.txt
index 7679a88..78561ce 100644
--- a/libcmix-crypto/curve25519/sodium/CMakeLists.txt
+++ b/libcmix-crypto/curve25519/sodium/CMakeLists.txt
@@ -13,7 +13,6 @@ target_compile_options(${target_name}
)
target_link_libraries(${target_name}
- INTERFACE cmix-crypto
PRIVATE curve25519-interface
PUBLIC sodium
)
diff --git a/libcmix-crypto/elgamal/CMakeLists.txt b/libcmix-crypto/elgamal/CMakeLists.txt
index 88f5ba8..b92e5ae 100644
--- a/libcmix-crypto/elgamal/CMakeLists.txt
+++ b/libcmix-crypto/elgamal/CMakeLists.txt
@@ -25,5 +25,6 @@ target_include_directories(elgamal-implementation
)
target_link_libraries(elgamal-implementation
+ PUBLIC elgamal-interface
PUBLIC elgamal-${elgamal_implementation}
-)
+)
diff --git a/libcmix-crypto/elgamal/null/CMakeLists.txt b/libcmix-crypto/elgamal/null/CMakeLists.txt
index 39db0f0..76cd77c 100644
--- a/libcmix-crypto/elgamal/null/CMakeLists.txt
+++ b/libcmix-crypto/elgamal/null/CMakeLists.txt
@@ -11,6 +11,5 @@ target_compile_options(${target_name}
)
target_link_libraries(${target_name}
- INTERFACE cmix-crypto
PRIVATE elgamal-interface
)
diff --git a/libcmix-crypto/elgamal/null/null_elgamal.c b/libcmix-crypto/elgamal/null/null_elgamal.c
index e69de29..ef98912 100644
--- a/libcmix-crypto/elgamal/null/null_elgamal.c
+++ b/libcmix-crypto/elgamal/null/null_elgamal.c
@@ -0,0 +1,25 @@
+
+#include "api.h"
+
+#include <stddef.h>
+#include <stdbool.h>
+
+void elgamal_keypair_deleter(struct KeyPair p) {}
+
+struct KeyPair elgamal_create_keypair() {
+ return (struct KeyPair){
+ NULL,
+ NULL,
+ 0,
+ 0
+ };
+}
+
+void elgamal_shared_key_deleter(struct SharedKey s) {}
+
+struct SharedKey elgamal_derive_shared_key(struct KeyPair pair, unsigned char* pub_key, bool swap_pub_order) {
+ return (struct SharedKey){
+ NULL,
+ 0
+ };
+}