Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

# 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 bool DH2::Agree(byte *agreedValue,
    00009                 const byte *staticSecretKey, const byte *ephemeralSecretKey,
    00010                 const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
    00011                 bool validateStaticOtherPublicKey) const
    00012 {
    00013         return d1.Agree(agreedValue, staticSecretKey, staticOtherPublicKey, validateStaticOtherPublicKey)
    00014                 && d2.Agree(agreedValue+d1.AgreedValueLength(), ephemeralSecretKey, ephemeralOtherPublicKey, true);
    00015 }
    00016
    00017 NAMESPACE_END