@@ -568,7 +568,21 @@ pub(crate) mod testing {
568568 CurveConfig < Self > : TECurveConfig + Clone ,
569569 AffinePoint < Self > : TEMapping < CurveConfig < Self > > ,
570570 {
571- fn ring_context ( ) -> & ' static RingContext < Self > ;
571+ const SRS_FILE : & str ;
572+
573+ fn context ( ) -> & ' static RingContext < Self > ;
574+
575+ fn load_context ( ) -> RingContext < Self > {
576+ use ark_serialize:: CanonicalDeserialize ;
577+
578+ use std:: { fs:: File , io:: Read } ;
579+ let mut file = File :: open ( crate :: testing:: PCS_SRS_FILE ) . unwrap ( ) ;
580+ let mut buf = Vec :: new ( ) ;
581+ file. read_to_end ( & mut buf) . unwrap ( ) ;
582+ let pcs_params =
583+ PcsParams :: < Self > :: deserialize_uncompressed_unchecked ( & mut & buf[ ..] ) . unwrap ( ) ;
584+ RingContext :: from_srs ( crate :: ring:: testing:: TEST_RING_SIZE , pcs_params) . unwrap ( )
585+ }
572586 }
573587
574588 pub struct TestVector < S : RingSuite >
@@ -617,7 +631,7 @@ pub(crate) mod testing {
617631 let input = Input :: < S > :: from ( pedersen. base . h ) ;
618632 let output = Output :: from ( pedersen. base . gamma ) ;
619633
620- let ring_ctx = <S as RingSuiteExt >:: ring_context ( ) ;
634+ let ring_ctx = <S as RingSuiteExt >:: context ( ) ;
621635
622636 use ark_std:: rand:: SeedableRng ;
623637 let rng = & mut rand_chacha:: ChaCha20Rng :: from_seed ( [ 0x11 ; 32 ] ) ;
@@ -681,7 +695,7 @@ pub(crate) mod testing {
681695 let public = secret. public ( ) ;
682696 assert_eq ! ( public. 0 , self . pedersen. base. pk) ;
683697
684- let ring_ctx = <S as RingSuiteExt >:: ring_context ( ) ;
698+ let ring_ctx = <S as RingSuiteExt >:: context ( ) ;
685699
686700 let prover_idx = self . ring_pks . iter ( ) . position ( |& pk| pk == public. 0 ) . unwrap ( ) ;
687701
0 commit comments