aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto/api.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcmix-crypto/api.h')
-rw-r--r--libcmix-crypto/api.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/libcmix-crypto/api.h b/libcmix-crypto/api.h
new file mode 100644
index 0000000..a798876
--- /dev/null
+++ b/libcmix-crypto/api.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdbool.h>
+
+#include "keypair.h"
+#include "sharedkey.h"
+
+typedef struct KeyPair (*KeyPairCreator)();
+typedef void (*KeyPairDeleter)(struct KeyPair);
+typedef struct SharedKey (*SharedKeyDeriver)(struct KeyPair, unsigned char*, bool);
+typedef void (*SharedKeyDeleter)(struct SharedKey);
+
+struct Api {
+ KeyPairCreator create_key_pair;
+ KeyPairDeleter free_key_pair;
+ SharedKeyDeriver derive_shared_key;
+ SharedKeyDeleter free_shared_key;
+};
+
+#ifdef __cplusplus
+}
+#endif