aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/curve25519/curve25519.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-21 11:25:53 -0400
committerJack Lloyd <[email protected]>2016-10-21 16:54:43 -0400
commitf44bd90a3ff9c2928eef825a0ff5394160b1a01c (patch)
treed5bec5ca3c501122c747fd492c8a16270135b935 /src/lib/pubkey/curve25519/curve25519.cpp
parent6aa855bba613c7b6fedfbe71d15930964acb1633 (diff)
X25519 key exchange for TLS
Client interops with google.com, server not tested against an independent client yet.
Diffstat (limited to 'src/lib/pubkey/curve25519/curve25519.cpp')
-rw-r--r--src/lib/pubkey/curve25519/curve25519.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/pubkey/curve25519/curve25519.cpp b/src/lib/pubkey/curve25519/curve25519.cpp
index 02ee516de..4a072e648 100644
--- a/src/lib/pubkey/curve25519/curve25519.cpp
+++ b/src/lib/pubkey/curve25519/curve25519.cpp
@@ -29,10 +29,13 @@ secure_vector<byte> curve25519(const secure_vector<byte>& secret,
return out;
}
-secure_vector<byte> curve25519_basepoint(const secure_vector<byte>& secret)
+std::vector<byte> curve25519_basepoint(const secure_vector<byte>& secret)
{
const byte basepoint[32] = { 9 };
- return curve25519(secret, basepoint);
+ std::vector<byte> out(32);
+ const int rc = curve25519_donna(out.data(), secret.data(), basepoint);
+ BOTAN_ASSERT_EQUAL(rc, 0, "Return value of curve25519_donna is ok");
+ return out;
}
}