From 956d310794468e1e6d424df9a4dce619f82636da Mon Sep 17 00:00:00 2001 From: William Allen Date: Tue, 9 May 2023 18:54:04 -0500 Subject: [PATCH] fix: add missing destructor for CoreMPL and final for nested classes (#371) Signing commit from @knst from https://github.com/Chia-Network/bls-signatures/pull/359 Co-authored-by: Konstantin Akimov <545784+knst@users.noreply.github.com> --- src/schemes.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/schemes.hpp b/src/schemes.hpp index a146080be..49300607c 100644 --- a/src/schemes.hpp +++ b/src/schemes.hpp @@ -39,6 +39,7 @@ class CoreMPL { public: CoreMPL() = delete; CoreMPL(const std::string& strId) : strCiphersuiteId(strId) {} + virtual ~CoreMPL() {} // Generates a private key from a seed, similar to HD key generation // (hashes the seed), and reduces it mod the group order virtual PrivateKey KeyGen(const vector& seed); @@ -96,7 +97,7 @@ class CoreMPL { bool NativeVerify(g1_t *pubKeys, g2_t *mappedHashes, size_t length); }; -class BasicSchemeMPL : public CoreMPL { +class BasicSchemeMPL final : public CoreMPL { public: static const std::string CIPHERSUITE_ID; BasicSchemeMPL() : CoreMPL(BasicSchemeMPL::CIPHERSUITE_ID) {} @@ -117,7 +118,7 @@ class BasicSchemeMPL : public CoreMPL { const G2Element& signature) override; }; -class AugSchemeMPL : public CoreMPL { +class AugSchemeMPL final : public CoreMPL { public: static const std::string CIPHERSUITE_ID; @@ -170,7 +171,7 @@ class AugSchemeMPL : public CoreMPL { const G2Element& signature) override; }; -class PopSchemeMPL : public CoreMPL { +class PopSchemeMPL final : public CoreMPL { public: static const std::string CIPHERSUITE_ID;