aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2013-11-03 14:58:10 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2013-11-03 14:58:47 +0100
commit8bf6907c1dd508cad19f9e00ff1e869ede7defa4 (patch)
tree560a0978f8b2d9dfe273e6beebf117d7ba0685cf /include
parent6e9e13cc2452d98ad8b10cf744725c21ba83cd2e (diff)
downloadlibssh-8bf6907c1dd508cad19f9e00ff1e869ede7defa4.tar.gz
libssh-8bf6907c1dd508cad19f9e00ff1e869ede7defa4.tar.xz
libssh-8bf6907c1dd508cad19f9e00ff1e869ede7defa4.zip
curve25519: include reference implementation
Diffstat (limited to 'include')
-rw-r--r--include/libssh/curve25519.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/libssh/curve25519.h b/include/libssh/curve25519.h
index 004210cb..35e25be0 100644
--- a/include/libssh/curve25519.h
+++ b/include/libssh/curve25519.h
@@ -26,15 +26,23 @@
#ifdef WITH_NACL
-#define HAVE_CURVE25519
#include <nacl/crypto_scalarmult_curve25519.h>
#define CURVE25519_PUBKEY_SIZE crypto_scalarmult_curve25519_BYTES
#define CURVE25519_PRIVKEY_SIZE crypto_scalarmult_curve25519_SCALARBYTES
+#define crypto_scalarmult_base crypto_scalarmult_curve25519_base
+#define crypto_scalarmult crypto_scalarmult_curve25519
+#else
+
+#define CURVE25519_PUBKEY_SIZE 32
+#define CURVE25519_PRIVKEY_SIZE 32
+int crypto_scalarmult_base(unsigned char *q, const unsigned char *n);
+int crypto_scalarmult(unsigned char *q, const unsigned char *n, const unsigned char *p);
+#endif /* WITH_NACL */
+#define HAVE_CURVE25519
typedef unsigned char ssh_curve25519_pubkey[CURVE25519_PUBKEY_SIZE];
typedef unsigned char ssh_curve25519_privkey[CURVE25519_PRIVKEY_SIZE];
-#endif /* WITH_NACL */
int ssh_client_curve25519_init(ssh_session session);
int ssh_client_curve25519_reply(ssh_session session, ssh_buffer packet);