mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Only support 32-byte keys in ChaCha20{,Aligned}
This commit is contained in:
@@ -599,7 +599,7 @@ uint256 GetRandHash() noexcept
|
||||
void FastRandomContext::RandomSeed()
|
||||
{
|
||||
uint256 seed = GetRandHash();
|
||||
rng.SetKey(seed.begin(), 32);
|
||||
rng.SetKey32(seed.begin());
|
||||
requires_seed = false;
|
||||
}
|
||||
|
||||
@@ -623,7 +623,7 @@ std::vector<unsigned char> FastRandomContext::randbytes(size_t len)
|
||||
|
||||
FastRandomContext::FastRandomContext(const uint256& seed) noexcept : requires_seed(false), bitbuf_size(0)
|
||||
{
|
||||
rng.SetKey(seed.begin(), 32);
|
||||
rng.SetKey32(seed.begin());
|
||||
}
|
||||
|
||||
bool Random_SanityCheck()
|
||||
@@ -678,7 +678,7 @@ FastRandomContext::FastRandomContext(bool fDeterministic) noexcept : requires_se
|
||||
return;
|
||||
}
|
||||
uint256 seed;
|
||||
rng.SetKey(seed.begin(), 32);
|
||||
rng.SetKey32(seed.begin());
|
||||
}
|
||||
|
||||
FastRandomContext& FastRandomContext::operator=(FastRandomContext&& from) noexcept
|
||||
|
||||
Reference in New Issue
Block a user