From ff4e6654d1050f3fd2782bdefb08cd50c87b241c Mon Sep 17 00:00:00 2001 From: zz-sol Date: Thu, 18 Jun 2026 07:32:53 -0400 Subject: [PATCH] [ed25519] improve rng bounds for random function (#54) --- curve25519/solana-ed25519/src/edwards.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curve25519/solana-ed25519/src/edwards.rs b/curve25519/solana-ed25519/src/edwards.rs index b6fe18b..f989c2f 100644 --- a/curve25519/solana-ed25519/src/edwards.rs +++ b/curve25519/solana-ed25519/src/edwards.rs @@ -118,7 +118,7 @@ use { }; #[cfg(feature = "rand_core")] -use rand_core::RngCore; +use rand_core::{CryptoRng, RngCore}; use subtle::Choice; use subtle::ConditionallyNegatable; @@ -741,7 +741,7 @@ impl EdwardsPoint { /// /// # Inputs /// - /// * `rng`: any RNG which implements `RngCore` + /// * `rng`: any RNG which implements `CryptoRng` and `RngCore` /// /// # Returns /// @@ -752,7 +752,7 @@ impl EdwardsPoint { /// Uses rejection sampling, generating a random `CompressedEdwardsY` and then attempting point /// decompression, rejecting invalid points. #[cfg(feature = "rand_core")] - pub fn random(rng: &mut R) -> Self { + pub fn random(rng: &mut R) -> Self { let mut repr = CompressedEdwardsY([0u8; 32]); loop { rng.fill_bytes(&mut repr.0);