Use SECRET_KEYLENGTH for ed25519PrivateKey::GenerateRandom

This commit is contained in:
Jeffrey Walton 2019-02-06 19:20:48 -05:00
parent 23a32c4e3d
commit dde43de786
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -468,7 +468,7 @@ void ed25519PrivateKey::GenerateRandom(RandomNumberGenerator &rng, const NameVal
if (params.GetValue(Name::Seed(), seed) && rng.CanIncorporateEntropy())
rng.IncorporateEntropy(seed.begin(), seed.size());
rng.GenerateBlock(m_sk, 32);
rng.GenerateBlock(m_sk, SECRET_KEYLENGTH);
m_sk[0] &= 248; m_sk[31] &= 127; m_sk[31] |= 64;
int ret = Donna::ed25519_publickey(m_pk, m_sk);
CRYPTOPP_ASSERT(ret == 0); CRYPTOPP_UNUSED(ret);