diff options
author | weidai <weidai11@users.noreply.github.com> | 2008-11-21 05:30:16 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2008-11-21 05:30:16 +0000 |
commit | 0a019e769c4f9bc494a4c485c4f5ca34791af546 (patch) | |
tree | 52da2e56044c49342728f37f86f20ad3d07c8507 /dh.h | |
parent | e82ae282eb749ba40eea5d32fef6c1fd131f07cc (diff) | |
download | cryptopp-git-0a019e769c4f9bc494a4c485c4f5ca34791af546.tar.gz |
improve pairwise consistency test (Brian Pence)
Diffstat (limited to 'dh.h')
-rw-r--r-- | dh.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -68,10 +68,10 @@ public: Base::GeneratePublicKey(rng, privateKey2, publicKey2); SecByteBlock agreedValue(this->AgreedValueLength()), agreedValue2(this->AgreedValueLength()); - this->Agree(agreedValue, privateKey, publicKey2); - this->Agree(agreedValue2, privateKey2, publicKey); + bool agreed1 = this->Agree(agreedValue, privateKey, publicKey2); + bool agreed2 = this->Agree(agreedValue2, privateKey2, publicKey); - if (agreedValue != agreedValue2) + if (!agreed1 || !agreed2 || agreedValue != agreedValue2) throw SelfTestFailure(this->AlgorithmName() + ": pairwise consistency test failed"); } } |