DL_SimpleKeyAgreementDomainBase< T > Class Template Referenceabstract

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

`#include <pubkey.h>`

Inheritance diagram for DL_SimpleKeyAgreementDomainBase< T >:

## Public Types

typedef T | Element

## Public Member Functions

CryptoParameters & | AccessCryptoParameters ()
| Retrieves a reference to Crypto Parameters.
unsigned int | AgreedValueLength () const
| Provides the size of the agreed value.
unsigned int | PrivateKeyLength () const
| Provides the size of the private key.
unsigned int | PublicKeyLength () const
| Provides the size of the public key.
void | GeneratePrivateKey (RandomNumberGenerator &rng, byte *privateKey) const
| Generate private key in this domain.
void | GeneratePublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
| Generate a public key from a private key in this domain.
bool | Agree (byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const
| Derive agreed value.
const Element & | GetGenerator () const
| Retrieves a reference to the group generator.
Public Member Functions inherited from SimpleKeyAgreementDomain
virtual void | GenerateKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
| Generate a private/public key pair.
Public Member Functions inherited from KeyAgreementAlgorithm
CryptoMaterial & | AccessMaterial ()
| Retrieves a reference to Crypto Parameters.
const CryptoMaterial & | GetMaterial () const
| Retrieves a reference to Crypto Parameters.
virtual const CryptoParameters & | GetCryptoParameters () const
| Retrieves a reference to Crypto Parameters.
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 Clonable * | Clone () const
| Copies this object.

## Detailed Description

template<class T>
class DL_SimpleKeyAgreementDomainBase< T >

Discrete Log (DL) simple key agreement base implementation.

Template Parameters

  T | class or type

Definition at line 2063 of file pubkey.h.

## Member Typedef Documentation

## Element

template<class T >

typedef T DL_SimpleKeyAgreementDomainBase< T >::Element

Definition at line 2066 of file pubkey.h.

## Constructor & Destructor Documentation

## ~DL_SimpleKeyAgreementDomainBase()

template<class T >

virtual DL_SimpleKeyAgreementDomainBase< T >::~DL_SimpleKeyAgreementDomainBase | ( |  | ) |

inline virtual

Definition at line 2068 of file pubkey.h.

## Member Function Documentation

## AccessCryptoParameters()

template<class T >

CryptoParameters & DL_SimpleKeyAgreementDomainBase< T >::AccessCryptoParameters | ( |  | ) |

inline virtual

Retrieves a reference to Crypto Parameters.

Returns
  a reference the crypto parameters

Implements KeyAgreementAlgorithm.

Definition at line 2070 of file pubkey.h.

## AgreedValueLength()

template<class T >

unsigned int DL_SimpleKeyAgreementDomainBase< T >::AgreedValueLength | ( |  | ) | const

inline virtual

Provides the size of the agreed value.

Returns
  size of agreed value produced in this domain

Implements SimpleKeyAgreementDomain.

Definition at line 2071 of file pubkey.h.

## PrivateKeyLength()

template<class T >

unsigned int DL_SimpleKeyAgreementDomainBase< T >::PrivateKeyLength | ( |  | ) | const

inline virtual

Provides the size of the private key.

Returns
  size of private keys in this domain

Implements SimpleKeyAgreementDomain.

Definition at line 2072 of file pubkey.h.

## PublicKeyLength()

template<class T >

unsigned int DL_SimpleKeyAgreementDomainBase< T >::PublicKeyLength | ( |  | ) | const

inline virtual

Provides the size of the public key.

Returns
  size of public keys in this domain

Implements SimpleKeyAgreementDomain.

Definition at line 2073 of file pubkey.h.

## GeneratePrivateKey()

template<class T >

void DL_SimpleKeyAgreementDomainBase< T >::GeneratePrivateKey | ( | RandomNumberGenerator & | rng,
|  | byte * | privateKey
| ) |  | const

inline virtual

Generate private key in this domain.

Parameters

  rng | a RandomNumberGenerator derived class
  privateKey | a byte buffer for the generated private key in this domain

Precondition
  `COUNTOF(privateKey) == PrivateKeyLength()`

Implements SimpleKeyAgreementDomain.

Definition at line 2075 of file pubkey.h.

## GeneratePublicKey()

template<class T >

void DL_SimpleKeyAgreementDomainBase< T >::GeneratePublicKey | ( | RandomNumberGenerator & | rng,
|  | const byte * | privateKey,
|  | byte * | publicKey
| ) |  | const

inline virtual

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

Parameters

  rng | a RandomNumberGenerator derived class
  privateKey | a byte buffer with the previously generated private key
  publicKey | a byte buffer for the generated public key in this domain

Precondition
  `COUNTOF(publicKey) == PublicKeyLength()`

Implements SimpleKeyAgreementDomain.

Definition at line 2081 of file pubkey.h.

## Agree()

template<class T >

bool DL_SimpleKeyAgreementDomainBase< T >::Agree | ( | byte * | agreedValue,
|  | const byte * | privateKey,
|  | const byte * | otherPublicKey,
|  | bool | validateOtherPublicKey = `true`
| ) |  | const

inline virtual

Derive agreed value.

Parameters

  agreedValue | a byte buffer for the shared secret
  privateKey | a byte buffer with your private key in this domain
  otherPublicKey | a byte buffer with the other party's public key in this domain
  validateOtherPublicKey | a 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 2090 of file pubkey.h.

## GetGenerator()

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 2111 of file pubkey.h.

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

- pubkey.h