summaryrefslogtreecommitdiff
path: root/osrng.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-07-06 09:23:37 -0400
committerGitHub <noreply@github.com>2018-07-06 09:23:37 -0400
commitb74a6f444568e59a7766d1e286f82d2ce3086dcd (patch)
tree97937fe23f742f6c352f39e206b7ce7d774ba358 /osrng.h
parent6d9047b444731175e6ea9a447a3f0002685804be (diff)
downloadcryptopp-git-b74a6f444568e59a7766d1e286f82d2ce3086dcd.tar.gz
Add algorithm provider member function to Algorithm class
Diffstat (limited to 'osrng.h')
-rw-r--r--osrng.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/osrng.h b/osrng.h
index 0dbca3ff..f80c5748 100644
--- a/osrng.h
+++ b/osrng.h
@@ -221,6 +221,8 @@ public:
void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length)
{m_rng->GenerateIntoBufferedTransformation(target, channel, length);}
+ std::string AlgorithmProvider() const;
+
private:
member_ptr<RandomNumberGenerator> m_rng;
};
@@ -253,6 +255,14 @@ void AutoSeededX917RNG<BLOCK_CIPHER>::Reseed(bool blocking, const byte *input, s
Reseed(key, BLOCK_CIPHER::DEFAULT_KEYLENGTH, seed, NULLPTR);
}
+template <class BLOCK_CIPHER>
+std::string AutoSeededX917RNG<BLOCK_CIPHER>::AlgorithmProvider() const
+{
+ // Hack for now... We need to instantiate one
+ typename BLOCK_CIPHER::Encryption bc;
+ return bc.AlgorithmProvider();
+}
+
CRYPTOPP_DLL_TEMPLATE_CLASS AutoSeededX917RNG<AES>;
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)