From 72e4e060f5d97993d12b190b8a6e9e61f6eb375c Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 10 May 2024 16:08:49 +0300 Subject: [PATCH] test: use deterministic PRG --- ot/mpz-ot-core/src/ferret/mod.rs | 3 ++- ot/mpz-ot-core/src/ferret/mpcot/mod.rs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ot/mpz-ot-core/src/ferret/mod.rs b/ot/mpz-ot-core/src/ferret/mod.rs index 9b52fded..4ea60c3f 100644 --- a/ot/mpz-ot-core/src/ferret/mod.rs +++ b/ot/mpz-ot-core/src/ferret/mod.rs @@ -54,6 +54,7 @@ mod tests { ideal_mpcot::{IdealMpcot, MpcotMsgForReceiver, MpcotMsgForSender}, }; use mpz_core::{lpn::LpnParameters, prg::Prg}; + use rand::SeedableRng; const LPN_PARAMETERS_TEST: LpnParameters = LpnParameters { n: 9600, @@ -63,7 +64,7 @@ mod tests { #[test] fn ferret_test() { - let mut prg = Prg::new(); + let mut prg = Prg::from_seed([1u8; 16].into()); let delta = prg.random_block(); let mut ideal_cot = IdealCOT::new_with_delta(delta); let mut ideal_mpcot = IdealMpcot::init_with_delta(delta); diff --git a/ot/mpz-ot-core/src/ferret/mpcot/mod.rs b/ot/mpz-ot-core/src/ferret/mpcot/mod.rs index 565a9ad9..e8c3043c 100644 --- a/ot/mpz-ot-core/src/ferret/mpcot/mod.rs +++ b/ot/mpz-ot-core/src/ferret/mpcot/mod.rs @@ -15,10 +15,11 @@ mod tests { }; use crate::ideal::ideal_spcot::{IdealSpcot, SpcotMsgForReceiver, SpcotMsgForSender}; use mpz_core::prg::Prg; + use rand::SeedableRng; #[test] fn mpcot_general_test() { - let mut prg = Prg::new(); + let mut prg = Prg::from_seed([1u8; 16].into()); let delta = prg.random_block(); let mut ideal_spcot = IdealSpcot::new_with_delta(delta); @@ -94,7 +95,7 @@ mod tests { #[test] fn mpcot_regular_test() { - let mut prg = Prg::new(); + let mut prg = Prg::from_seed([2u8; 16].into()); let delta = prg.random_block(); let mut ideal_spcot = IdealSpcot::new_with_delta(delta);