diff options
author | lloyd <[email protected]> | 2014-12-27 17:50:57 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-12-27 17:50:57 +0000 |
commit | d0daf875978848c3edf65c7b3683a21605f72e64 (patch) | |
tree | 46690afadfb5e9acb766468f7f7481bb1244049d /src/cmd/keygen.cpp | |
parent | 675c2e324268ebce7e2c665389ebd57d38083200 (diff) |
Add Curve25519 based on curve25519-donna by Adam Langley.
This uses only the c64 version from curve25519-donna; on systems that
don't have a native uint128_t type, a donna128 type stands in for just
enough 128-bit operations to satisfy donna.cpp
Diffstat (limited to 'src/cmd/keygen.cpp')
-rw-r--r-- | src/cmd/keygen.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/keygen.cpp b/src/cmd/keygen.cpp index 3054b98ee..ae23ce45e 100644 --- a/src/cmd/keygen.cpp +++ b/src/cmd/keygen.cpp @@ -17,6 +17,10 @@ #include <botan/ecdsa.h> #endif +#if defined(BOTAN_HAS_CURVE_25519) +#include <botan/curve25519.h> +#endif + using namespace Botan; namespace { @@ -55,6 +59,11 @@ Private_Key* gen_key(RandomNumberGenerator& rng, const std::string& algo, size_t } #endif +#if defined(BOTAN_HAS_CURVE_25519) + if(algo == "curve25519") + return new Curve25519_PrivateKey(rng); +#endif + throw std::runtime_error("Unknown algorithm " + algo); } |