22 template <
class GROUP_PARAMETERS,
class COFACTOR_OPTION = CPP_TYPENAME GROUP_PARAMETERS::DefaultCofactorOption>
28 typedef GROUP_PARAMETERS GroupParameters;
29 typedef typename GroupParameters::Element Element;
39 : m_groupParameters(params) {}
44 {m_groupParameters.BERDecode(bt);}
53 {m_groupParameters.Initialize(v1, v2);}
62 template <
class T2,
class T3>
64 {m_groupParameters.Initialize(v1, v2, v3);}
75 template <
class T2,
class T3,
class T4>
77 {m_groupParameters.Initialize(v1, v2, v3, v4);}
85 template <
class T1,
class T2>
87 {m_groupParameters.Initialize(v1, v2);}
97 template <
class T1,
class T2,
class T3>
99 {m_groupParameters.Initialize(v1, v2, v3);}
111 template <
class T1,
class T2,
class T3,
class T4>
112 DH_Domain(
const T1 &v1,
const T2 &v2,
const T3 &v3,
const T4 &v4)
113 {m_groupParameters.Initialize(v1, v2, v3, v4);}
144 bool agreed1 = this->
Agree(agreedValue, privateKey, publicKey2);
145 bool agreed2 = this->
Agree(agreedValue2, privateKey2, publicKey);
147 if (!agreed1 || !agreed2 || agreedValue != agreedValue2)
152 static std::string CRYPTOPP_API StaticAlgorithmName()
153 {
return GroupParameters::StaticAlgorithmNamePrefix() + DH_Algorithm::StaticAlgorithmName();}
156 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 164 {
return m_groupParameters;}
166 GroupParameters m_groupParameters;
const GroupParameters & GetGroupParameters() const
Retrieves the group parameters for this domain.
Restricts the instantiation of a class to one static object without locks.
Interface for Discrete Log (DL) group parameters.
DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3, const T4 &v4)
Construct a Diffie-Hellman domain.
DH_Domain(BufferedTransformation &bt)
Construct a Diffie-Hellman domain.
Abstract base classes that provide a uniform interface to this library.
Interface for random number generators.
std::string AlgorithmName() const
Provides the name of this algorithm.
void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const
Classes for performing mathematics over different fields.
unsigned int AgreedValueLength() const
DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
Construct a Diffie-Hellman domain.
bool FIPS_140_2_ComplianceEnabled()
Determines whether the library provides FIPS validated cryptography.
DH_Domain(RandomNumberGenerator &v1, const T2 &v2)
Construct a Diffie-Hellman domain.
void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
Generate a public key from a private key in this domain.
void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
Generate a public key from a private key in this domain.
Exception thrown when a crypto algorithm is used after a self test fails.
Implementation of schemes based on DL over GF(p)
unsigned int PublicKeyLength() const
bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const
DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3)
Construct a Diffie-Hellman domain.
DH_Domain(const GroupParameters ¶ms)
Construct a Diffie-Hellman domain.
DH_Domain< DL_GroupParameters_GFP_DefaultSafePrime > DH
Diffie-Hellman in GF(p) with key validation
DH_Domain()
Construct a Diffie-Hellman domain.
DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3)
Construct a Diffie-Hellman domain.
unsigned int PrivateKeyLength() const
Crypto++ library namespace.
GroupParameters & AccessGroupParameters()
Retrieves the group parameters for this domain.
Interface for DL key agreement algorithms.
Discrete Log (DL) simple key agreement base implementation.
DH_Domain(const T1 &v1, const T2 &v2)
Construct a Diffie-Hellman domain.