From 42c3d8f3aa593c224174558fd6f3d2709e08f7d0 Mon Sep 17 00:00:00 2001 From: weidai Date: Wed, 16 Jul 2003 01:53:45 +0000 Subject: 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 --- elgamal.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'elgamal.h') diff --git a/elgamal.h b/elgamal.h index 6835784..1779f44 100644 --- a/elgamal.h +++ b/elgamal.h @@ -11,7 +11,7 @@ class CRYPTOPP_NO_VTABLE ElGamalBase : public DL_KeyAgreementAlgorithm_DH ¶ms, byte *derivedKey, unsigned int derivedLength, const Integer &agreedElement, const Integer &ephemeralPublicKey) const + void Derive(const DL_GroupParameters &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, SchemeOptions, SchemeOptions::PublicKey>, public PublicKeyCopier + class CRYPTOPP_NO_VTABLE EncryptorImpl : public ElGamalObjectImpl, SchemeOptions, SchemeOptions::PublicKey>, public PublicKeyCopier { public: void CopyKeyInto(SchemeOptions::PublicKey &key) const {key = GetKey();} }; - class CRYPTOPP_NO_VTABLE DecryptorImpl : public ElGamalObjectImpl, SchemeOptions, SchemeOptions::PrivateKey>, public PrivateKeyCopier + class CRYPTOPP_NO_VTABLE DecryptorImpl : public ElGamalObjectImpl, SchemeOptions, SchemeOptions::PrivateKey>, public PrivateKeyCopier { public: void CopyKeyInto(SchemeOptions::PublicKey &key) const -- cgit v1.2.1