mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 13:23:29 +01:00
ringct: simplify random key generation
This commit is contained in:
parent
53cdf4df5e
commit
09c5ea43a2
@ -107,18 +107,13 @@ namespace rct {
|
|||||||
|
|
||||||
//generates a random scalar which can be used as a secret key or mask
|
//generates a random scalar which can be used as a secret key or mask
|
||||||
void skGen(key &sk) {
|
void skGen(key &sk) {
|
||||||
unsigned char tmp[64];
|
sk = crypto::rand<key>();
|
||||||
rand(64, tmp);
|
|
||||||
memcpy(sk.bytes, tmp, 32);
|
|
||||||
sc_reduce32(sk.bytes);
|
sc_reduce32(sk.bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
//generates a random scalar which can be used as a secret key or mask
|
//generates a random scalar which can be used as a secret key or mask
|
||||||
key skGen() {
|
key skGen() {
|
||||||
unsigned char tmp[64];
|
key sk = crypto::rand<key>();
|
||||||
rand(64, tmp);
|
|
||||||
key sk;
|
|
||||||
memcpy(sk.bytes, tmp, 32);
|
|
||||||
sc_reduce32(sk.bytes);
|
sc_reduce32(sk.bytes);
|
||||||
return sk;
|
return sk;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user