aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2015-12-03 12:18:21 +0000
committerRichard van der Hoff <richard@matrix.org>2015-12-03 17:08:04 +0000
commit25953b350b157744dd32dd364c5eb276c3172dc6 (patch)
treee5aedb5c8d6f07206634cb0aba2afdf8742ed189 /lib
parent2416658443d0a232b17ca533ad589e4a8f3065fa (diff)
Use header files where possible
This fixes an incorrect re-declaration of ed25519_sign. Implement header files for some of the other library bits so that we don't need to declare functions in crypto.cpp.
Diffstat (limited to 'lib')
-rw-r--r--lib/curve25519-donna.h18
-rw-r--r--lib/ed25519_additions.h24
2 files changed, 42 insertions, 0 deletions
diff --git a/lib/curve25519-donna.h b/lib/curve25519-donna.h
new file mode 100644
index 0000000..3c53d4a
--- /dev/null
+++ b/lib/curve25519-donna.h
@@ -0,0 +1,18 @@
+/* header file for the curve25519-donna implementation, because the
+ * authors of that project don't supply one.
+ */
+#ifndef CURVE25519_DONNA_H
+#define CURVE25519_DONNA_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int curve25519_donna(unsigned char *output, const unsigned char *a,
+ const unsigned char *b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/lib/ed25519_additions.h b/lib/ed25519_additions.h
new file mode 100644
index 0000000..e5f93a1
--- /dev/null
+++ b/lib/ed25519_additions.h
@@ -0,0 +1,24 @@
+#ifndef ED25519_ADDITIONS_H
+#define ED25519_ADDITIONS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void convert_curve25519_to_ed25519(
+ unsigned char * public_key,
+ unsigned char * signature);
+
+void convert_ed25519_to_curve25519(
+ unsigned char const * public_key,
+ unsigned char * signature);
+
+void ed25519_keypair(
+ unsigned char * private_key,
+ unsigned char * public_key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif