|
rand.seed(time(nullptr) + *reinterpret_cast<unsigned long*>(openssl_seed)); |
You're seeding GMP's Mersenne Twister RNG...
With 64 bits...
You should change the function name from generate_secure_private_key to generate_weak_entropy.
In other words, you're discarding 28 bytes of good entropy, to seed a PRNG which can be trivially inverted, to generate 512bits of bad entropy, which is then used as key material!
OpenFrogget/src/keygen.cpp
Line 16 in 43acb93
You're seeding GMP's Mersenne Twister RNG...
With 64 bits...
You should change the function name from
generate_secure_private_keytogenerate_weak_entropy.In other words, you're discarding 28 bytes of good entropy, to seed a PRNG which can be trivially inverted, to generate 512bits of bad entropy, which is then used as key material!