From 99b2ca860d44702fc055653684282a4d70937e3d Mon Sep 17 00:00:00 2001 From: EinMByte Date: Sat, 29 Aug 2015 21:53:04 +0200 Subject: [PATCH] Add interface for edddsa key generation. --- core/crypto/EdDSA25519.cpp | 8 ++++++++ core/crypto/EdDSA25519.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/core/crypto/EdDSA25519.cpp b/core/crypto/EdDSA25519.cpp index b26c9346..e954e058 100644 --- a/core/crypto/EdDSA25519.cpp +++ b/core/crypto/EdDSA25519.cpp @@ -40,5 +40,13 @@ void EDDSA25519Signer::Sign(CryptoPP::RandomNumberGenerator& rnd, const uint8_t* ed25519_ref10_sign(signature, buf, len, m_PrivateKey, m_PublicKey); } +void CreateEDDSARandomKeys(CryptoPP::RandomNumberGenerator& rnd, uint8_t* privateKey, + uint8_t* publicKey) +{ + rnd.GenerateBlock(privateKey, EDDSA25519_PRIVATE_KEY_LENGTH); + ed25519_ref10_pubkey(publicKey, privateKey); +} + + } } diff --git a/core/crypto/EdDSA25519.h b/core/crypto/EdDSA25519.h index dcb5d253..f6951014 100644 --- a/core/crypto/EdDSA25519.h +++ b/core/crypto/EdDSA25519.h @@ -43,6 +43,9 @@ public: uint8_t m_PublicKey[EDDSA25519_PUBLIC_KEY_LENGTH]; }; +void CreateEDDSARandomKeys(CryptoPP::RandomNumberGenerator& rnd, uint8_t* privateKey, + uint8_t* publicKey); + } }