diff options
author | Jack Lloyd <[email protected]> | 2016-11-02 15:05:46 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-11-03 11:57:10 -0400 |
commit | 8d50c82b43b34b70d19b0faaeab6b37f2eae066c (patch) | |
tree | 9cb7478fb7c37c66e140bc09ca77bf0ede07cc76 /src/lib/pubkey/curve25519 | |
parent | b1021ca76bb3c47b1b520421ccece38d772e5907 (diff) |
Remove automatic self-testing of public and private keys
Rarely expected and often causes performance problems, especially for private keys.
Instead applications should call check_key explicitly to validate keys when
necessary.
Note this removal doesn't apply to tests like ECDH on-the-curve tests, where a check
on the public key is required for security of our own key.
Updates most APIs to remove RNG calls, where they are no longer required. Exception
is PKCS8 interface, pending further work there (see GH #685) it just ignores the RNG
argument now.
Diffstat (limited to 'src/lib/pubkey/curve25519')
-rw-r--r-- | src/lib/pubkey/curve25519/curve25519.cpp | 5 | ||||
-rw-r--r-- | src/lib/pubkey/curve25519/curve25519.h | 4 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/lib/pubkey/curve25519/curve25519.cpp b/src/lib/pubkey/curve25519/curve25519.cpp index 4a072e648..fc2fcea0b 100644 --- a/src/lib/pubkey/curve25519/curve25519.cpp +++ b/src/lib/pubkey/curve25519/curve25519.cpp @@ -78,8 +78,7 @@ Curve25519_PrivateKey::Curve25519_PrivateKey(RandomNumberGenerator& rng) } Curve25519_PrivateKey::Curve25519_PrivateKey(const AlgorithmIdentifier&, - const secure_vector<byte>& key_bits, - RandomNumberGenerator& rng) + const secure_vector<byte>& key_bits) { BER_Decoder(key_bits) .start_cons(SEQUENCE) @@ -90,8 +89,6 @@ Curve25519_PrivateKey::Curve25519_PrivateKey(const AlgorithmIdentifier&, size_check(m_public.size(), "public key"); size_check(m_private.size(), "private key"); - - load_check(rng); } secure_vector<byte> Curve25519_PrivateKey::pkcs8_private_key() const diff --git a/src/lib/pubkey/curve25519/curve25519.h b/src/lib/pubkey/curve25519/curve25519.h index 03d274e0b..3d0311ea4 100644 --- a/src/lib/pubkey/curve25519/curve25519.h +++ b/src/lib/pubkey/curve25519/curve25519.h @@ -64,11 +64,9 @@ class BOTAN_DLL Curve25519_PrivateKey : public Curve25519_PublicKey, * Construct a private key from the specified parameters. * @param alg_id the X.509 algorithm identifier * @param key_bits PKCS #8 structure - * @param rng the RNG to use */ Curve25519_PrivateKey(const AlgorithmIdentifier& alg_id, - const secure_vector<byte>& key_bits, - RandomNumberGenerator& rng); + const secure_vector<byte>& key_bits); /** * Generate a private key. |