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;
#define NAMESPACE_BEGIN(x)
void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
Generate a static public key from a private key in this domain.
Abstract base classes that provide a uniform interface to this library.
DH2(SimpleKeyAgreementDomain &domain)
Construct a DH2.
void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const
Generate static private key in this domain.
Interface for random number generators.
CryptoParameters & AccessCryptoParameters()
Retrieves a reference to Crypto Parameters.
DH2(SimpleKeyAgreementDomain &staticDomain, SimpleKeyAgreementDomain &ephemeralDomain)
Construct a DH2.
Interface for domains of simple key agreement protocols.
unsigned int AgreedValueLength() const
Provides the size of the agreed value.
unsigned int EphemeralPrivateKeyLength() const
Provides the size of ephemeral private key.
SimpleKeyAgreementDomain & d2
Unified Diffie-Hellman in GF(p)
void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
Generate a static private/public key pair.
void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
Generate ephemeral public key.
void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
Generate private/public key pair.
unsigned int StaticPublicKeyLength() const
Provides the size of the static public key.
Interface for crypto prameters.
unsigned int EphemeralPublicKeyLength() const
Provides the size of ephemeral public key.
Interface for domains of authenticated key agreement protocols.
void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const
Generate ephemeral private key.
unsigned int StaticPrivateKeyLength() const
Provides the size of the static private key.