Updated documentation
parent
255d285ef2
commit
b7423a3bf7
13
modarith.h
13
modarith.h
|
|
@ -86,7 +86,7 @@ public:
|
||||||
{m_modulus = newModulus; m_result.reg.resize(m_modulus.reg.size());}
|
{m_modulus = newModulus; m_result.reg.resize(m_modulus.reg.size());}
|
||||||
|
|
||||||
//! \brief Retrieves the representation
|
//! \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;}
|
virtual bool IsMontgomeryRepresentation() const {return false;}
|
||||||
|
|
||||||
//! \brief Reduces an element in the congruence class
|
//! \brief Reduces an element in the congruence class
|
||||||
|
|
@ -105,7 +105,7 @@ public:
|
||||||
virtual Integer ConvertOut(const Integer &a) const
|
virtual Integer ConvertOut(const Integer &a) const
|
||||||
{return a;}
|
{return a;}
|
||||||
|
|
||||||
//! \brief TODO
|
//! \brief Divides an element by 2
|
||||||
//! \param a element to convert
|
//! \param a element to convert
|
||||||
const Integer& Half(const Integer &a) const;
|
const Integer& Half(const Integer &a) const;
|
||||||
|
|
||||||
|
|
@ -264,10 +264,9 @@ protected:
|
||||||
//! \brief Performs modular arithmetic in Montgomery representation for increased speed
|
//! \brief Performs modular arithmetic in Montgomery representation for increased speed
|
||||||
//! \details The Montgomery representation represents each congruence class <tt>[a]</tt> as
|
//! \details The Montgomery representation represents each congruence class <tt>[a]</tt> as
|
||||||
//! <tt>a*r\%n</tt>, where <tt>r</tt> is a convenient power of 2.
|
//! <tt>a*r\%n</tt>, where <tt>r</tt> is a convenient power of 2.
|
||||||
//! \details <tt>const Element&</tt> returned by member functions are references
|
//! \details <tt>const Element&</tt> returned by member functions are references to
|
||||||
//! to internal data members. Since each object may have only
|
//! internal data members. Since each object may have only one such data member for holding
|
||||||
//! one such data member for holding results, the following code
|
//! results, the following code will produce incorrect results:
|
||||||
//! will produce incorrect results:
|
|
||||||
//! <pre> abcd = group.Add(group.Add(a,b), group.Add(c,d));</pre>
|
//! <pre> abcd = group.Add(group.Add(a,b), group.Add(c,d));</pre>
|
||||||
//! But this should be fine:
|
//! But this should be fine:
|
||||||
//! <pre> abcd = group.Add(a, group.Add(b, group.Add(c,d));</pre>
|
//! <pre> abcd = group.Add(a, group.Add(b, group.Add(c,d));</pre>
|
||||||
|
|
@ -278,7 +277,7 @@ public:
|
||||||
virtual ~MontgomeryRepresentation() {}
|
virtual ~MontgomeryRepresentation() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! \brief Construct a IsMontgomeryRepresentation
|
//! \brief Construct a MontgomeryRepresentation
|
||||||
//! \param modulus congruence class modulus
|
//! \param modulus congruence class modulus
|
||||||
//! \note The modulus must be odd.
|
//! \note The modulus must be odd.
|
||||||
MontgomeryRepresentation(const Integer &modulus);
|
MontgomeryRepresentation(const Integer &modulus);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue