aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstate/global_rng.cpp20
-rw-r--r--src/libstate/libstate.h2
-rw-r--r--src/pubkey/blinding.cpp2
3 files changed, 12 insertions, 12 deletions
diff --git a/src/libstate/global_rng.cpp b/src/libstate/global_rng.cpp
index 411596da9..725ec2be1 100644
--- a/src/libstate/global_rng.cpp
+++ b/src/libstate/global_rng.cpp
@@ -107,60 +107,60 @@ class Serialized_PRNG : public RandomNumberGenerator
public:
void randomize(byte out[], u32bit len)
{
- Mutex_Holder lock(mutex);
+ std::lock_guard<std::mutex> lock(mutex);
rng->randomize(out, len);
}
bool is_seeded() const
{
- Mutex_Holder lock(mutex);
+ std::lock_guard<std::mutex> lock(mutex);
return rng->is_seeded();
}
void clear()
{
- Mutex_Holder lock(mutex);
+ std::lock_guard<std::mutex> lock(mutex);
rng->clear();
}
std::string name() const
{
- Mutex_Holder lock(mutex);
+ std::lock_guard<std::mutex> lock(mutex);
return rng->name();
}
void reseed(u32bit poll_bits)
{
- Mutex_Holder lock(mutex);
+ std::lock_guard<std::mutex> lock(mutex);
rng->reseed(poll_bits);
}
void add_entropy_source(EntropySource* es)
{
- Mutex_Holder lock(mutex);
+ std::lock_guard<std::mutex> lock(mutex);
rng->add_entropy_source(es);
}
void add_entropy(const byte in[], u32bit len)
{
- Mutex_Holder lock(mutex);
+ std::lock_guard<std::mutex> lock(mutex);
rng->add_entropy(in, len);
}
// We do not own the mutex; Library_State does
- Serialized_PRNG(RandomNumberGenerator* r, Mutex* m) :
+ Serialized_PRNG(RandomNumberGenerator* r, std::mutex& m) :
mutex(m), rng(r) {}
~Serialized_PRNG() { delete rng; }
private:
- Mutex* mutex;
+ std::mutex& mutex;
RandomNumberGenerator* rng;
};
}
RandomNumberGenerator* Library_State::make_global_rng(Algorithm_Factory& af,
- Mutex* mutex)
+ std::mutex& mutex)
{
RandomNumberGenerator* rng = 0;
diff --git a/src/libstate/libstate.h b/src/libstate/libstate.h
index 295fa1fa4..5af55e9d8 100644
--- a/src/libstate/libstate.h
+++ b/src/libstate/libstate.h
@@ -110,7 +110,7 @@ class BOTAN_DLL Library_State
std::string deref_alias(const std::string&);
private:
static RandomNumberGenerator* make_global_rng(Algorithm_Factory& af,
- Mutex* mutex);
+ std::mutex& mutex);
void load_default_config();
diff --git a/src/pubkey/blinding.cpp b/src/pubkey/blinding.cpp
index 47b320462..c4c0e3b6e 100644
--- a/src/pubkey/blinding.cpp
+++ b/src/pubkey/blinding.cpp
@@ -1,4 +1,4 @@
-n/*
+/*
* Blinding for public key operations
* (C) 1999-2010 Jack Lloyd
*