27 : d1(domain), d2(domain) {}
30 : d1(staticDomain), d2(ephemeralDomain) {}
35 {
return d1.AgreedValueLength() + d2.AgreedValueLength();}
38 {
return d1.PrivateKeyLength();}
40 {
return d1.PublicKeyLength();}
42 {d1.GeneratePrivateKey(rng, privateKey);}
44 {d1.GeneratePublicKey(rng, privateKey, publicKey);}
46 {d1.GenerateKeyPair(rng, privateKey, publicKey);}
49 {
return d2.PrivateKeyLength();}
51 {
return d2.PublicKeyLength();}
53 {d2.GeneratePrivateKey(rng, privateKey);}
55 {d2.GeneratePublicKey(rng, privateKey, publicKey);}
57 {d2.GenerateKeyPair(rng, privateKey, publicKey);}
59 bool Agree(
byte *agreedValue,
60 const byte *staticPrivateKey,
const byte *ephemeralPrivateKey,
61 const byte *staticOtherPublicKey,
const byte *ephemeralOtherPublicKey,
62 bool validateStaticOtherPublicKey=
true)
const;
Interface for domains of authenticated key agreement protocols.
Interface for crypto parameters.
Unified Diffie-Hellman in GF(p)
void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
Generate a static public key from a private key in this domain.
DH2(SimpleKeyAgreementDomain &staticDomain, SimpleKeyAgreementDomain &ephemeralDomain)
Construct a DH2.
unsigned int AgreedValueLength() const
Provides the size of the agreed value.
unsigned int StaticPrivateKeyLength() const
Provides the size of the static private key.
CryptoParameters & AccessCryptoParameters()
Retrieves a reference to Crypto Parameters.
unsigned int EphemeralPrivateKeyLength() const
Provides the size of ephemeral private key.
unsigned int EphemeralPublicKeyLength() const
Provides the size of ephemeral public key.
void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
Generate private/public key pair.
void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const
Generate ephemeral private key.
void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const
Generate static private key in this domain.
void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
Generate ephemeral public key.
unsigned int StaticPublicKeyLength() const
Provides the size of the static public key.
void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
Generate a static private/public key pair.
DH2(SimpleKeyAgreementDomain &domain)
Construct a DH2.
Interface for random number generators.
Interface for domains of simple key agreement protocols.
Abstract base classes that provide a uniform interface to this library.
Crypto++ library namespace.