- Main Page
- Namespaces
- Classes
- Files

# dh2.cpp

    00001 // dh2.cpp - written and placed in the public domain by Wei Dai
    00002
    00003 #include "pch.h"
    00004 #include "dh2.h"
    00005
    00006 NAMESPACE_BEGIN(CryptoPP)
    00007
    00008 void DH2_TestInstantiations()
    00009 {
    00010         DH2 dh(*(SimpleKeyAgreementDomain*)NULL);
    00011 }
    00012
    00013 bool DH2::Agree(byte *agreedValue,
    00014                 const byte *staticSecretKey, const byte *ephemeralSecretKey,
    00015                 const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
    00016                 bool validateStaticOtherPublicKey) const
    00017 {
    00018         return d1.Agree(agreedValue, staticSecretKey, staticOtherPublicKey, validateStaticOtherPublicKey)
    00019                 && d2.Agree(agreedValue+d1.AgreedValueLength(), ephemeralSecretKey, ephemeralOtherPublicKey, true);
    00020 }
    00021
    00022 NAMESPACE_END