Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DH2 Class Reference

Unified Diffie-Hellman. More...

#include <dh2.h>

Inheritance diagram for DH2:

PK_AuthenticatedKeyAgreementDomain List of all members.

Public Methods

 DH2 (const PK_SimpleKeyAgreementDomain &domain)
 DH2 (const PK_SimpleKeyAgreementDomain &staticDomain,const PK_SimpleKeyAgreementDomain &ephemeralDomain)
bool ValidateDomainParameters (RandomNumberGenerator &rng)const
 return whether the domain parameters stored in this object are valid. 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 GenerateStaticKeyPair (RandomNumberGenerator &rng,byte *privateKey,byte *publicKey)const
 generate static private/public key pair. More...

unsigned int EphemeralPrivateKeyLength ()const
 return length of ephemeral private keys in this domain. More...

unsigned int EphemeralPublicKeyLength ()const
 return length of ephemeral public keys in this domain. More...

void GenerateEphemeralKeyPair (RandomNumberGenerator &rng,byte *privateKey,byte *publicKey)const
 generate ephemeral private/public key pair. 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...


Protected Attributes

const PK_SimpleKeyAgreementDomaind1
const PK_SimpleKeyAgreementDomaind2

Detailed Description

Unified Diffie-Hellman.

Definition at line 12 of file dh2.h.


Constructor & Destructor Documentation

DH2::DH2 ( const PK_SimpleKeyAgreementDomain & domain ) [inline]
 

Definition at line 15 of file dh2.h.

DH2::DH2 ( const PK_SimpleKeyAgreementDomain & staticDomain,
const PK_SimpleKeyAgreementDomain & ephemeralDomain ) [inline]
 

Definition at line 17 of file dh2.h.


Member Function Documentation

bool DH2::Agree ( byte * agreedValue,
const byte * staticSecretKey,
const byte * ephemeralSecretKey,
const byte * staticOtherPublicKey,
const byte * ephemeralOtherPublicKey,
bool validateStaticOtherPublicKey = true ) const [virtual]
 

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. Preconditions: \begin{itemize} \item size of agreedValue == AgreedValueLength() \item length of staticPrivateKey == StaticPrivateKeyLength() \item length of ephemeralPrivateKey == EphemeralPrivateKeyLength() \item length of staticOtherPublicKey == StaticPublicKeyLength() \item length of ephemeralOtherPublicKey == EphemeralPublicKeyLength() \end{itemize}

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 8 of file dh2.cpp.

unsigned int DH2::AgreedValueLength ( ) const [inline, virtual]
 

return length of agreed value produced.

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 22 of file dh2.h.

unsigned int DH2::EphemeralPrivateKeyLength ( ) const [inline, virtual]
 

return length of ephemeral private keys in this domain.

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 32 of file dh2.h.

unsigned int DH2::EphemeralPublicKeyLength ( ) const [inline, virtual]
 

return length of ephemeral public keys in this domain.

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 34 of file dh2.h.

void DH2::GenerateEphemeralKeyPair ( RandomNumberGenerator & rng,
byte * privateKey,
byte * publicKey ) const [inline, virtual]
 

generate ephemeral private/public key pair.

Preconditions: \begin{itemize} \item size of privateKey == EphemeralPrivateKeyLength() \item size of publicKey == EphemeralPublicKeyLength() \end{itemize}

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 36 of file dh2.h.

void DH2::GenerateStaticKeyPair ( RandomNumberGenerator & rng,
byte * privateKey,
byte * publicKey ) const [inline, virtual]
 

generate static private/public key pair.

Preconditions: \begin{itemize} \item size of privateKey == StaticPrivateKeyLength() \item size of publicKey == StaticPublicKeyLength() \end{itemize}

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 29 of file dh2.h.

unsigned int DH2::StaticPrivateKeyLength ( ) const [inline, virtual]
 

return length of static private keys in this domain.

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 25 of file dh2.h.

unsigned int DH2::StaticPublicKeyLength ( ) const [inline, virtual]
 

return length of static public keys in this domain.

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 27 of file dh2.h.

bool DH2::ValidateDomainParameters ( RandomNumberGenerator & rng ) const [inline, virtual]
 

return whether the domain parameters stored in this object are valid.

Reimplemented from PK_AuthenticatedKeyAgreementDomain.

Definition at line 20 of file dh2.h.


Member Data Documentation

const PK_SimpleKeyAgreementDomain & DH2::d1 [protected]
 

Definition at line 45 of file dh2.h.

const PK_SimpleKeyAgreementDomain & DH2::d2 [protected]
 

Definition at line 45 of file dh2.h.


The documentation for this class was generated from the following files:
Generated at Mon Jan 15 01:16:45 2001 for Crypto++ by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000