Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
640 B

  1. // dh2.cpp - written and placed in the public domain by Wei Dai
  2. #include "pch.h"
  3. #include "dh2.h"
  4. NAMESPACE_BEGIN(CryptoPP)
  5. void DH2_TestInstantiations()
  6. {
  7. DH2 dh(*(SimpleKeyAgreementDomain*)NULL);
  8. }
  9. bool DH2::Agree(byte *agreedValue,
  10. const byte *staticSecretKey, const byte *ephemeralSecretKey,
  11. const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
  12. bool validateStaticOtherPublicKey) const
  13. {
  14. return d1.Agree(agreedValue, staticSecretKey, staticOtherPublicKey, validateStaticOtherPublicKey)
  15. && d2.Agree(agreedValue+d1.AgreedValueLength(), ephemeralSecretKey, ephemeralOtherPublicKey, true);
  16. }
  17. NAMESPACE_END