aboutsummaryrefslogtreecommitdiffstats
path: root/include/pubkey.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-10 18:14:54 +0000
committerlloyd <[email protected]>2008-06-10 18:14:54 +0000
commit54fecdc60438d15f970055bb691e18c6469e1785 (patch)
tree1bd44b39489876256adf3d9a0f4ae88e88cfc9d5 /include/pubkey.h
parentdec416d649715617e0eb66b18d69f6dbe9c308b3 (diff)
PK_Encryptor::encrypt now takes a RandomNumberGenerator reference, instead
of using the global RNG object.
Diffstat (limited to 'include/pubkey.h')
-rw-r--r--include/pubkey.h14
1 files changed, 10 insertions, 4 deletions
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;
};