diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2005-01-20 04:19:35 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2005-01-20 04:19:35 +0000 |
commit | 242d67fb17619670d9b757c442dcf2e26d8478a1 (patch) | |
tree | 1f61e8bf59450a028415e5a3f08565a6ceb86afe /elgamal.h | |
parent | 4b85e6cac0d84aaf65d0695adb137ae956e4e241 (diff) | |
download | cryptopp-242d67fb17619670d9b757c442dcf2e26d8478a1.tar.gz |
changes done for FIPS-140 lab code drop
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@195 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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; |