#include <crypto_wrapper.hpp>
Collaboration diagram for yaSSL::DiffieHellman:

Public Member Functions | |
| DiffieHellman (const byte *, unsigned int, const byte *, unsigned int, const byte *, unsigned int, const RandomPool &random) | |
| DiffieHellman (const Integer &, const Integer &, const RandomPool &) | |
| ~DiffieHellman () | |
| DiffieHellman (const DiffieHellman &) | |
| DiffieHellman & | operator= (const DiffieHellman &) |
| uint | get_agreedKeyLength () const |
| const byte * | get_agreedKey () const |
| const byte * | get_publicKey () const |
| void | makeAgreement (const byte *, unsigned int) |
| void | set_sizes (int &, int &, int &) const |
| void | get_parms (byte *, byte *, byte *) const |
Private Attributes | |
| DHImpl * | pimpl_ |
Classes | |
| struct | DHImpl |
Definition at line 374 of file crypto_wrapper.hpp.
| yaSSL::DiffieHellman::DiffieHellman | ( | const byte * | , | |
| unsigned | int, | |||
| const byte * | , | |||
| unsigned | int, | |||
| const byte * | , | |||
| unsigned | int, | |||
| const RandomPool & | random | |||
| ) |
Definition at line 812 of file crypto_wrapper.cpp.
References yaSSL::DiffieHellman::DHImpl::dh_, TaoCrypt::DH::Initialize(), memcpy, NEW_YS, pimpl_, and yaSSL::DiffieHellman::DHImpl::publicKey_.
00815 : pimpl_(NEW_YS DHImpl(random.pimpl_->RNG_)) 00816 { 00817 using TaoCrypt::Integer; 00818 00819 pimpl_->dh_.Initialize(Integer(p, pSz).Ref(), Integer(g, gSz).Ref()); 00820 pimpl_->publicKey_ = NEW_YS opaque[pubSz]; 00821 memcpy(pimpl_->publicKey_, pub, pubSz); 00822 }
Here is the call graph for this function:

| yaSSL::DiffieHellman::DiffieHellman | ( | const Integer & | , | |
| const Integer & | , | |||
| const RandomPool & | ||||
| ) |
Definition at line 826 of file crypto_wrapper.cpp.
References yaSSL::DiffieHellman::DHImpl::AllocKeys(), yaSSL::DiffieHellman::DHImpl::dh_, TaoCrypt::DH::GenerateKeyPair(), TaoCrypt::DH::GetByteLength(), TaoCrypt::DH::Initialize(), p, yaSSL::Integer::pimpl_, pimpl_, yaSSL::DiffieHellman::DHImpl::privateKey_, yaSSL::DiffieHellman::DHImpl::publicKey_, and yaSSL::DiffieHellman::DHImpl::ranPool_.
00828 : pimpl_(NEW_YS DHImpl(random.pimpl_->RNG_)) 00829 { 00830 using TaoCrypt::Integer; 00831 00832 pimpl_->dh_.Initialize(p.pimpl_->int_, g.pimpl_->int_); 00833 00834 uint length = pimpl_->dh_.GetByteLength(); 00835 00836 pimpl_->AllocKeys(length, length, length); 00837 pimpl_->dh_.GenerateKeyPair(pimpl_->ranPool_, pimpl_->privateKey_, 00838 pimpl_->publicKey_); 00839 }
Here is the call graph for this function:

| yaSSL::DiffieHellman::~DiffieHellman | ( | ) |
Definition at line 841 of file crypto_wrapper.cpp.
References pimpl_, and yaSSL::ysDelete().
Here is the call graph for this function:

| yaSSL::DiffieHellman::DiffieHellman | ( | const DiffieHellman & | ) |
Definition at line 845 of file crypto_wrapper.cpp.
References yaSSL::DiffieHellman::DHImpl::dh_, TaoCrypt::DH::GenerateKeyPair(), pimpl_, yaSSL::DiffieHellman::DHImpl::privateKey_, yaSSL::DiffieHellman::DHImpl::publicKey_, and yaSSL::DiffieHellman::DHImpl::ranPool_.
00846 : pimpl_(NEW_YS DHImpl(*that.pimpl_)) 00847 { 00848 pimpl_->dh_.GenerateKeyPair(pimpl_->ranPool_, pimpl_->privateKey_, 00849 pimpl_->publicKey_); 00850 }
Here is the call graph for this function:

| const byte * yaSSL::DiffieHellman::get_agreedKey | ( | ) | const |
Definition at line 874 of file crypto_wrapper.cpp.
References yaSSL::DiffieHellman::DHImpl::agreedKey_, and pimpl_.
Referenced by yaSSL::ClientDiffieHellmanPublic::build(), and yaSSL::ClientDiffieHellmanPublic::read().
00875 { 00876 return pimpl_->agreedKey_; 00877 }
Here is the caller graph for this function:

| uint yaSSL::DiffieHellman::get_agreedKeyLength | ( | ) | const |
Definition at line 868 of file crypto_wrapper.cpp.
References yaSSL::DiffieHellman::DHImpl::dh_, TaoCrypt::DH::GetByteLength(), and pimpl_.
Referenced by yaSSL::ClientDiffieHellmanPublic::build(), and yaSSL::ClientDiffieHellmanPublic::read().
00869 { 00870 return pimpl_->dh_.GetByteLength(); 00871 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 898 of file crypto_wrapper.cpp.
References yaSSL::DiffieHellman::DHImpl::dh_, TaoCrypt::DH::GetByteLength(), TaoCrypt::DH::GetG(), TaoCrypt::DH::GetP(), memcpy, p, pimpl_, and yaSSL::DiffieHellman::DHImpl::publicKey_.
Referenced by yaSSL::DH_Server::build().
00899 { 00900 using TaoCrypt::Integer; 00901 Integer p = pimpl_->dh_.GetP(); 00902 Integer g = pimpl_->dh_.GetG(); 00903 00904 p.Encode(bp, p.ByteCount()); 00905 g.Encode(bg, g.ByteCount()); 00906 memcpy(bpub, pimpl_->publicKey_, pimpl_->dh_.GetByteLength()); 00907 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const byte * yaSSL::DiffieHellman::get_publicKey | ( | ) | const |
Definition at line 880 of file crypto_wrapper.cpp.
References pimpl_, and yaSSL::DiffieHellman::DHImpl::publicKey_.
Referenced by yaSSL::ClientDiffieHellmanPublic::build().
00881 { 00882 return pimpl_->publicKey_; 00883 }
Here is the caller graph for this function:

| void yaSSL::DiffieHellman::makeAgreement | ( | const byte * | , | |
| unsigned | int | |||
| ) |
Definition at line 862 of file crypto_wrapper.cpp.
References TaoCrypt::DH::Agree(), yaSSL::DiffieHellman::DHImpl::agreedKey_, yaSSL::DiffieHellman::DHImpl::dh_, pimpl_, and yaSSL::DiffieHellman::DHImpl::privateKey_.
Referenced by yaSSL::ClientDiffieHellmanPublic::build(), and yaSSL::ClientDiffieHellmanPublic::read().
00863 { 00864 pimpl_->dh_.Agree(pimpl_->agreedKey_, pimpl_->privateKey_, other, otherSz); 00865 }
Here is the call graph for this function:

Here is the caller graph for this function:

| DiffieHellman & yaSSL::DiffieHellman::operator= | ( | const DiffieHellman & | ) |
Definition at line 853 of file crypto_wrapper.cpp.
References yaSSL::DiffieHellman::DHImpl::dh_, TaoCrypt::DH::GenerateKeyPair(), pimpl_, yaSSL::DiffieHellman::DHImpl::privateKey_, yaSSL::DiffieHellman::DHImpl::publicKey_, and yaSSL::DiffieHellman::DHImpl::ranPool_.
00854 { 00855 pimpl_->dh_ = that.pimpl_->dh_; 00856 pimpl_->dh_.GenerateKeyPair(pimpl_->ranPool_, pimpl_->privateKey_, 00857 pimpl_->publicKey_); 00858 return *this; 00859 }
Here is the call graph for this function:

| void yaSSL::DiffieHellman::set_sizes | ( | int & | , | |
| int & | , | |||
| int & | ||||
| ) | const |
Definition at line 886 of file crypto_wrapper.cpp.
References yaSSL::DiffieHellman::DHImpl::dh_, TaoCrypt::DH::GetByteLength(), TaoCrypt::DH::GetG(), TaoCrypt::DH::GetP(), p, and pimpl_.
Referenced by yaSSL::DH_Server::build().
00887 { 00888 using TaoCrypt::Integer; 00889 Integer p = pimpl_->dh_.GetP(); 00890 Integer g = pimpl_->dh_.GetG(); 00891 00892 pSz = p.ByteCount(); 00893 gSz = g.ByteCount(); 00894 pubSz = pimpl_->dh_.GetByteLength(); 00895 }
Here is the call graph for this function:

Here is the caller graph for this function:

DHImpl* yaSSL::DiffieHellman::pimpl_ [private] |
Definition at line 393 of file crypto_wrapper.hpp.
Referenced by DiffieHellman(), get_agreedKey(), get_agreedKeyLength(), get_parms(), get_publicKey(), makeAgreement(), operator=(), set_sizes(), and ~DiffieHellman().
1.4.7

