summaryrefslogtreecommitdiff
path: root/elgamal.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-07-16 01:53:45 +0000
committerweidai <weidai11@users.noreply.github.com>2003-07-16 01:53:45 +0000
commit38b49e454399c81aac16279f78a834de26245bec (patch)
tree1f90c9ea7a31679b5c416408a3ffeba23e87d165 /elgamal.h
parent8cd6a9256d78953d6e99097fb4508a077e8e2ebe (diff)
downloadcryptopp-git-38b49e454399c81aac16279f78a834de26245bec.tar.gz
added support for using encoding parameters and key derivation parameters
Diffstat (limited to 'elgamal.h')
-rw-r--r--elgamal.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/elgamal.h b/elgamal.h
index 6835784e..1779f44f 100644
--- a/elgamal.h
+++ b/elgamal.h
@@ -11,7 +11,7 @@ class CRYPTOPP_NO_VTABLE ElGamalBase : public DL_KeyAgreementAlgorithm_DH<Intege
public DL_SymmetricEncryptionAlgorithm
{
public:
- void Derive(const DL_GroupParameters<Integer> &params, 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 &parameters) 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 &parameters) 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