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