Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Member Functions | Protected Member Functions | List of all members
DL_SimpleKeyAgreementDomainBase< T > Class Template Referenceabstract

Discrete Log (DL) simple key agreement base implementation. More...

#include <pubkey.h>

Inheritance diagram for DL_SimpleKeyAgreementDomainBase< T >:
[legend]
Collaboration diagram for DL_SimpleKeyAgreementDomainBase< T >:
[legend]

Public Types

typedef T Element
 

Public Member Functions

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...
 
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

virtual const DL_KeyAgreementAlgorithm< Element > & GetKeyAgreementAlgorithm () const =0
 
virtual DL_GroupParameters< Element > & AccessAbstractGroupParameters ()=0
 
const DL_GroupParameters< Element > & GetAbstractGroupParameters () const
 

Detailed Description

template<class T>
class DL_SimpleKeyAgreementDomainBase< T >

Discrete Log (DL) simple key agreement base implementation.

Template Parameters
Tclass or type

Definition at line 1855 of file pubkey.h.

Member Typedef Documentation

template<class T>
typedef T DL_SimpleKeyAgreementDomainBase< T >::Element

Definition at line 1858 of file pubkey.h.

Constructor & Destructor Documentation

template<class T>
virtual DL_SimpleKeyAgreementDomainBase< T >::~DL_SimpleKeyAgreementDomainBase ( )
inlinevirtual

Definition at line 1860 of file pubkey.h.

Member Function Documentation

template<class T>
virtual DL_GroupParameters<Element>& DL_SimpleKeyAgreementDomainBase< T >::AccessAbstractGroupParameters ( )
protectedpure virtual
template<class T>
CryptoParameters& DL_SimpleKeyAgreementDomainBase< T >::AccessCryptoParameters ( )
inlinevirtual

Retrieves a reference to Crypto Parameters.

Returns
a reference the crypto parameters

Implements KeyAgreementAlgorithm.

Definition at line 1862 of file pubkey.h.

template<class T>
bool DL_SimpleKeyAgreementDomainBase< T >::Agree ( byte agreedValue,
const byte privateKey,
const byte otherPublicKey,
bool  validateOtherPublicKey = true 
) const
inlinevirtual

Derive agreed value.

Parameters
agreedValuea byte buffer for the shared secret
privateKeya byte buffer with your private key in this domain
otherPublicKeya byte buffer with the other party's public key in this domain
validateOtherPublicKeya flag indicating if the other party's public key should be validated
Returns
true upon success, false in case of failure

Agree() derives an agreed value from your private keys and couterparty's public keys.

The other party's public key is validated by default. If you have previously validated the static public key, use validateStaticOtherPublicKey=false to save time.

Precondition
COUNTOF(agreedValue) == AgreedValueLength()
COUNTOF(privateKey) == PrivateKeyLength()
COUNTOF(otherPublicKey) == PublicKeyLength()

Implements SimpleKeyAgreementDomain.

Definition at line 1882 of file pubkey.h.

Here is the caller graph for this function:

template<class T>
unsigned int DL_SimpleKeyAgreementDomainBase< T >::AgreedValueLength ( ) const
inlinevirtual

Provides the size of the agreed value.

Returns
size of agreed value produced in this domain

Implements SimpleKeyAgreementDomain.

Definition at line 1863 of file pubkey.h.

Here is the caller graph for this function:

template<class T>
void DL_SimpleKeyAgreementDomainBase< T >::GeneratePrivateKey ( RandomNumberGenerator rng,
byte privateKey 
) const
inlinevirtual

Generate private key in this domain.

Parameters
rnga RandomNumberGenerator derived class
privateKeya byte buffer for the generated private key in this domain
Precondition
COUNTOF(privateKey) == PrivateKeyLength()

Implements SimpleKeyAgreementDomain.

Definition at line 1867 of file pubkey.h.

template<class T>
void DL_SimpleKeyAgreementDomainBase< T >::GeneratePublicKey ( RandomNumberGenerator rng,
const byte privateKey,
byte publicKey 
) const
inlinevirtual

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

Parameters
rnga RandomNumberGenerator derived class
privateKeya byte buffer with the previously generated private key
publicKeya byte buffer for the generated public key in this domain
Precondition
COUNTOF(publicKey) == PublicKeyLength()

Implements SimpleKeyAgreementDomain.

Definition at line 1873 of file pubkey.h.

template<class T>
const DL_GroupParameters<Element>& DL_SimpleKeyAgreementDomainBase< T >::GetAbstractGroupParameters ( ) const
inlineprotected

Definition at line 1908 of file pubkey.h.

template<class T>
const Element& DL_SimpleKeyAgreementDomainBase< T >::GetGenerator ( ) const
inline

Retrieves a reference to the group generator.

Returns
const reference to the group generator

Definition at line 1903 of file pubkey.h.

template<class T>
virtual const DL_KeyAgreementAlgorithm<Element>& DL_SimpleKeyAgreementDomainBase< T >::GetKeyAgreementAlgorithm ( ) const
protectedpure virtual
template<class T>
unsigned int DL_SimpleKeyAgreementDomainBase< T >::PrivateKeyLength ( ) const
inlinevirtual

Provides the size of the private key.

Returns
size of private keys in this domain

Implements SimpleKeyAgreementDomain.

Definition at line 1864 of file pubkey.h.

Here is the caller graph for this function:

template<class T>
unsigned int DL_SimpleKeyAgreementDomainBase< T >::PublicKeyLength ( ) const
inlinevirtual

Provides the size of the public key.

Returns
size of public keys in this domain

Implements SimpleKeyAgreementDomain.

Definition at line 1865 of file pubkey.h.

Here is the caller graph for this function:


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