aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/elgamal/elgamal.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-04 10:04:02 -0400
committerJack Lloyd <[email protected]>2016-10-07 19:27:56 -0400
commit25b6fb53eec30620d084411fb1dbc8913142fc6d (patch)
tree6ffa291a3f4a74cac23bce304a42f4c26e33bcda /src/lib/pubkey/elgamal/elgamal.h
parent62cd6e3651711f759f870460599596ff5be904a5 (diff)
Remove Algo_Registry usage from public key code.
Instead the key types exposes operations like `create_encryption_op` which will return the relevant operation if the algorithm supports it. Changes pubkey.h interface, now RNG is passed at init time. Blinder previous created its own RNG, now it takes it from app.
Diffstat (limited to 'src/lib/pubkey/elgamal/elgamal.h')
-rw-r--r--src/lib/pubkey/elgamal/elgamal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/pubkey/elgamal/elgamal.h b/src/lib/pubkey/elgamal/elgamal.h
index 9f287158d..8ca4facc2 100644
--- a/src/lib/pubkey/elgamal/elgamal.h
+++ b/src/lib/pubkey/elgamal/elgamal.h
@@ -29,6 +29,12 @@ class BOTAN_DLL ElGamal_PublicKey : public virtual DL_Scheme_PublicKey
{}
ElGamal_PublicKey(const DL_Group& group, const BigInt& y);
+
+ std::unique_ptr<PK_Ops::Encryption>
+ create_encryption_op(RandomNumberGenerator& rng,
+ const std::string& params,
+ const std::string& provider) const override;
+
protected:
ElGamal_PublicKey() {}
};
@@ -49,6 +55,11 @@ class BOTAN_DLL ElGamal_PrivateKey : public ElGamal_PublicKey,
ElGamal_PrivateKey(RandomNumberGenerator& rng,
const DL_Group& group,
const BigInt& priv_key = 0);
+
+ std::unique_ptr<PK_Ops::Decryption>
+ create_decryption_op(RandomNumberGenerator& rng,
+ const std::string& params,
+ const std::string& provider) const override;
};
}