From 54fecdc60438d15f970055bb691e18c6469e1785 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 10 Jun 2008 18:14:54 +0000 Subject: PK_Encryptor::encrypt now takes a RandomNumberGenerator reference, instead of using the global RNG object. --- include/pubkey.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include/pubkey.h') 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 encrypt(const byte[], u32bit) const; - SecureVector encrypt(const MemoryRegion&) const; + SecureVector encrypt(const byte[], u32bit, + RandomNumberGenerator&) const; + SecureVector encrypt(const MemoryRegion&, + RandomNumberGenerator&) const; + virtual u32bit maximum_input_size() const = 0; virtual ~PK_Encryptor() {} private: - virtual SecureVector enc(const byte[], u32bit) const = 0; + virtual SecureVector 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 enc(const byte[], u32bit) const; + SecureVector enc(const byte[], u32bit, + RandomNumberGenerator& rng) const; + const PK_Encrypting_Key& key; const EME* encoder; }; -- cgit v1.2.3