aboutsummaryrefslogtreecommitdiff
path: root/src/curve25519.c
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 /src/curve25519.c
parent6e9e13cc2452d98ad8b10cf744725c21ba83cd2e (diff)
downloadlibssh-8bf6907c1dd508cad19f9e00ff1e869ede7defa4.tar.gz
libssh-8bf6907c1dd508cad19f9e00ff1e869ede7defa4.tar.xz
libssh-8bf6907c1dd508cad19f9e00ff1e869ede7defa4.zip
curve25519: include reference implementation
Diffstat (limited to 'src/curve25519.c')
-rw-r--r--src/curve25519.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/curve25519.c b/src/curve25519.c
index 653beee0..916eb81e 100644
--- a/src/curve25519.c
+++ b/src/curve25519.c
@@ -26,7 +26,10 @@
#include "libssh/curve25519.h"
#ifdef HAVE_CURVE25519
+#ifdef WITH_NACL
#include "nacl/crypto_scalarmult_curve25519.h"
+#endif
+
#include "libssh/ssh2.h"
#include "libssh/buffer.h"
#include "libssh/priv.h"
@@ -53,7 +56,7 @@ int ssh_client_curve25519_init(ssh_session session){
return SSH_ERROR;
}
- crypto_scalarmult_curve25519_base(session->next_crypto->curve25519_client_pubkey,
+ crypto_scalarmult_base(session->next_crypto->curve25519_client_pubkey,
session->next_crypto->curve25519_privkey);
client_pubkey = ssh_string_new(CURVE25519_PUBKEY_SIZE);
if (client_pubkey == NULL) {
@@ -81,10 +84,10 @@ static int ssh_curve25519_build_k(ssh_session session) {
}
if (session->server)
- crypto_scalarmult_curve25519(k, session->next_crypto->curve25519_privkey,
+ crypto_scalarmult(k, session->next_crypto->curve25519_privkey,
session->next_crypto->curve25519_client_pubkey);
else
- crypto_scalarmult_curve25519(k, session->next_crypto->curve25519_privkey,
+ crypto_scalarmult(k, session->next_crypto->curve25519_privkey,
session->next_crypto->curve25519_server_pubkey);
BN_bin2bn(k, CURVE25519_PUBKEY_SIZE, session->next_crypto->k);
@@ -195,7 +198,7 @@ int ssh_server_curve25519_init(ssh_session session, ssh_buffer packet){
return SSH_ERROR;
}
- crypto_scalarmult_curve25519_base(session->next_crypto->curve25519_server_pubkey,
+ crypto_scalarmult_base(session->next_crypto->curve25519_server_pubkey,
session->next_crypto->curve25519_privkey);
q_s_string = ssh_string_new(CURVE25519_PUBKEY_SIZE);