diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-12-11 17:32:28 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-12-11 17:32:28 -0500 |
commit | 20fce33449e763a2c5d12375871409e5c1177731 (patch) | |
tree | 7a13ce4726f34c00058080213b46ca3b24cad144 /xed25519.cpp | |
parent | 77923a291a5c993cca5c11c9b7dc00891d88bd8e (diff) | |
download | cryptopp-git-20fce33449e763a2c5d12375871409e5c1177731.tar.gz |
Update documentation
Diffstat (limited to 'xed25519.cpp')
-rw-r--r-- | xed25519.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xed25519.cpp b/xed25519.cpp index 8ba19531..fcab71d0 100644 --- a/xed25519.cpp +++ b/xed25519.cpp @@ -20,6 +20,12 @@ x25519::x25519(const byte y[32], const byte x[32]) std::memcpy(m_sk, x, 32);
}
+x25519::x25519(const byte x[32])
+{
+ std::memcpy(m_sk, x, 32);
+ GeneratePublicKey(NullRNG(), m_sk, m_pk);
+}
+
x25519::x25519(const Integer &y, const Integer &x)
{
ArraySink ys(m_pk, 32);
@@ -29,6 +35,13 @@ x25519::x25519(const Integer &y, const Integer &x) x.Encode(xs, 32);
}
+x25519::x25519(const Integer &x)
+{
+ ArraySink xs(m_sk, 32);
+ x.Encode(xs, 32);
+ GeneratePublicKey(NullRNG(), m_sk, m_pk);
+}
+
x25519::x25519(RandomNumberGenerator &rng)
{
GeneratePrivateKey(rng, m_sk);
|