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

Diffie-Hellman domain. More...

#include <dh.h>

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

Public Types

typedef GROUP_PARAMETERS GroupParameters
 
typedef GroupParameters::Element Element
 
typedef DL_KeyAgreementAlgorithm_DH< Element, COFACTOR_OPTION > DH_Algorithm
 
typedef DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION > Domain
 
- Public Types inherited from DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >
typedef GROUP_PARAMETERS::Element Element
 

Public Member Functions

virtual ~DH_Domain ()
 
 DH_Domain ()
 Construct a Diffie-Hellman domain. More...
 
 DH_Domain (const GroupParameters &params)
 Construct a Diffie-Hellman domain. More...
 
 DH_Domain (BufferedTransformation &bt)
 Construct a Diffie-Hellman domain. More...
 
template<class T2 >
 DH_Domain (RandomNumberGenerator &v1, const T2 &v2)
 Create a Diffie-Hellman domain. More...
 
template<class T2 , class T3 >
 DH_Domain (RandomNumberGenerator &v1, const T2 &v2, const T3 &v3)
 Create a Diffie-Hellman domain. More...
 
template<class T2 , class T3 , class T4 >
 DH_Domain (RandomNumberGenerator &v1, const T2 &v2, const T3 &v3, const T4 &v4)
 Create a Diffie-Hellman domain. More...
 
template<class T1 , class T2 >
 DH_Domain (const T1 &v1, const T2 &v2)
 Construct a Diffie-Hellman domain. More...
 
template<class T1 , class T2 , class T3 >
 DH_Domain (const T1 &v1, const T2 &v2, const T3 &v3)
 Construct a Diffie-Hellman domain. More...
 
template<class T1 , class T2 , class T3 , class T4 >
 DH_Domain (const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
 Construct a Diffie-Hellman domain. More...
 
const GroupParametersGetGroupParameters () const
 Retrieves the group parameters for this domain. More...
 
GroupParametersAccessGroupParameters ()
 Retrieves the group parameters for this domain. More...
 
void GeneratePublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
 Generate a public key from a private key in this domain. More...
 
std::string AlgorithmName () const
 Provides the name of this algorithm. More...
 
- Public Member Functions inherited from DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >
virtual ~DL_SimpleKeyAgreementDomainBase ()
 
CryptoParametersAccessCryptoParameters ()
 Retrieves a reference to Crypto Parameters. More...
 
unsigned int AgreedValueLength () const
 Provides the size of the agreed value. More...
 
unsigned int PrivateKeyLength () const
 Provides the size of the private key. More...
 
unsigned int PublicKeyLength () const
 Provides the size of the public key. More...
 
void GeneratePrivateKey (RandomNumberGenerator &rng, byte *privateKey) const
 Generate private key in this domain. More...
 
void GeneratePublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
 Generate a public key from a private key in this domain. More...
 
bool Agree (byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const
 Derive agreed value. More...
 
const ElementGetGenerator () const
 Retrieves a reference to the group generator. More...
 
- Public Member Functions inherited from SimpleKeyAgreementDomain
virtual ~SimpleKeyAgreementDomain ()
 
virtual void GenerateKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
 Generate a 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...
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()
 
virtual ClonableClone () const
 Copies this object. More...
 

Static Public Member Functions

static std::string CRYPTOPP_API StaticAlgorithmName ()
 

Private Types

typedef DL_SimpleKeyAgreementDomainBase< typename GROUP_PARAMETERS::Element > Base
 

Private Member Functions

const DL_KeyAgreementAlgorithm< Element > & GetKeyAgreementAlgorithm () const
 
DL_GroupParameters< Element > & AccessAbstractGroupParameters ()
 

Private Attributes

GroupParameters m_groupParameters
 

Additional Inherited Members

- Protected Member Functions inherited from DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >
const DL_GroupParameters< Element > & GetAbstractGroupParameters () const
 

Detailed Description

template<class GROUP_PARAMETERS, class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
class DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >

Diffie-Hellman domain.

Template Parameters
GROUP_PARAMETERSgroup parameters
COFACTOR_OPTIONcofactor multiplication option

A Diffie-Hellman domain is a set of parameters that must be shared by two parties in a key agreement protocol, along with the algorithms for generating key pairs and deriving agreed values.

See also
DL_SimpleKeyAgreementDomainBase
Since
Crypto++ 1.0

Definition at line 25 of file dh.h.

Member Typedef Documentation

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
typedef DL_SimpleKeyAgreementDomainBase<typename GROUP_PARAMETERS::Element> DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::Base
private

Definition at line 27 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
typedef DL_KeyAgreementAlgorithm_DH<Element, COFACTOR_OPTION> DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Algorithm

Definition at line 32 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
typedef DH_Domain<GROUP_PARAMETERS, COFACTOR_OPTION> DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::Domain

Definition at line 33 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
typedef GroupParameters::Element DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::Element

Definition at line 31 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
typedef GROUP_PARAMETERS DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::GroupParameters

Definition at line 30 of file dh.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( )
inline

Construct a Diffie-Hellman domain.

Definition at line 38 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( const GroupParameters params)
inline

Construct a Diffie-Hellman domain.

Parameters
paramsgroup parameters and options

Definition at line 42 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( BufferedTransformation bt)
inline

Construct a Diffie-Hellman domain.

Parameters
btBufferedTransformation with group parameters and options

Definition at line 47 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
template<class T2 >
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( RandomNumberGenerator v1,
const T2 v2 
)
inline

Create a Diffie-Hellman domain.

Template Parameters
T2template parameter used as a constructor parameter
Parameters
v1RandomNumberGenerator derived class
v2second parameter

v1 and v2 are passed directly to the GROUP_PARAMETERS object.

Definition at line 56 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
template<class T2 , class T3 >
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( RandomNumberGenerator v1,
const T2 v2,
const T3 v3 
)
inline

Create a Diffie-Hellman domain.

Template Parameters
T2template parameter used as a constructor parameter
T3template parameter used as a constructor parameter
Parameters
v1RandomNumberGenerator derived class
v2second parameter
v3third parameter

v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.

Definition at line 67 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
template<class T2 , class T3 , class T4 >
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( RandomNumberGenerator v1,
const T2 v2,
const T3 v3,
const T4 &  v4 
)
inline

Create a Diffie-Hellman domain.

Template Parameters
T2template parameter used as a constructor parameter
T3template parameter used as a constructor parameter
T4template parameter used as a constructor parameter
Parameters
v1RandomNumberGenerator derived class
v2second parameter
v3third parameter
v4fourth parameter

v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.

Definition at line 80 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
template<class T1 , class T2 >
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( const T1 v1,
const T2 v2 
)
inline

Construct a Diffie-Hellman domain.

Template Parameters
T1template parameter used as a constructor parameter
T2template parameter used as a constructor parameter
Parameters
v1first parameter
v2second parameter

v1 and v2 are passed directly to the GROUP_PARAMETERS object.

Definition at line 90 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
template<class T1 , class T2 , class T3 >
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( const T1 v1,
const T2 v2,
const T3 v3 
)
inline

Construct a Diffie-Hellman domain.

Template Parameters
T1template parameter used as a constructor parameter
T2template parameter used as a constructor parameter
T3template parameter used as a constructor parameter
Parameters
v1first parameter
v2second parameter
v3third parameter

v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.

Definition at line 102 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
template<class T1 , class T2 , class T3 , class T4 >
DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::DH_Domain ( const T1 v1,
const T2 v2,
const T3 v3,
const T4 &  v4 
)
inline

Construct a Diffie-Hellman domain.

Template Parameters
T1template parameter used as a constructor parameter
T2template parameter used as a constructor parameter
T3template parameter used as a constructor parameter
T4template parameter used as a constructor parameter
Parameters
v1first parameter
v2second parameter
v3third parameter
v4fourth parameter

v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.

Definition at line 116 of file dh.h.

Member Function Documentation

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
DL_GroupParameters<Element>& DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::AccessAbstractGroupParameters ( )
inlineprivatevirtual
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
GroupParameters& DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::AccessGroupParameters ( )
inline

Retrieves the group parameters for this domain.

Returns
the group parameters for this domain as a non-const reference

Definition at line 124 of file dh.h.

Here is the caller graph for this function:

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
std::string DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::AlgorithmName ( ) const
inlinevirtual

Provides the name of this algorithm.

Returns
the standard algorithm name

The standard algorithm name can be a name like AES or AES/GCM. Some algorithms do not have standard names yet. For example, there is no standard algorithm name for Shoup's ECIES.

Note
AlgorithmName is not universally implemented yet

Reimplemented from Algorithm.

Definition at line 158 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
void DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::GeneratePublicKey ( RandomNumberGenerator rng,
const byte privateKey,
byte publicKey 
) const
inlinevirtual

Generate a public key from a private key in this domain.

Parameters
rngRandomNumberGenerator derived class
privateKeybyte buffer with the previously generated private key
publicKeybyte buffer for the generated public key in this domain

If using a FIPS 140-2 validated library on Windows, then this class will perform a self test to ensure the key pair is pairwise consistent. Non-FIPS and non-Windows builds of the library do not provide FIPS validated cryptography, so the code should be removed by the optimizer.

Precondition
COUNTOF(publicKey) == PublicKeyLength()

Implements SimpleKeyAgreementDomain.

Definition at line 135 of file dh.h.

Here is the call graph for this function:

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

Retrieves the group parameters for this domain.

Returns
the group parameters for this domain as a const reference

Definition at line 121 of file dh.h.

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
const DL_KeyAgreementAlgorithm<Element>& DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::GetKeyAgreementAlgorithm ( ) const
inlineprivatevirtual
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
static std::string CRYPTOPP_API DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::StaticAlgorithmName ( )
inlinestatic

Definition at line 156 of file dh.h.

Member Data Documentation

template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
GroupParameters DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >::m_groupParameters
private

Definition at line 166 of file dh.h.


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