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 ae4007cd6..ed172b0ed 100644 --- a/ec2n.h +++ b/ec2n.h @@ -100,6 +100,8 @@ template<> class EcPrecomputation : public DL_GroupPrecomputation class EcPrecomputation : public DL_GroupPrecomputationBERDecodePoint(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 1f3256766..9723a7ba3 100644 --- a/eprecomp.h +++ b/eprecomp.h @@ -44,6 +44,7 @@ class DL_FixedBasePrecomputationImpl : public DL_FixedBasePrecomputation 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 43cd2ed21..d1ad4eb96 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 730776d57..7a816843b 100644 --- a/luc.h +++ b/luc.h @@ -119,6 +119,8 @@ class DL_GroupPrecomputation_LUC : public DL_GroupPrecomputation 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 @@ class DL_BasePrecomputation_LUC : public DL_FixedBasePrecomputation 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 @@ class DL_GroupParameters_LUC : public DL_GroupParameters_IntegerBasedImpl 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 59449c40e..795ec61db 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; };