diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-08-05 03:51:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-05 03:51:58 -0400 |
commit | c9ef9420e762b91cc06463d349cf06e04c749b9d (patch) | |
tree | 69a074fcf855a9f8b04d12b359904217e9ea618f /eccrypto.h | |
parent | b3eb4c6a690d6dfb342856f2a66a71dcec8c429b (diff) | |
download | cryptopp-git-c9ef9420e762b91cc06463d349cf06e04c749b9d.tar.gz |
Fix ECP leakage in Add() and Double() (GH #869, PR #871)
This check-in provides the fix for leaks in ECP's Add() and Double(). The fixes were taken from Joost Renes, Craig Costello, and Lejla Batina's [Complete addition formulas for prime order elliptic curves](https://eprint.iacr.org/2015/1060.pdf).
The Pull Request includes two additional changes that were related to testing the primary fix. First, an `AuthenticatedKeyAgreementWithRolesValidate` interface was added. It allows us to test key agreement when roles are involved. Roles are "client", "server", "initiator", "recipient", etc.
Second, `SetGlobalSeed` was added to `test.cpp` to help with reproducible results. We had code in two different places that set the seed value for the random number generator. But it was sloppy and doing a poor job since results could not be reproduced under some circumstances.
Diffstat (limited to 'eccrypto.h')
-rw-r--r-- | eccrypto.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -22,6 +22,8 @@ #include "ecp.h"
#include "ec2n.h"
+#include <iosfwd>
+
#if CRYPTOPP_MSC_VERSION
# pragma warning(push)
# pragma warning(disable: 4231 4275)
@@ -168,6 +170,8 @@ protected: mutable bool m_compress, m_encodeAsOID; // presentation details
};
+inline std::ostream& operator<<(std::ostream& os, const DL_GroupParameters_EC<ECP>::Element& obj);
+
/// \brief Elliptic Curve Discrete Log (DL) public key
/// \tparam EC elliptic curve field
template <class EC>
|