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

XTR_DH Class Reference

XTR-DH with key validation. More...

#include <xtrcrypt.h>

Inheritance diagram for XTR_DH:

PK_SimpleKeyAgreementDomain List of all members.

Public Methods

 XTR_DH (const Integer &p,const Integer &q,const GFP2Element &g)
 XTR_DH (RandomNumberGenerator &rng,unsigned int pbits,unsigned int qbits)
 XTR_DH (BufferedTransformation &domainParams)
void DEREncode (BufferedTransformation &domainParams)const
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 PrivateKeyLength ()const
 return length of private keys in this domain. More...

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

void GenerateKeyPair (RandomNumberGenerator &rng,byte *privateKey,byte *publicKey)const
 generate private/public key pair. More...

bool Agree (byte *agreedValue,const byte *privateKey,const byte *otherPublicKey,bool validateOtherPublicKey=true)const
 derive agreed value from your private key and couterparty's public key, return false in case of failure. More...

const IntegerGetPrime ()const
const IntegerGetSubprime ()const
const GFP2ElementGetGenerator ()const

Detailed Description

XTR-DH with key validation.

Definition at line 14 of file xtrcrypt.h.


Constructor & Destructor Documentation

XTR_DH::XTR_DH ( const Integer & p,
const Integer & q,
const GFP2Element & g )
 

Definition at line 10 of file xtrcrypt.cpp.

XTR_DH::XTR_DH ( RandomNumberGenerator & rng,
unsigned int pbits,
unsigned int qbits )
 

Definition at line 15 of file xtrcrypt.cpp.

XTR_DH::XTR_DH ( BufferedTransformation & bt )
 

Definition at line 20 of file xtrcrypt.cpp.


Member Function Documentation

bool XTR_DH::Agree ( byte * agreedValue,
const byte * privateKey,
const byte * otherPublicKey,
bool validateOtherPublicKey = true ) const [virtual]
 

derive agreed value from your private key and couterparty's public key, return false in case of failure.

Note: If you have previously validated the public key, use validateOtherPublicKey=false to save time. /*! Preconditions: \begin{itemize} \item size of agreedValue == AgreedValueLength() \item length of privateKey == PrivateKeyLength() \item length of otherPublicKey == PublicKeyLength() \end{itemize}

Reimplemented from PK_SimpleKeyAgreementDomain.

Definition at line 56 of file xtrcrypt.cpp.

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

return length of agreed value produced.

Reimplemented from PK_SimpleKeyAgreementDomain.

Definition at line 24 of file xtrcrypt.h.

Referenced by Agree().

void XTR_DH::DEREncode ( BufferedTransformation & bt ) const
 

Definition at line 30 of file xtrcrypt.cpp.

void XTR_DH::GenerateKeyPair ( RandomNumberGenerator & rng,
byte * privateKey,
byte * publicKey ) const [virtual]
 

generate private/public key pair.

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

Reimplemented from PK_SimpleKeyAgreementDomain.

Definition at line 48 of file xtrcrypt.cpp.

const GFP2Element & XTR_DH::GetGenerator ( ) const [inline]
 

Definition at line 33 of file xtrcrypt.h.

const Integer & XTR_DH::GetPrime ( ) const [inline]
 

Definition at line 31 of file xtrcrypt.h.

const Integer & XTR_DH::GetSubprime ( ) const [inline]
 

Definition at line 32 of file xtrcrypt.h.

unsigned int XTR_DH::PrivateKeyLength ( ) const [inline, virtual]
 

return length of private keys in this domain.

Reimplemented from PK_SimpleKeyAgreementDomain.

Definition at line 25 of file xtrcrypt.h.

Referenced by Agree(), and GenerateKeyPair().

unsigned int XTR_DH::PublicKeyLength ( ) const [inline, virtual]
 

return length of public keys in this domain.

Reimplemented from PK_SimpleKeyAgreementDomain.

Definition at line 26 of file xtrcrypt.h.

Referenced by Agree(), and GenerateKeyPair().

bool XTR_DH::ValidateDomainParameters ( RandomNumberGenerator & rng ) const [virtual]
 

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

Reimplemented from PK_SimpleKeyAgreementDomain.

Definition at line 40 of file xtrcrypt.cpp.


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