diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2013-11-03 14:58:10 +0100 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2013-11-03 14:58:10 +0100 |
commit | c5ef5ed18f61f1392d0bb4805abc4f14c28e9a51 (patch) | |
tree | b9405b214937e6c8d1cc850dc4efcf6d9aebfb14 /include/libssh/curve25519.h | |
parent | ebf4a03908e9d5cc728af675f4f235c315241f99 (diff) | |
download | libssh-c5ef5ed18f61f1392d0bb4805abc4f14c28e9a51.tar.gz libssh-c5ef5ed18f61f1392d0bb4805abc4f14c28e9a51.tar.xz libssh-c5ef5ed18f61f1392d0bb4805abc4f14c28e9a51.zip |
curve25519: include reference implementation
Diffstat (limited to 'include/libssh/curve25519.h')
-rw-r--r-- | include/libssh/curve25519.h | 12 |
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); |