Clear warning on missing assignment operator
parent
c76711237a
commit
f330c0eca8
28
modarith.h
28
modarith.h
|
|
@ -26,15 +26,17 @@ CRYPTOPP_DLL_TEMPLATE_CLASS AbstractRing<Integer>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain<Integer>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain<Integer>;
|
||||||
|
|
||||||
/// \brief Ring of congruence classes modulo n
|
/// \brief Ring of congruence classes modulo n
|
||||||
/// \details This implementation represents each congruence class as the smallest
|
/// \details This implementation represents each congruence class as
|
||||||
/// non-negative integer in that class.
|
/// the smallest non-negative integer in that class.
|
||||||
/// \details <tt>const Element&</tt> returned by member functions are references
|
/// \details <tt>const Element&</tt> returned by member functions are
|
||||||
/// to internal data members. Since each object may have only
|
/// references to internal data members. Since each object may have
|
||||||
/// one such data member for holding results, the following code
|
/// only one such data member for holding results, you should use the
|
||||||
/// will produce incorrect results:
|
/// class like this:
|
||||||
/// <pre> abcd = group.Add(group.Add(a,b), group.Add(c,d));</pre>
|
/// <pre> abcd = group.Add(a, group.Add(b, group.Add(c,d));</pre>
|
||||||
/// But this should be fine:
|
/// The following code will produce incorrect results:
|
||||||
/// <pre> abcd = group.Add(a, group.Add(b, group.Add(c,d));</pre>
|
/// <pre> abcd = group.Add(group.Add(a,b), group.Add(c,d));</pre>
|
||||||
|
/// \sa <A HREF="https://cryptopp.com/wiki/Integer">Integer</A> on the
|
||||||
|
/// Crypto++ wiki.
|
||||||
class CRYPTOPP_DLL ModularArithmetic : public AbstractRing<Integer>
|
class CRYPTOPP_DLL ModularArithmetic : public AbstractRing<Integer>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -239,7 +241,7 @@ public:
|
||||||
/// \details RandomElement constructs a new element in the range <tt>[0,n-1]</tt>, inclusive.
|
/// \details RandomElement constructs a new element in the range <tt>[0,n-1]</tt>, inclusive.
|
||||||
/// The element's class must provide a constructor with the signature <tt>Element(RandomNumberGenerator rng,
|
/// The element's class must provide a constructor with the signature <tt>Element(RandomNumberGenerator rng,
|
||||||
/// Element min, Element max)</tt>.
|
/// Element min, Element max)</tt>.
|
||||||
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
|
// left RandomizationParameter arg as ref in case RandomizationParameter becomes a more complicated struct
|
||||||
{
|
{
|
||||||
CRYPTOPP_UNUSED(ignore_for_now);
|
CRYPTOPP_UNUSED(ignore_for_now);
|
||||||
|
|
@ -253,7 +255,11 @@ public:
|
||||||
bool operator==(const ModularArithmetic &rhs) const
|
bool operator==(const ModularArithmetic &rhs) const
|
||||||
{return m_modulus == rhs.m_modulus;}
|
{return m_modulus == rhs.m_modulus;}
|
||||||
|
|
||||||
static const RandomizationParameter DefaultRandomizationParameter ;
|
static const RandomizationParameter DefaultRandomizationParameter;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Squash warning on missing assignment operator.
|
||||||
|
ModularArithmetic& operator=(const ModularArithmetic &ma);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Integer m_modulus;
|
Integer m_modulus;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue