diff --git a/ecp.h b/ecp.h index 834bef0d..f7c919aa 100644 --- a/ecp.h +++ b/ecp.h @@ -35,11 +35,15 @@ public: /// \brief Construct an ECP ECP() {} - /// \brief Copy construct an ECP + /// \brief Construct an ECP /// \param ecp the other ECP object - /// \param convertToMontgomeryRepresentation flag indicating if the curve should be converted to a MontgomeryRepresentation + /// \param convertToMontgomeryRepresentation flag indicating if the curve + /// should be converted to a MontgomeryRepresentation. + /// \details Prior to Crypto++ 8.3 the default value for + /// convertToMontgomeryRepresentation was false. it was changed due to + /// two audit tools finding, "Signature-compatible with a copy constructor". /// \sa ModularArithmetic, MontgomeryRepresentation - ECP(const ECP &ecp, bool convertToMontgomeryRepresentation = false); + ECP(const ECP &ecp, bool convertToMontgomeryRepresentation); /// \brief Construct an ECP /// \param modulus the prime modulus @@ -50,14 +54,22 @@ public: /// \brief Construct an ECP from BER encoded parameters /// \param bt BufferedTransformation derived object - /// \details This constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters + /// \details This constructor will decode and extract the the fields + /// fieldID and curve of the sequence ECParameters ECP(BufferedTransformation &bt); - /// \brief Encode the fields fieldID and curve of the sequence ECParameters + /// \brief DER Encode /// \param bt BufferedTransformation derived object + /// \details DEREncode encode the fields fieldID and curve of the sequence + /// ECParameters void DEREncode(BufferedTransformation &bt) const; + /// \brief Compare two points + /// \param P the first point + /// \param Q the second point + /// \returns true if equal, false otherwise bool Equal(const Point &P, const Point &Q) const; + const Point& Identity() const; const Point& Inverse(const Point &P) const; bool InversionIsFast() const {return true;} diff --git a/modarith.h b/modarith.h index 96e845e8..aa90c8a5 100644 --- a/modarith.h +++ b/modarith.h @@ -49,12 +49,12 @@ public: /// \brief Construct a ModularArithmetic /// \param modulus congruence class modulus ModularArithmetic(const Integer &modulus = Integer::One()) - : AbstractRing(), m_modulus(modulus), m_result(static_cast(0), modulus.reg.size()) {} + : m_modulus(modulus), m_result(static_cast(0), modulus.reg.size()) {} /// \brief Copy construct a ModularArithmetic /// \param ma other ModularArithmetic ModularArithmetic(const ModularArithmetic &ma) - : AbstractRing(), m_modulus(ma.m_modulus), m_result(static_cast(0), ma.m_modulus.reg.size()) {} + : m_modulus(ma.m_modulus), m_result(static_cast(0), ma.m_modulus.reg.size()) {} /// \brief Construct a ModularArithmetic /// \param bt BER encoded ModularArithmetic