From ca6a93bbc51b96c276d62db9f10922cb04b16126 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 17 Jul 2015 10:38:44 -0400 Subject: [PATCH] Cleared virtual destructor warning by explicitly adding them --- ec2n.h | 2 ++ ecp.h | 2 ++ eprecomp.h | 1 + luc.cpp | 2 ++ luc.h | 6 ++++++ modexppc.h | 2 ++ rsa.cpp | 2 ++ 7 files changed, 17 insertions(+) diff --git a/ec2n.h b/ec2n.h index ae4007cd..ed172b0e 100644 --- a/ec2n.h +++ b/ec2n.h @@ -100,6 +100,8 @@ public: Element BERDecodeElement(BufferedTransformation &bt) const {return m_ec.BERDecodePoint(bt);} void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {m_ec.DEREncodePoint(bt, v, false);} + virtual ~EcPrecomputation() { } + // non-inherited void SetCurve(const EC2N &ec) {m_ec = ec;} const EC2N & GetCurve() const {return m_ec;} diff --git a/ecp.h b/ecp.h index d946be63..ef7f67d3 100644 --- a/ecp.h +++ b/ecp.h @@ -109,6 +109,8 @@ public: Element BERDecodeElement(BufferedTransformation &bt) const {return m_ec->BERDecodePoint(bt);} void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {m_ec->DEREncodePoint(bt, v, false);} + virtual ~EcPrecomputation() { } + // non-inherited void SetCurve(const ECP &ec) { diff --git a/eprecomp.h b/eprecomp.h index 1f325676..9723a7ba 100644 --- a/eprecomp.h +++ b/eprecomp.h @@ -44,6 +44,7 @@ public: typedef T Element; DL_FixedBasePrecomputationImpl() : m_windowSize(0) {} + virtual ~DL_FixedBasePrecomputationImpl() { } // DL_FixedBasePrecomputation bool IsInitialized() const diff --git a/luc.cpp b/luc.cpp index 43cd2ed2..d1ad4eb9 100644 --- a/luc.cpp +++ b/luc.cpp @@ -97,6 +97,8 @@ class LUCPrimeSelector : public PrimeSelector { public: LUCPrimeSelector(const Integer &e) : m_e(e) {} + virtual ~LUCPrimeSelector() { } + bool IsAcceptable(const Integer &candidate) const { return RelativelyPrime(m_e, candidate+1) && RelativelyPrime(m_e, candidate-1); diff --git a/luc.h b/luc.h index 730776d5..7a816843 100644 --- a/luc.h +++ b/luc.h @@ -119,6 +119,8 @@ public: Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);} void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);} + virtual ~DL_GroupPrecomputation_LUC() { } + // non-inherited void SetModulus(const Integer &v) {m_p = v;} const Integer & GetModulus() const {return m_p;} @@ -142,6 +144,8 @@ public: Integer CascadeExponentiate(const DL_GroupPrecomputation &group, const Integer &exponent, const DL_FixedBasePrecomputation &pc2, const Integer &exponent2) const {throw NotImplemented("DL_BasePrecomputation_LUC: CascadeExponentiate not implemented");} // shouldn't be called + virtual ~DL_BasePrecomputation_LUC() { } + private: Integer m_g; }; @@ -158,6 +162,8 @@ public: Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const {throw NotImplemented("LUC_GroupParameters: MultiplyElements can not be implemented");} + virtual ~DL_GroupParameters_LUC() { } + // NameValuePairs interface bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const { diff --git a/modexppc.h b/modexppc.h index fbe70127..4d47281f 100644 --- a/modexppc.h +++ b/modexppc.h @@ -21,6 +21,8 @@ public: Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);} void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);} + virtual ~ModExpPrecomputation() { } + // non-inherited void SetModulus(const Integer &v) {m_mr.reset(new MontgomeryRepresentation(v));} const Integer & GetModulus() const {return m_mr->GetModulus();} diff --git a/rsa.cpp b/rsa.cpp index 59449c40..795ec61d 100644 --- a/rsa.cpp +++ b/rsa.cpp @@ -97,6 +97,8 @@ class RSAPrimeSelector : public PrimeSelector { public: RSAPrimeSelector(const Integer &e) : m_e(e) {} + virtual ~RSAPrimeSelector() { } + bool IsAcceptable(const Integer &candidate) const {return RelativelyPrime(m_e, candidate-Integer::One());} Integer m_e; };