diff options
author | lloyd <[email protected]> | 2008-06-10 18:14:54 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-10 18:14:54 +0000 |
commit | 54fecdc60438d15f970055bb691e18c6469e1785 (patch) | |
tree | 1bd44b39489876256adf3d9a0f4ae88e88cfc9d5 /include | |
parent | dec416d649715617e0eb66b18d69f6dbe9c308b3 (diff) |
PK_Encryptor::encrypt now takes a RandomNumberGenerator reference, instead
of using the global RNG object.
Diffstat (limited to 'include')
-rw-r--r-- | include/dlies.h | 3 | ||||
-rw-r--r-- | include/pubkey.h | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/include/dlies.h b/include/dlies.h index 703f17656..ef0f4d493 100644 --- a/include/dlies.h +++ b/include/dlies.h @@ -21,7 +21,8 @@ class BOTAN_DLL DLIES_Encryptor : public PK_Encryptor const std::string& = "HMAC(SHA-160)", u32bit = 20); void set_other_key(const MemoryRegion<byte>&); private: - SecureVector<byte> enc(const byte[], u32bit) const; + SecureVector<byte> enc(const byte[], u32bit, + RandomNumberGenerator&) const; u32bit maximum_input_size() const; const PK_Key_Agreement_Key& key; SecureVector<byte> other_key; diff --git a/include/pubkey.h b/include/pubkey.h index e4ea4e848..a5d332241 100644 --- a/include/pubkey.h +++ b/include/pubkey.h @@ -20,12 +20,16 @@ enum Signature_Format { IEEE_1363, DER_SEQUENCE }; class BOTAN_DLL PK_Encryptor { public: - SecureVector<byte> encrypt(const byte[], u32bit) const; - SecureVector<byte> encrypt(const MemoryRegion<byte>&) const; + SecureVector<byte> encrypt(const byte[], u32bit, + RandomNumberGenerator&) const; + SecureVector<byte> encrypt(const MemoryRegion<byte>&, + RandomNumberGenerator&) const; + virtual u32bit maximum_input_size() const = 0; virtual ~PK_Encryptor() {} private: - virtual SecureVector<byte> enc(const byte[], u32bit) const = 0; + virtual SecureVector<byte> enc(const byte[], u32bit, + RandomNumberGenerator&) const = 0; }; /************************************************* @@ -124,7 +128,9 @@ class BOTAN_DLL PK_Encryptor_MR_with_EME : public PK_Encryptor PK_Encryptor_MR_with_EME(const PK_Encrypting_Key&, const std::string&); ~PK_Encryptor_MR_with_EME() { delete encoder; } private: - SecureVector<byte> enc(const byte[], u32bit) const; + SecureVector<byte> enc(const byte[], u32bit, + RandomNumberGenerator& rng) const; + const PK_Encrypting_Key& key; const EME* encoder; }; |