Crypto++ 8.2
Free C&
Public Types | Public Member Functions | List of all members
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH > Class Template Reference

Hashed Menezes-Qu-Vanstone in GF(p) More...

#include <hmqv.h>

+ Inheritance diagram for HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >:

Public Types

typedef GROUP_PARAMETERS GroupParameters
 
typedef GroupParameters::Element Element
 
typedef HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH > Domain
 

Public Member Functions

 HMQV_Domain (bool clientRole=true)
 
 HMQV_Domain (const GroupParameters &params, bool clientRole=true)
 
 HMQV_Domain (BufferedTransformation &bt, bool clientRole=true)
 
template<class T1 >
 HMQV_Domain (T1 v1, bool clientRole=true)
 
template<class T1 , class T2 >
 HMQV_Domain (T1 v1, T2 v2, bool clientRole=true)
 
template<class T1 , class T2 , class T3 >
 HMQV_Domain (T1 v1, T2 v2, T3 v3, bool clientRole=true)
 
template<class T1 , class T2 , class T3 , class T4 >
 HMQV_Domain (T1 v1, T2 v2, T3 v3, T4 v4, bool clientRole=true)
 
const GroupParameters & GetGroupParameters () const
 
GroupParameters & AccessGroupParameters ()
 
CryptoParametersAccessCryptoParameters ()
 Retrieves a reference to Crypto Parameters.
 
unsigned int AgreedValueLength () const
 return length of agreed value produced
 
unsigned int StaticPrivateKeyLength () const
 return length of static private keys in this domain
 
unsigned int StaticPublicKeyLength () const
 return length of static public keys in this domain
 
void GenerateStaticPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const
 generate static private key
 
void GenerateStaticPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
 generate static public key
 
unsigned int EphemeralPrivateKeyLength () const
 Provides the size of ephemeral private key.
 
unsigned int EphemeralPublicKeyLength () const
 Provides the size of ephemeral public key.
 
void GenerateEphemeralPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const
 return length of ephemeral private keys in this domain
 
void GenerateEphemeralPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
 return length of ephemeral public keys in this domain
 
bool Agree (byte *agreedValue, const byte *staticPrivateKey, const byte *ephemeralPrivateKey, const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, bool validateStaticOtherPublicKey=true) const
 derive agreed value from your private keys and couterparty's public keys, return false in case of failure
 
- Public Member Functions inherited from AuthenticatedKeyAgreementDomain
virtual unsigned int AgreedValueLength () const =0
 Provides the size of the agreed value.
 
virtual unsigned int StaticPrivateKeyLength () const =0
 Provides the size of the static private key.
 
virtual unsigned int StaticPublicKeyLength () const =0
 Provides the size of the static public key.
 
virtual void GenerateStaticPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const =0
 Generate static private key in this domain.
 
virtual void GenerateStaticPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0
 Generate a static public key from a private key in this domain.
 
virtual void GenerateStaticKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
 Generate a static private/public key pair.
 
virtual unsigned int EphemeralPrivateKeyLength () const =0
 Provides the size of ephemeral private key.
 
virtual unsigned int EphemeralPublicKeyLength () const =0
 Provides the size of ephemeral public key.
 
virtual void GenerateEphemeralPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const =0
 Generate ephemeral private key.
 
virtual void GenerateEphemeralPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0
 Generate ephemeral public key.
 
virtual void GenerateEphemeralKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
 Generate private/public key pair.
 
virtual bool Agree (byte *agreedValue, const byte *staticPrivateKey, const byte *ephemeralPrivateKey, const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, bool validateStaticOtherPublicKey=true) const =0
 Derive agreed value.
 
- Public Member Functions inherited from KeyAgreementAlgorithm
CryptoMaterialAccessMaterial ()
 Retrieves a reference to Crypto Parameters.
 
const CryptoMaterialGetMaterial () const
 Retrieves a reference to Crypto Parameters.
 
virtual CryptoParametersAccessCryptoParameters ()=0
 Retrieves a reference to Crypto Parameters.
 
virtual const CryptoParametersGetCryptoParameters () const
 Retrieves a reference to Crypto Parameters.
 
virtual CryptoMaterialAccessMaterial ()=0
 Retrieves a reference to CryptoMaterial.
 
virtual const CryptoMaterialGetMaterial () const =0
 Retrieves a reference to CryptoMaterial.
 
- Public Member Functions inherited from Algorithm
 Algorithm (bool checkSelfTestStatus=true)
 Interface for all crypto algorithms.
 
virtual std::string AlgorithmName () const
 Provides the name of this algorithm.
 
virtual std::string AlgorithmProvider () const
 Retrieve the provider of this algorithm.
 
- Public Member Functions inherited from Clonable
virtual ClonableClone () const
 Copies this object.
 

Detailed Description

template<class GROUP_PARAMETERS, class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
class HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >

Hashed Menezes-Qu-Vanstone in GF(p)

This implementation follows Hugo Krawczyk's HMQV: A High-Performance Secure Diffie-Hellman Protocol. Note: this implements HMQV only. HMQV-C with Key Confirmation is not provided.

See also
MQV, HMQV, FHMQV, and AuthenticatedKeyAgreementDomain
Since
Crypto++ 5.6.4

Definition at line 23 of file hmqv.h.

Member Typedef Documentation

◆ GroupParameters

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
typedef GROUP_PARAMETERS HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::GroupParameters

Definition at line 26 of file hmqv.h.

◆ Element

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
typedef GroupParameters::Element HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::Element

Definition at line 27 of file hmqv.h.

◆ Domain

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
typedef HMQV_Domain<GROUP_PARAMETERS, COFACTOR_OPTION, HASH> HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::Domain

Definition at line 28 of file hmqv.h.

Constructor & Destructor Documentation

◆ ~HMQV_Domain()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
virtual HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::~HMQV_Domain ( )
inlinevirtual

Definition at line 30 of file hmqv.h.

◆ HMQV_Domain() [1/7]

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::HMQV_Domain ( bool  clientRole = true)
inline

Definition at line 32 of file hmqv.h.

◆ HMQV_Domain() [2/7]

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::HMQV_Domain ( const GroupParameters &  params,
bool  clientRole = true 
)
inline

Definition at line 34 of file hmqv.h.

◆ HMQV_Domain() [3/7]

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::HMQV_Domain ( BufferedTransformation bt,
bool  clientRole = true 
)
inline

Definition at line 37 of file hmqv.h.

◆ HMQV_Domain() [4/7]

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
template<class T1 >
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::HMQV_Domain ( T1  v1,
bool  clientRole = true 
)
inline

Definition at line 42 of file hmqv.h.

◆ HMQV_Domain() [5/7]

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
template<class T1 , class T2 >
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::HMQV_Domain ( T1  v1,
T2  v2,
bool  clientRole = true 
)
inline

Definition at line 47 of file hmqv.h.

◆ HMQV_Domain() [6/7]

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
template<class T1 , class T2 , class T3 >
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::HMQV_Domain ( T1  v1,
T2  v2,
T3  v3,
bool  clientRole = true 
)
inline

Definition at line 52 of file hmqv.h.

◆ HMQV_Domain() [7/7]

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
template<class T1 , class T2 , class T3 , class T4 >
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::HMQV_Domain ( T1  v1,
T2  v2,
T3  v3,
T4  v4,
bool  clientRole = true 
)
inline

Definition at line 57 of file hmqv.h.

Member Function Documentation

◆ GetGroupParameters()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
const GroupParameters & HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::GetGroupParameters ( ) const
inline

Definition at line 63 of file hmqv.h.

◆ AccessGroupParameters()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
GroupParameters & HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::AccessGroupParameters ( )
inline

Definition at line 64 of file hmqv.h.

◆ AccessCryptoParameters()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
CryptoParameters & HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::AccessCryptoParameters ( )
inlinevirtual

Retrieves a reference to Crypto Parameters.

Returns
a reference the crypto parameters

Implements KeyAgreementAlgorithm.

Definition at line 66 of file hmqv.h.

◆ AgreedValueLength()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::AgreedValueLength ( ) const
inlinevirtual

return length of agreed value produced

Implements AuthenticatedKeyAgreementDomain.

Definition at line 69 of file hmqv.h.

◆ StaticPrivateKeyLength()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::StaticPrivateKeyLength ( ) const
inlinevirtual

return length of static private keys in this domain

Implements AuthenticatedKeyAgreementDomain.

Definition at line 71 of file hmqv.h.

◆ StaticPublicKeyLength()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::StaticPublicKeyLength ( ) const
inlinevirtual

return length of static public keys in this domain

Implements AuthenticatedKeyAgreementDomain.

Definition at line 73 of file hmqv.h.

◆ GenerateStaticPrivateKey()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::GenerateStaticPrivateKey ( RandomNumberGenerator rng,
byte *  privateKey 
) const
inlinevirtual

generate static private key

Precondition
size of privateKey == PrivateStaticKeyLength()

Implements AuthenticatedKeyAgreementDomain.

Definition at line 77 of file hmqv.h.

◆ GenerateStaticPublicKey()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::GenerateStaticPublicKey ( RandomNumberGenerator rng,
const byte *  privateKey,
byte *  publicKey 
) const
inlinevirtual

generate static public key

Precondition
size of publicKey == PublicStaticKeyLength()

Implements AuthenticatedKeyAgreementDomain.

Definition at line 85 of file hmqv.h.

◆ EphemeralPrivateKeyLength()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::EphemeralPrivateKeyLength ( ) const
inlinevirtual

Provides the size of ephemeral private key.

Returns
the size of ephemeral private key in this domain

Implements AuthenticatedKeyAgreementDomain.

Definition at line 94 of file hmqv.h.

◆ EphemeralPublicKeyLength()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::EphemeralPublicKeyLength ( ) const
inlinevirtual

Provides the size of ephemeral public key.

Returns
the size of ephemeral public key in this domain

Implements AuthenticatedKeyAgreementDomain.

Definition at line 95 of file hmqv.h.

◆ GenerateEphemeralPrivateKey()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::GenerateEphemeralPrivateKey ( RandomNumberGenerator rng,
byte *  privateKey 
) const
inlinevirtual

return length of ephemeral private keys in this domain

Implements AuthenticatedKeyAgreementDomain.

Definition at line 98 of file hmqv.h.

◆ GenerateEphemeralPublicKey()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::GenerateEphemeralPublicKey ( RandomNumberGenerator rng,
const byte *  privateKey,
byte *  publicKey 
) const
inlinevirtual

return length of ephemeral public keys in this domain

Implements AuthenticatedKeyAgreementDomain.

Definition at line 108 of file hmqv.h.

◆ Agree()

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
bool HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::Agree ( byte *  agreedValue,
const byte *  staticPrivateKey,
const byte *  ephemeralPrivateKey,
const byte *  staticOtherPublicKey,
const byte *  ephemeralOtherPublicKey,
bool  validateStaticOtherPublicKey = true 
) const
inlinevirtual

derive agreed value from your private keys and couterparty's public keys, return false in case of failure

Note
The ephemeral public key will always be validated. If you have previously validated the static public key, use validateStaticOtherPublicKey=false to save time.
Precondition
size of agreedValue == AgreedValueLength()
length of staticPrivateKey == StaticPrivateKeyLength()
length of ephemeralPrivateKey == EphemeralPrivateKeyLength()
length of staticOtherPublicKey == StaticPublicKeyLength()
length of ephemeralOtherPublicKey == EphemeralPublicKeyLength()

Implements AuthenticatedKeyAgreementDomain.

Definition at line 123 of file hmqv.h.


The documentation for this class was generated from the following file: