Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH > Class Template Reference

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

#include <fhmqv.h>

Inheritance diagram for FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >:
[legend]
Collaboration diagram for FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >:
[legend]

Public Types

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

Public Member Functions

virtual ~FHMQV_Domain ()
 
 FHMQV_Domain (bool clientRole=true)
 
 FHMQV_Domain (const GroupParameters &params, bool clientRole=true)
 
 FHMQV_Domain (BufferedTransformation &bt, bool clientRole=true)
 
template<class T1 >
 FHMQV_Domain (T1 v1, bool clientRole=true)
 
template<class T1 , class T2 >
 FHMQV_Domain (T1 v1, T2 v2, bool clientRole=true)
 
template<class T1 , class T2 , class T3 >
 FHMQV_Domain (T1 v1, T2 v2, T3 v3, bool clientRole=true)
 
template<class T1 , class T2 , class T3 , class T4 >
 FHMQV_Domain (T1 v1, T2 v2, T3 v3, T4 v4, bool clientRole=true)
 
const GroupParametersGetGroupParameters () const
 
GroupParametersAccessGroupParameters ()
 
CryptoParametersAccessCryptoParameters ()
 Retrieves a reference to Crypto Parameters. More...
 
unsigned int AgreedValueLength () const
 return length of agreed value produced More...
 
unsigned int StaticPrivateKeyLength () const
 return length of static private keys in this domain More...
 
unsigned int StaticPublicKeyLength () const
 return length of static public keys in this domain More...
 
void GenerateStaticPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const
 generate static private key More...
 
void GenerateStaticPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
 generate static public key More...
 
unsigned int EphemeralPrivateKeyLength () const
 Provides the size of ephemeral private key. More...
 
unsigned int EphemeralPublicKeyLength () const
 Provides the size of ephemeral public key. More...
 
void GenerateEphemeralPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const
 return length of ephemeral private keys in this domain More...
 
void GenerateEphemeralPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
 return length of ephemeral public keys in this domain More...
 
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 More...
 
- Public Member Functions inherited from AuthenticatedKeyAgreementDomain
virtual ~AuthenticatedKeyAgreementDomain ()
 
virtual void GenerateStaticKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
 Generate a static private/public key pair. More...
 
virtual void GenerateEphemeralKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
 Generate private/public key pair. More...
 
- Public Member Functions inherited from KeyAgreementAlgorithm
virtual ~KeyAgreementAlgorithm ()
 
CryptoMaterialAccessMaterial ()
 Retrieves a reference to Crypto Parameters. More...
 
const CryptoMaterialGetMaterial () const
 Retrieves a reference to Crypto Parameters. More...
 
virtual const CryptoParametersGetCryptoParameters () const
 Retrieves a reference to Crypto Parameters. More...
 
- Public Member Functions inherited from AsymmetricAlgorithm
virtual ~AsymmetricAlgorithm ()
 
void BERDecode (BufferedTransformation &bt)
 Loads this object from a BufferedTransformation. More...
 
void DEREncode (BufferedTransformation &bt) const
 Saves this object to a BufferedTransformation. More...
 
- Public Member Functions inherited from Algorithm
virtual ~Algorithm ()
 
 Algorithm (bool checkSelfTestStatus=true)
 Interface for all crypto algorithms. More...
 
virtual std::string AlgorithmName () const
 Provides the name of this algorithm. More...
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()
 
virtual ClonableClone () const
 Copies this object. More...
 

Protected Member Functions

void Hash (const Element *sigma, const byte *e1, size_t e1len, const byte *e2, size_t e2len, const byte *s1, size_t s1len, const byte *s2, size_t s2len, byte *digest, size_t dlen) const
 

Private Types

enum  KeyAgreementRole { RoleServer = 1, RoleClient }
 

Private Member Functions

DL_GroupParameters< Element > & AccessAbstractGroupParameters ()
 
const DL_GroupParameters< Element > & GetAbstractGroupParameters () const
 

Private Attributes

GroupParameters m_groupParameters
 
KeyAgreementRole m_role
 

Detailed Description

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

Fully Hashed Menezes-Qu-Vanstone in GF(p)

This implementation follows Augustin P. Sarr and Philippe Elbaz–Vincent, and Jean–Claude Bajard's A Secure and Efficient Authenticated Diffie-Hellman Protocol. Note: this is FHMQV, Protocol 5, from page 11; and not FHMQV-C.

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

Definition at line 24 of file fhmqv.h.

Member Typedef Documentation

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

Definition at line 29 of file fhmqv.h.

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

Definition at line 28 of file fhmqv.h.

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

Definition at line 27 of file fhmqv.h.

Member Enumeration Documentation

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
enum FHMQV_Domain::KeyAgreementRole
private
Enumerator
RoleServer 
RoleClient 

Definition at line 283 of file fhmqv.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file fhmqv.h.

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

Definition at line 33 of file fhmqv.h.

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

Definition at line 35 of file fhmqv.h.

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

Definition at line 38 of file fhmqv.h.

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

Definition at line 43 of file fhmqv.h.

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

Definition at line 48 of file fhmqv.h.

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

Definition at line 53 of file fhmqv.h.

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

Definition at line 58 of file fhmqv.h.

Member Function Documentation

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
DL_GroupParameters<Element>& FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::AccessAbstractGroupParameters ( )
inlineprivate

Definition at line 285 of file fhmqv.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
CryptoParameters& FHMQV_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 67 of file fhmqv.h.

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

Definition at line 65 of file fhmqv.h.

Here is the caller graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
bool FHMQV_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 124 of file fhmqv.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

return length of agreed value produced

Implements AuthenticatedKeyAgreementDomain.

Definition at line 70 of file fhmqv.h.

Here is the caller graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int FHMQV_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 95 of file fhmqv.h.

Here is the caller graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int FHMQV_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 96 of file fhmqv.h.

Here is the caller graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void FHMQV_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 99 of file fhmqv.h.

Here is the call graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void FHMQV_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 109 of file fhmqv.h.

Here is the call graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void FHMQV_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 78 of file fhmqv.h.

Here is the call graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void FHMQV_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 86 of file fhmqv.h.

Here is the call graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
const DL_GroupParameters<Element>& FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::GetAbstractGroupParameters ( ) const
inlineprivate

Definition at line 286 of file fhmqv.h.

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

Definition at line 64 of file fhmqv.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
void FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::Hash ( const Element sigma,
const byte e1,
size_t  e1len,
const byte e2,
size_t  e2len,
const byte s1,
size_t  s1len,
const byte s2,
size_t  s2len,
byte digest,
size_t  dlen 
) const
inlineprotected

Definition at line 242 of file fhmqv.h.

Here is the call graph for this function:

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

return length of static private keys in this domain

Implements AuthenticatedKeyAgreementDomain.

Definition at line 72 of file fhmqv.h.

Here is the caller graph for this function:

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

return length of static public keys in this domain

Implements AuthenticatedKeyAgreementDomain.

Definition at line 74 of file fhmqv.h.

Here is the caller graph for this function:

Member Data Documentation

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
GroupParameters FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::m_groupParameters
private

Definition at line 288 of file fhmqv.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
KeyAgreementRole FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::m_role
private

Definition at line 289 of file fhmqv.h.


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