diff options
author | Francis Dupont <[email protected]> | 2017-06-12 17:42:12 +0200 |
---|---|---|
committer | Francis Dupont <[email protected]> | 2017-06-12 17:42:12 +0200 |
commit | 056c593b48a7a5be72b8f14246eda429c067b16d (patch) | |
tree | baa2366b266e5507bc4134662ceb0d6710600e72 /src/lib/pubkey/curve25519 | |
parent | b886c812b9f2247c8da23cea29c92f5656a6743a (diff) |
Fixed public key code for *25519
Diffstat (limited to 'src/lib/pubkey/curve25519')
-rw-r--r-- | src/lib/pubkey/curve25519/curve25519.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lib/pubkey/curve25519/curve25519.cpp b/src/lib/pubkey/curve25519/curve25519.cpp index 341736be4..8c8274efc 100644 --- a/src/lib/pubkey/curve25519/curve25519.cpp +++ b/src/lib/pubkey/curve25519/curve25519.cpp @@ -49,21 +49,14 @@ bool Curve25519_PublicKey::check_key(RandomNumberGenerator&, bool) const Curve25519_PublicKey::Curve25519_PublicKey(const AlgorithmIdentifier&, const std::vector<uint8_t>& key_bits) { - BER_Decoder(key_bits) - .start_cons(SEQUENCE) - .decode(m_public, OCTET_STRING) - .end_cons(); + m_public = key_bits; size_check(m_public.size(), "public key"); } std::vector<uint8_t> Curve25519_PublicKey::public_key_bits() const { - return DER_Encoder() - .start_cons(SEQUENCE) - .encode(m_public, OCTET_STRING) - .end_cons() - .get_contents_unlocked(); + return m_public; } Curve25519_PrivateKey::Curve25519_PrivateKey(const secure_vector<uint8_t>& secret_key) |