diff options
author | lloyd <[email protected]> | 2008-05-24 18:47:11 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-05-24 18:47:11 +0000 |
commit | c4bad5476b30811ad51b1edd3bd873864d423c07 (patch) | |
tree | 94679d6cee3a38da1d64b8f5f671986566ac8a18 /include | |
parent | ebc67ae27481549a152858f24fff4a7a82ad4e51 (diff) |
Avoid using the global RNG in check_key, instead pass a reference.
Update the examples
Diffstat (limited to 'include')
-rw-r--r-- | include/dl_algo.h | 4 | ||||
-rw-r--r-- | include/dsa.h | 2 | ||||
-rw-r--r-- | include/elgamal.h | 2 | ||||
-rw-r--r-- | include/if_algo.h | 4 | ||||
-rw-r--r-- | include/nr.h | 2 | ||||
-rw-r--r-- | include/pk_keys.h | 4 | ||||
-rw-r--r-- | include/rsa.h | 2 | ||||
-rw-r--r-- | include/rw.h | 2 |
8 files changed, 12 insertions, 10 deletions
diff --git a/include/dl_algo.h b/include/dl_algo.h index f279d4633..2bcd67cb9 100644 --- a/include/dl_algo.h +++ b/include/dl_algo.h @@ -18,7 +18,7 @@ namespace Botan { class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key { public: - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; const DL_Group& get_domain() const { return group; } const BigInt& get_y() const { return y; } @@ -43,7 +43,7 @@ class BOTAN_DLL DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey, public virtual Private_Key { public: - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; const BigInt& get_x() const { return x; } diff --git a/include/dsa.h b/include/dsa.h index 21941cd29..83c92572e 100644 --- a/include/dsa.h +++ b/include/dsa.h @@ -45,7 +45,7 @@ class BOTAN_DLL DSA_PrivateKey : public DSA_PublicKey, public: SecureVector<byte> sign(const byte[], u32bit) const; - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; DSA_PrivateKey() {} DSA_PrivateKey(const DL_Group&, RandomNumberGenerator& rng); diff --git a/include/elgamal.h b/include/elgamal.h index 9a8135d38..bf9199fac 100644 --- a/include/elgamal.h +++ b/include/elgamal.h @@ -43,7 +43,7 @@ class BOTAN_DLL ElGamal_PrivateKey : public ElGamal_PublicKey, public: SecureVector<byte> decrypt(const byte[], u32bit) const; - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; ElGamal_PrivateKey() {} ElGamal_PrivateKey(const DL_Group&, RandomNumberGenerator&); diff --git a/include/if_algo.h b/include/if_algo.h index aa336a067..5f5fa4ce2 100644 --- a/include/if_algo.h +++ b/include/if_algo.h @@ -18,7 +18,7 @@ namespace Botan { class BOTAN_DLL IF_Scheme_PublicKey : public virtual Public_Key { public: - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; const BigInt& get_n() const { return n; } const BigInt& get_e() const { return e; } @@ -40,7 +40,7 @@ class BOTAN_DLL IF_Scheme_PrivateKey : public virtual IF_Scheme_PublicKey, public virtual Private_Key { public: - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; const BigInt& get_p() const { return p; } const BigInt& get_q() const { return q; } diff --git a/include/nr.h b/include/nr.h index 0225af057..47c91dc6e 100644 --- a/include/nr.h +++ b/include/nr.h @@ -45,7 +45,7 @@ class BOTAN_DLL NR_PrivateKey : public NR_PublicKey, public: SecureVector<byte> sign(const byte[], u32bit) const; - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; NR_PrivateKey() {} NR_PrivateKey(const DL_Group&, RandomNumberGenerator& rng); diff --git a/include/pk_keys.h b/include/pk_keys.h index 36905e868..a44aa7c7c 100644 --- a/include/pk_keys.h +++ b/include/pk_keys.h @@ -20,7 +20,9 @@ class BOTAN_DLL Public_Key virtual std::string algo_name() const = 0; virtual OID get_oid() const; - virtual bool check_key(bool) const { return true; } + virtual bool check_key(RandomNumberGenerator&, bool) const + { return true; } + virtual u32bit message_parts() const { return 1; } virtual u32bit message_part_size() const { return 0; } virtual u32bit max_input_bits() const = 0; diff --git a/include/rsa.h b/include/rsa.h index 54ac50fad..16408c471 100644 --- a/include/rsa.h +++ b/include/rsa.h @@ -41,7 +41,7 @@ class BOTAN_DLL RSA_PrivateKey : public RSA_PublicKey, SecureVector<byte> decrypt(const byte[], u32bit) const; SecureVector<byte> sign(const byte[], u32bit) const; - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; RSA_PrivateKey() {} RSA_PrivateKey(const BigInt&, const BigInt&, const BigInt&, diff --git a/include/rw.h b/include/rw.h index 6ccc2b10d..0d22711df 100644 --- a/include/rw.h +++ b/include/rw.h @@ -37,7 +37,7 @@ class BOTAN_DLL RW_PrivateKey : public RW_PublicKey, public: SecureVector<byte> sign(const byte[], u32bit) const; - bool check_key(bool) const; + bool check_key(RandomNumberGenerator& rng, bool) const; RW_PrivateKey() {} RW_PrivateKey(const BigInt&, const BigInt&, const BigInt&, |