reth
reth copied to clipboard
fix: use consistent RNG source for ECIES nonce generation
Description
Problem: ECIES initialization was mixing randomness sources by using B256::random() for nonce generation while using a local RNG for ephemeral keys. This creates inconsistent entropy sources in cryptographic operations.
Solution: Generate nonce using the same local RNG instance that's already created for ephemeral key generation.
Changes:
- Replace
B256::random()withrng.fill_bytes()innew_client()andnew_server() - Add
RngCoreimport forfill_bytes()method