ringct: simplify random key generation

This commit is contained in:
moneromooo-monero 2016-06-02 19:20:54 +01:00
parent 53cdf4df5e
commit 09c5ea43a2
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -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;
}