mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 02:38:52 +00:00
ringct: lock access to the PRNG
This commit is contained in:
parent
4d7f073491
commit
86b4426191
@ -108,7 +108,7 @@ 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];
|
unsigned char tmp[64];
|
||||||
generate_random_bytes(64, tmp);
|
rand(64, tmp);
|
||||||
memcpy(sk.bytes, tmp, 32);
|
memcpy(sk.bytes, tmp, 32);
|
||||||
sc_reduce32(sk.bytes);
|
sc_reduce32(sk.bytes);
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ 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
|
||||||
key skGen() {
|
key skGen() {
|
||||||
unsigned char tmp[64];
|
unsigned char tmp[64];
|
||||||
generate_random_bytes(64, tmp);
|
rand(64, tmp);
|
||||||
key sk;
|
key sk;
|
||||||
memcpy(sk.bytes, tmp, 32);
|
memcpy(sk.bytes, tmp, 32);
|
||||||
sc_reduce32(sk.bytes);
|
sc_reduce32(sk.bytes);
|
||||||
|
Loading…
Reference in New Issue
Block a user