aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/crypto.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-05-14 22:08:10 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-05-15 00:05:59 +0100
commitd539be33590f7dfb0013187502744286f2959ee3 (patch)
tree8964a9107f7171cdbc0f490e581d92918462ed65 /src/crypto/crypto.cpp
parentMerge pull request #826 (diff)
downloadmonero-d539be33590f7dfb0013187502744286f2959ee3.tar.xz
crypto: make clear generate_random_bytes is not thread safe
And add a thread safe version to encourage proper use
Diffstat (limited to 'src/crypto/crypto.cpp')
-rw-r--r--src/crypto/crypto.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crypto/crypto.cpp b/src/crypto/crypto.cpp
index e47aab0f7..e251d0ec2 100644
--- a/src/crypto/crypto.cpp
+++ b/src/crypto/crypto.cpp
@@ -83,7 +83,7 @@ namespace crypto {
/* generate a random 32-byte (256-bit) integer and copy it to res */
static inline void random_scalar(ec_scalar &res) {
unsigned char tmp[64];
- generate_random_bytes(64, tmp);
+ generate_random_bytes_not_thread_safe(64, tmp);
sc_reduce(tmp);
memcpy(&res, tmp, 32);
}