diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-06-02 19:20:54 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:28:03 +0100 |
commit | 09c5ea43a2aa894f8ab1a30ae12f96c2b99a4c0b (patch) | |
tree | cb6134e301fe35e420f718a0dd30b246ff56b5cb /src/ringct/rctOps.cpp | |
parent | tests: new ringct test for checking H2 values (diff) | |
download | monero-09c5ea43a2aa894f8ab1a30ae12f96c2b99a4c0b.tar.xz |
ringct: simplify random key generation
Diffstat (limited to 'src/ringct/rctOps.cpp')
-rw-r--r-- | src/ringct/rctOps.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/ringct/rctOps.cpp b/src/ringct/rctOps.cpp index cf96da143..0561a191a 100644 --- a/src/ringct/rctOps.cpp +++ b/src/ringct/rctOps.cpp @@ -107,18 +107,13 @@ namespace rct { //generates a random scalar which can be used as a secret key or mask void skGen(key &sk) { - unsigned char tmp[64]; - rand(64, tmp); - memcpy(sk.bytes, tmp, 32); + sk = crypto::rand<key>(); sc_reduce32(sk.bytes); } //generates a random scalar which can be used as a secret key or mask key skGen() { - unsigned char tmp[64]; - rand(64, tmp); - key sk; - memcpy(sk.bytes, tmp, 32); + key sk = crypto::rand<key>(); sc_reduce32(sk.bytes); return sk; } |