00001
00002
00003 #include "pch.h"
00004 #include "dh2.h"
00005
00006 NAMESPACE_BEGIN(CryptoPP)
00007
00008 #if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
00009 void DH2_TestInstantiations()
00010 {
00011 DH2 dh(*(SimpleKeyAgreementDomain*)NULL);
00012 }
00013 #endif
00014
00015 bool DH2::Agree(byte *agreedValue,
00016 const byte *staticSecretKey, const byte *ephemeralSecretKey,
00017 const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
00018 bool validateStaticOtherPublicKey) const
00019 {
00020 return d1.Agree(agreedValue, staticSecretKey, staticOtherPublicKey, validateStaticOtherPublicKey)
00021 && d2.Agree(agreedValue+d1.AgreedValueLength(), ephemeralSecretKey, ephemeralOtherPublicKey, true);
00022 }
00023
00024 NAMESPACE_END