diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-16 01:53:45 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-16 01:53:45 +0000 |
commit | 42c3d8f3aa593c224174558fd6f3d2709e08f7d0 (patch) | |
tree | 1f90c9ea7a31679b5c416408a3ffeba23e87d165 /elgamal.h | |
parent | 09326fa9f564c09ebecff7c56d0e33555dec65b6 (diff) | |
download | cryptopp-42c3d8f3aa593c224174558fd6f3d2709e08f7d0.tar.gz |
added support for using encoding parameters and key derivation parameters
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@98 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'elgamal.h')
-rw-r--r-- | elgamal.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -11,7 +11,7 @@ class CRYPTOPP_NO_VTABLE ElGamalBase : public DL_KeyAgreementAlgorithm_DH<Intege public DL_SymmetricEncryptionAlgorithm { public: - void Derive(const DL_GroupParameters<Integer> ¶ms, byte *derivedKey, unsigned int derivedLength, const Integer &agreedElement, const Integer &ephemeralPublicKey) const + void Derive(const DL_GroupParameters<Integer> &groupParams, byte *derivedKey, unsigned int derivedLength, const Integer &agreedElement, const Integer &ephemeralPublicKey, const NameValuePairs &derivationParams) const { agreedElement.Encode(derivedKey, derivedLength); } @@ -39,7 +39,7 @@ public: return 0; } - void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plainText, unsigned int plainTextLength, byte *cipherText) const + void SymmetricEncrypt(RandomNumberGenerator &rng, const byte *key, const byte *plainText, unsigned int plainTextLength, byte *cipherText, const NameValuePairs ¶meters) const { const Integer &p = GetGroupParameters().GetModulus(); unsigned int modulusLen = p.ByteCount(); @@ -52,7 +52,7 @@ public: a_times_b_mod_c(Integer(key, modulusLen), Integer(block, modulusLen-1), p).Encode(cipherText, modulusLen); } - DecodingResult SymmetricDecrypt(const byte *key, const byte *cipherText, unsigned int cipherTextLength, byte *plainText) const + DecodingResult SymmetricDecrypt(const byte *key, const byte *cipherText, unsigned int cipherTextLength, byte *plainText, const NameValuePairs ¶meters) const { const Integer &p = GetGroupParameters().GetModulus(); unsigned int modulusLen = p.ByteCount(); @@ -106,14 +106,14 @@ struct ElGamal static const char * StaticAlgorithmName() {return "ElgamalEnc/Crypto++Padding";} - class CRYPTOPP_NO_VTABLE EncryptorImpl : public ElGamalObjectImpl<DL_EncryptorBase<Integer, PK_FixedLengthEncryptor>, SchemeOptions, SchemeOptions::PublicKey>, public PublicKeyCopier<SchemeOptions> + class CRYPTOPP_NO_VTABLE EncryptorImpl : public ElGamalObjectImpl<DL_EncryptorBase<Integer>, SchemeOptions, SchemeOptions::PublicKey>, public PublicKeyCopier<SchemeOptions> { public: void CopyKeyInto(SchemeOptions::PublicKey &key) const {key = GetKey();} }; - class CRYPTOPP_NO_VTABLE DecryptorImpl : public ElGamalObjectImpl<DL_DecryptorBase<Integer, PK_FixedLengthDecryptor>, SchemeOptions, SchemeOptions::PrivateKey>, public PrivateKeyCopier<SchemeOptions> + class CRYPTOPP_NO_VTABLE DecryptorImpl : public ElGamalObjectImpl<DL_DecryptorBase<Integer>, SchemeOptions, SchemeOptions::PrivateKey>, public PrivateKeyCopier<SchemeOptions> { public: void CopyKeyInto(SchemeOptions::PublicKey &key) const |