aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/elgamal/elgamal.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-04 18:45:24 +0000
committerlloyd <[email protected]>2010-03-04 18:45:24 +0000
commitc17ef3dd93bddc7afe3cee1cc4a413f21e93793c (patch)
tree4c288fe990cd858255a56aa9aef9987f39270301 /src/pubkey/elgamal/elgamal.h
parent12eea3fc8bbe46ec2d0db20262b21df3e4b7c160 (diff)
Remove ElGamal load hook functions
Diffstat (limited to 'src/pubkey/elgamal/elgamal.h')
-rw-r--r--src/pubkey/elgamal/elgamal.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/pubkey/elgamal/elgamal.h b/src/pubkey/elgamal/elgamal.h
index 92adf108d..3ae8f3a6b 100644
--- a/src/pubkey/elgamal/elgamal.h
+++ b/src/pubkey/elgamal/elgamal.h
@@ -23,21 +23,20 @@ class BOTAN_DLL ElGamal_PublicKey : public PK_Encrypting_Key,
std::string algo_name() const { return "ElGamal"; }
DL_Group::Format group_format() const { return DL_Group::ANSI_X9_42; }
- SecureVector<byte> encrypt(const byte[], u32bit,
+ u32bit max_input_bits() const { return (group_p().bits() - 1); }
+
+ SecureVector<byte> encrypt(const byte msg[], u32bit msg_len,
RandomNumberGenerator& rng) const;
- u32bit max_input_bits() const;
ElGamal_PublicKey(const AlgorithmIdentifier& alg_id,
const MemoryRegion<byte>& key_bits) :
DL_Scheme_PublicKey(alg_id, key_bits, DL_Group::ANSI_X9_42)
- { X509_load_hook(); }
+ { core = ELG_Core(group, y); }
- ElGamal_PublicKey(const DL_Group&, const BigInt&);
+ ElGamal_PublicKey(const DL_Group& group, const BigInt& y);
protected:
ElGamal_PublicKey() {}
ELG_Core core;
- private:
- void X509_load_hook();
};
/*
@@ -48,22 +47,17 @@ class BOTAN_DLL ElGamal_PrivateKey : public ElGamal_PublicKey,
public virtual DL_Scheme_PrivateKey
{
public:
- SecureVector<byte> decrypt(const byte[], u32bit) const;
+ SecureVector<byte> decrypt(const byte msg[], u32bit msg_len) const;
bool check_key(RandomNumberGenerator& rng, bool) const;
ElGamal_PrivateKey(const AlgorithmIdentifier& alg_id,
const MemoryRegion<byte>& key_bits,
- RandomNumberGenerator& rng) :
- DL_Scheme_PrivateKey(alg_id, key_bits, DL_Group::ANSI_X9_42)
- {
- PKCS8_load_hook(rng);
- }
+ RandomNumberGenerator& rng);
- ElGamal_PrivateKey(RandomNumberGenerator&, const DL_Group&,
- const BigInt& = 0);
- private:
- void PKCS8_load_hook(RandomNumberGenerator&, bool = false);
+ ElGamal_PrivateKey(RandomNumberGenerator& rng,
+ const DL_Group& group,
+ const BigInt& priv_key = 0);
};
}