summaryrefslogtreecommitdiff
path: root/xed25519.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-12-25 07:38:30 -0500
committerJeffrey Walton <noloader@gmail.com>2018-12-25 07:38:30 -0500
commit3b18e81bc1c113b005d679d7501530094c886297 (patch)
tree5d85565c1a19d7ce224631b40c90fa9240a88e16 /xed25519.h
parentc37d7c83b145d8d3c0b47b8b884cd15d09eb6e42 (diff)
downloadcryptopp-git-3b18e81bc1c113b005d679d7501530094c886297.tar.gz
Remove unneeded ed25519Verifier code
Add accessors for public and private key
Diffstat (limited to 'xed25519.h')
-rw-r--r--xed25519.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/xed25519.h b/xed25519.h
index 2cab0a45..cd9ffee5 100644
--- a/xed25519.h
+++ b/xed25519.h
@@ -227,7 +227,7 @@ struct ed25519_MessageAccumulator : public PK_MessageAccumulator
/// \brief Create a message accumulator
/// \details ed25519 does not use a RNG. You can safely use
- /// NullRNG() because IsProbablistic returns false;
+ /// NullRNG() because IsProbablistic returns false.
ed25519_MessageAccumulator(RandomNumberGenerator &rng) {
CRYPTOPP_UNUSED(rng); Restart();
}
@@ -358,6 +358,21 @@ struct ed25519PrivateKey : public PKCS8PrivateKey
/// \param x private key
bool IsClamped(const byte x[SECRET_KEYLENGTH]) const;
+ /// \brief Retrieve private key byte array
+ /// \returns the private key byte array
+ /// \details GetPrivateKeyBytePtr() is used by signing code to call ed25519_sign.
+ const byte* GetPrivateKeyBytePtr() const {
+ return m_sk.begin();
+ }
+
+ /// \brief Retrieve public key byte array
+ /// \returns the public key byte array
+ /// \details GetPublicKeyBytePtr() is used by signing code to call ed25519_sign.
+ const byte* GetPublicKeyBytePtr() const {
+ return m_pk.begin();
+ }
+
+protected:
FixedSizeSecBlock<byte, SECRET_KEYLENGTH> m_sk;
FixedSizeSecBlock<byte, PUBLIC_KEYLENGTH> m_pk;
OID m_oid; // preferred OID
@@ -498,6 +513,14 @@ struct ed25519PublicKey : public X509PublicKey
void SetPublicElement(const Element &y);
const Element& GetPublicElement() const;
+ /// \brief Retrieve public key byte array
+ /// \returns the public key byte array
+ /// \details GetPublicKeyBytePtr() is used by signing code to call ed25519_sign.
+ const byte* GetPublicKeyBytePtr() const {
+ return m_pk.begin();
+ }
+
+protected:
FixedSizeSecBlock<byte, PUBLIC_KEYLENGTH> m_pk;
OID m_oid; // preferred OID
mutable Integer m_y; // for DL_PublicKey