From b7423a3bf73aef511ff310631955ff378c6fee7e Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 16 Oct 2016 23:03:44 -0400 Subject: [PATCH] Updated documentation --- modarith.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modarith.h b/modarith.h index c9062696..8f965fc5 100644 --- a/modarith.h +++ b/modarith.h @@ -86,7 +86,7 @@ public: {m_modulus = newModulus; m_result.reg.resize(m_modulus.reg.size());} //! \brief Retrieves the representation - //! \returns true if the representation is MontgomeryRepresentation, false otherwise + //! \returns true if the if the modulus is in Montgomery form for multiplication, false otherwise virtual bool IsMontgomeryRepresentation() const {return false;} //! \brief Reduces an element in the congruence class @@ -105,7 +105,7 @@ public: virtual Integer ConvertOut(const Integer &a) const {return a;} - //! \brief TODO + //! \brief Divides an element by 2 //! \param a element to convert const Integer& Half(const Integer &a) const; @@ -237,7 +237,7 @@ public: //! \details RandomElement constructs a new element in the range [0,n-1], inclusive. //! The element's class must provide a constructor with the signature Element(RandomNumberGenerator rng, //! Element min, Element max). - Element RandomElement( RandomNumberGenerator &rng , const RandomizationParameter &ignore_for_now = 0) const + Element RandomElement(RandomNumberGenerator &rng , const RandomizationParameter &ignore_for_now = 0) const // left RandomizationParameter arg as ref in case RandomizationParameter becomes a more complicated struct { CRYPTOPP_UNUSED(ignore_for_now); @@ -264,10 +264,9 @@ protected: //! \brief Performs modular arithmetic in Montgomery representation for increased speed //! \details The Montgomery representation represents each congruence class [a] as //! a*r\%n, where r is a convenient power of 2. -//! \details const Element& returned by member functions are references -//! to internal data members. Since each object may have only -//! one such data member for holding results, the following code -//! will produce incorrect results: +//! \details const Element& returned by member functions are references to +//! internal data members. Since each object may have only one such data member for holding +//! results, the following code will produce incorrect results: //!
    abcd = group.Add(group.Add(a,b), group.Add(c,d));
//! But this should be fine: //!
    abcd = group.Add(a, group.Add(b, group.Add(c,d));
@@ -278,7 +277,7 @@ public: virtual ~MontgomeryRepresentation() {} #endif - //! \brief Construct a IsMontgomeryRepresentation + //! \brief Construct a MontgomeryRepresentation //! \param modulus congruence class modulus //! \note The modulus must be odd. MontgomeryRepresentation(const Integer &modulus);