diff options
author | lloyd <[email protected]> | 2008-06-27 14:29:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-27 14:29:33 +0000 |
commit | 34d5da54da524018580935da11525bd72b5a560e (patch) | |
tree | 398e07f035b4e72bf7a315f0d9f1e6e55b46795f /include | |
parent | d1bc1ae91003bc10b46b0d1e38f0ac64080b4c81 (diff) |
Remove load checking, as it requires an RNG (at least at the moment).
Probably some variation of it will be added back in later, at least
to do basic checks like that primes are really odd (and we can do
basic primality checks, etc, even with an RNG).
Alternative: call check_key() manually on public keys you load with an
RNG object.
Diffstat (limited to 'include')
-rw-r--r-- | include/dh.h | 2 | ||||
-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_core.h | 4 | ||||
-rw-r--r-- | include/pk_keys.h | 6 | ||||
-rw-r--r-- | include/rsa.h | 11 | ||||
-rw-r--r-- | include/rw.h | 7 |
10 files changed, 25 insertions, 19 deletions
diff --git a/include/dh.h b/include/dh.h index 0e28bf73e..17a3fcae1 100644 --- a/include/dh.h +++ b/include/dh.h @@ -27,7 +27,7 @@ class BOTAN_DLL DH_PublicKey : public virtual DL_Scheme_PublicKey DH_PublicKey() {} DH_PublicKey(const DL_Group&, const BigInt&); private: - void X509_load_hook(RandomNumberGenerator&); + void X509_load_hook(); }; /************************************************* diff --git a/include/dl_algo.h b/include/dl_algo.h index f74deb34f..a8d8d1d51 100644 --- a/include/dl_algo.h +++ b/include/dl_algo.h @@ -29,12 +29,12 @@ class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key virtual DL_Group::Format group_format() const = 0; X509_Encoder* x509_encoder() const; - X509_Decoder* x509_decoder(RandomNumberGenerator&); + X509_Decoder* x509_decoder(); protected: BigInt y; DL_Group group; private: - virtual void X509_load_hook(RandomNumberGenerator&) {} + virtual void X509_load_hook() {} }; /************************************************* diff --git a/include/dsa.h b/include/dsa.h index 429d55b7c..59776147b 100644 --- a/include/dsa.h +++ b/include/dsa.h @@ -32,7 +32,7 @@ class BOTAN_DLL DSA_PublicKey : public PK_Verifying_wo_MR_Key, protected: DSA_Core core; private: - void X509_load_hook(RandomNumberGenerator&); + void X509_load_hook(); }; /************************************************* diff --git a/include/elgamal.h b/include/elgamal.h index c85f6986e..feeeb3953 100644 --- a/include/elgamal.h +++ b/include/elgamal.h @@ -30,7 +30,7 @@ class BOTAN_DLL ElGamal_PublicKey : public PK_Encrypting_Key, protected: ELG_Core core; private: - void X509_load_hook(RandomNumberGenerator&); + void X509_load_hook(); }; /************************************************* diff --git a/include/if_algo.h b/include/if_algo.h index eb94c7dfe..c5da4073e 100644 --- a/include/if_algo.h +++ b/include/if_algo.h @@ -26,9 +26,9 @@ class BOTAN_DLL IF_Scheme_PublicKey : public virtual Public_Key u32bit max_input_bits() const { return (n.bits() - 1); } X509_Encoder* x509_encoder() const; - X509_Decoder* x509_decoder(RandomNumberGenerator&); + X509_Decoder* x509_decoder(); protected: - virtual void X509_load_hook(RandomNumberGenerator&); + virtual void X509_load_hook(); BigInt n, e; IF_Core core; }; diff --git a/include/nr.h b/include/nr.h index 2dcbccd20..0b68340d6 100644 --- a/include/nr.h +++ b/include/nr.h @@ -32,7 +32,7 @@ class BOTAN_DLL NR_PublicKey : public PK_Verifying_with_MR_Key, protected: NR_Core core; private: - void X509_load_hook(RandomNumberGenerator&); + void X509_load_hook(); }; /************************************************* diff --git a/include/pk_core.h b/include/pk_core.h index d28e2315e..585c12ee4 100644 --- a/include/pk_core.h +++ b/include/pk_core.h @@ -91,8 +91,10 @@ class BOTAN_DLL ELG_Core ELG_Core() { op = 0; } ELG_Core(const ELG_Core&); + + ELG_Core(const DL_Group&, const BigInt&); ELG_Core(RandomNumberGenerator&, const DL_Group&, - const BigInt&, const BigInt& = 0); + const BigInt&, const BigInt&); ~ELG_Core() { delete op; } private: diff --git a/include/pk_keys.h b/include/pk_keys.h index 3c0951a1a..16109c634 100644 --- a/include/pk_keys.h +++ b/include/pk_keys.h @@ -28,10 +28,8 @@ class BOTAN_DLL Public_Key virtual u32bit message_part_size() const { return 0; } virtual u32bit max_input_bits() const = 0; - virtual class X509_Encoder* x509_encoder() const - { return 0; } - virtual class X509_Decoder* x509_decoder(RandomNumberGenerator&) - { return 0; } + virtual class X509_Encoder* x509_encoder() const = 0; + virtual class X509_Decoder* x509_decoder() = 0; virtual ~Public_Key() {} protected: diff --git a/include/rsa.h b/include/rsa.h index 7ca8068f9..445902a6f 100644 --- a/include/rsa.h +++ b/include/rsa.h @@ -1,6 +1,6 @@ /************************************************* * RSA Header File * -* (C) 1999-2007 Jack Lloyd * +* (C) 1999-2008 Jack Lloyd * *************************************************/ #ifndef BOTAN_RSA_H__ @@ -48,9 +48,12 @@ class BOTAN_DLL RSA_PrivateKey : public RSA_PublicKey, bool check_key(RandomNumberGenerator& rng, bool) const; RSA_PrivateKey() {} - RSA_PrivateKey(const BigInt&, const BigInt&, const BigInt&, - const BigInt& = 0, const BigInt& = 0); - RSA_PrivateKey(u32bit, RandomNumberGenerator&, u32bit = 65537); + + RSA_PrivateKey(RandomNumberGenerator&, + const BigInt& p, const BigInt& q, const BigInt& e, + const BigInt& d = 0, const BigInt& n = 0); + + RSA_PrivateKey(RandomNumberGenerator&, u32bit bits, u32bit = 65537); private: BigInt private_op(const byte[], u32bit) const; }; diff --git a/include/rw.h b/include/rw.h index 2cc2fb6a4..d9f95eaa9 100644 --- a/include/rw.h +++ b/include/rw.h @@ -41,9 +41,12 @@ class BOTAN_DLL RW_PrivateKey : public RW_PublicKey, bool check_key(RandomNumberGenerator& rng, bool) const; RW_PrivateKey() {} - RW_PrivateKey(const BigInt&, const BigInt&, const BigInt&, + + RW_PrivateKey(RandomNumberGenerator&, + const BigInt&, const BigInt&, const BigInt&, const BigInt& = 0, const BigInt& = 0); - RW_PrivateKey(u32bit, RandomNumberGenerator& rng, u32bit = 2); + + RW_PrivateKey(RandomNumberGenerator& rng, u32bit bits, u32bit = 2); }; } |