diff options
Diffstat (limited to 'cryptlib.cpp')
-rw-r--r-- | cryptlib.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cryptlib.cpp b/cryptlib.cpp index a4f972e..8cf68fb 100644 --- a/cryptlib.cpp +++ b/cryptlib.cpp @@ -145,16 +145,16 @@ void RandomNumberGenerator::DiscardBytes(unsigned int n) GenerateByte(); } -RandomNumberGenerator & NullRNG() +class ClassNullRNG : public RandomNumberGenerator { - class NullRNG : public RandomNumberGenerator - { - public: - std::string AlgorithmName() const {return "NullRNG";} - byte GenerateByte() {throw NotImplemented("NullRNG: NullRNG should only be passed to functions that don't need to generate random bytes");} - }; +public: + std::string AlgorithmName() const {return "NullRNG";} + byte GenerateByte() {throw NotImplemented("NullRNG: NullRNG should only be passed to functions that don't need to generate random bytes");} +}; - static NullRNG s_nullRNG; +RandomNumberGenerator & NullRNG() +{ + static ClassNullRNG s_nullRNG; return s_nullRNG; } |