diff options
author | weidai <weidai11@users.noreply.github.com> | 2005-01-20 04:19:35 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2005-01-20 04:19:35 +0000 |
commit | b3924f2108c0b0825060e91f6fde8202ce35624d (patch) | |
tree | 1f61e8bf59450a028415e5a3f08565a6ceb86afe /elgamal.h | |
parent | 79e29d0de49969af44474cc890cffd7b1d6b1a4b (diff) | |
download | cryptopp-git-b3924f2108c0b0825060e91f6fde8202ce35624d.tar.gz |
changes done for FIPS-140 lab code drop
Diffstat (limited to 'elgamal.h')
-rw-r--r-- | elgamal.h | 22 |
1 files changed, 3 insertions, 19 deletions
@@ -75,7 +75,7 @@ public: }; template <class BASE, class SCHEME_OPTIONS, class KEY> -class CRYPTOPP_NO_VTABLE ElGamalObjectImpl : public DL_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY>, public ElGamalBase +class ElGamalObjectImpl : public DL_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY>, public ElGamalBase { public: unsigned int FixedMaxPlaintextLength() const {return MaxPlaintextLength(FixedCiphertextLength());} @@ -106,27 +106,11 @@ struct ElGamal static const char * StaticAlgorithmName() {return "ElgamalEnc/Crypto++Padding";} - class EncryptorImpl : public ElGamalObjectImpl<DL_EncryptorBase<Integer>, SchemeOptions, SchemeOptions::PublicKey>, public PublicKeyCopier<SchemeOptions> - { - public: - void CopyKeyInto(SchemeOptions::PublicKey &key) const - {key = GetKey();} - }; - - class DecryptorImpl : public ElGamalObjectImpl<DL_DecryptorBase<Integer>, SchemeOptions, SchemeOptions::PrivateKey>, public PrivateKeyCopier<SchemeOptions> - { - public: - void CopyKeyInto(SchemeOptions::PublicKey &key) const - {GetKey().MakePublicKey(key);} - void CopyKeyInto(SchemeOptions::PrivateKey &key) const - {key = GetKey();} - }; - typedef SchemeOptions::GroupParameters GroupParameters; //! implements PK_Encryptor interface - typedef PK_FinalTemplate<EncryptorImpl> Encryptor; + typedef PK_FinalTemplate<ElGamalObjectImpl<DL_EncryptorBase<Integer>, SchemeOptions, SchemeOptions::PublicKey> > Encryptor; //! implements PK_Decryptor interface - typedef PK_FinalTemplate<DecryptorImpl> Decryptor; + typedef PK_FinalTemplate<ElGamalObjectImpl<DL_DecryptorBase<Integer>, SchemeOptions, SchemeOptions::PrivateKey> > Decryptor; }; typedef ElGamal::Encryptor ElGamalEncryptor; |