sdk/crypto/blind: Don't use generics for fn random()

This commit is contained in:
parazyd
2024-03-05 08:16:57 +01:00
parent 7010aae22e
commit 551b96d4f9

View File

@@ -21,6 +21,7 @@ use darkfi_serial::{async_trait, AsyncDecodable, AsyncEncodable};
use darkfi_serial::{Decodable, Encodable, SerialDecodable, SerialEncodable};
use pasta_curves::{group::ff::Field, pallas};
use rand_core::{CryptoRng, RngCore};
#[cfg(feature = "async")]
pub trait EncDecode: Encodable + Decodable + AsyncEncodable + AsyncDecodable {}
@@ -37,7 +38,7 @@ pub struct Blind<F: Field + EncDecode>(pub F);
impl<F: Field + EncDecode> Blind<F> {
pub const ZERO: Self = Self(F::ZERO);
pub fn random<RngCore: rand_core::RngCore>(rng: &mut RngCore) -> Self {
pub fn random(rng: &mut (impl CryptoRng + RngCore)) -> Self {
Self(F::random(rng))
}