pub fn receive_prover_current_round(
        &mut self,
        ns: NameSpace,
        expected_message_info: ProverRoundMessageInfo,
        trace: TraceInfo,
    ) -> Result<MsgRoundRef, SynthesisError> {
        if expected_message_info.reed_solomon_code_degree_bound.len() > 0 {
            // LDT is used. This prover round must not use custom domain.
            assert_eq!(expected_message_info.leaves_type, LeavesType::UseCodewordDomain,
                       "This round contains low-degree oracle, but custom length and localization parameter is used. ");
        }

        let index = self.current_prover_round;
        self.current_prover_round += 1;

        let trace_info = {
            ark_std::format!(
                "\n Message trace: {}\n Namespace trace: {}",
                trace,
                ns.trace
            )
        };

        if index >= self.proof.prover_iop_messages_by_round.len() {
            panic!(
                "Verifier tried to receive extra prove round message. {}",
                trace_info
            );
        }

        // check basic consistency with message received
        let current_round = &self.proof.prover_iop_messages_by_round[index];
        let num_short_message_expected = expected_message_info.num_short_messages;
        let num_short_message_received = current_round.short_messages.len();
        let num_oracles_expected = expected_message_info.num_oracles();
        let num_oracles_received = current_round.queried_cosets.get(0).map_or(0, |c| c.len());

        // here are some sanity check to make sure user is not doing wrong thing
        // check 1: `num_short_messages` and `num_oracles` should be consistent with
        // expected
        assert_eq!(
            num_short_message_expected, num_short_message_received,
            "Number of short messages received is not equal to expected. {}",
            trace_info
        );
        assert_eq!(
            num_oracles_expected, num_oracles_received,
            "Number of oracles received is not equal to expected. {}",
            trace_info
        );
        // check 2: number of oracles in each query result should be the same
        current_round.queried_cosets.iter().for_each(|c| {
            assert_eq!(
                c.len(),
                num_oracles_expected,
                "Number of oracles in each query result is not equal to expected. {}",
                trace_info
            );
        });
        // check 3: number of rs-codes should not exceed number of oracles
        assert!(
            expected_message_info.reed_solomon_code_degree_bound.len() <= num_oracles_expected,
            "Number of Reed-Solomon codes is greater than number of oracles. {}",
            trace_info
        );
        // check 4: if there are rs-codes, LeavesType should be UseCodewordDomain
        if expected_message_info.reed_solomon_code_degree_bound.len() > 0 {
            assert_eq!(
                expected_message_info.leaves_type,
                LeavesType::UseCodewordDomain,
                "If there are Reed-Solomon codes, leaves type should be UseCodewordDomain. {}",
                trace_info
            );
        }
        // check 5: if LeavesType is UseCodewordDomain, then length and localization
        // parameter should be same as length and localization for transcript
        if expected_message_info.leaves_type == LeavesType::UseCodewordDomain {
            assert_eq!(
                expected_message_info.length,
                self.ldt_codeword_domain.expect("codeword domain is not set").size(),
                "If leaves type is UseCodewordDomain, then length and localization parameter should be same as length and localization for transcript. {}",
                trace_info
            );
            assert_eq!(
                expected_message_info.localization_parameter,
                self.ldt_localization_parameter.expect("localization parameter is not set"),
                "If leaves type is UseCodewordDomain, then length and localization parameter should be same as length and localization for transcript. {}",
                trace_info
            );
        }

        // check 6.1: if there are no message oracles, length and localization parameter
        // should be 0
        if num_oracles_expected == 0 {
            assert_eq!(
                expected_message_info.length, 0,
                "If there are no message oracles, length should be 0. {}",
                trace_info
            );
            assert_eq!(
                expected_message_info.localization_parameter, 0,
                "If there are no message oracles, localization parameter should be 0. {}",
                trace_info
            );
        }
        // check 6.2: if there are message oracles length should be power of 2, and
        // 2^localization_parameter should <= length
        else {
            assert!(
                expected_message_info.length.is_power_of_two(),
                "Length should be power of 2. {}",
                trace_info
            );
            assert!(
                (1 << expected_message_info.localization_parameter) <= expected_message_info.length,
                "2^localization_parameter should <= oracle length. {}",
                trace_info
            );
        }

        // absorb merkle tree root, if any
        self.sponge
            .absorb(&self.proof.prover_messages_mt_root[index])?;
        // absorb short messages for this round, if any
        self.proof.prover_iop_messages_by_round[index]
            .short_messages
            .iter()
            .try_for_each(|msg| self.sponge.absorb(msg))?;
        // attach prover info to transcript
        self.expected_prover_messages_info
            .push(expected_message_info);
        Ok(self.attach_latest_prover_round_to_namespace(ns, false, trace))
    }
/// Receive prover's current round messages, which can possibly contain
/// multiple oracles with same size. This function will absorb the
/// merkle tree root and short messages (if any).
///
/// If the function contains low-degree oracle, localization parameter in
/// `expected_message_info` will be ignored, because localization
/// parameter is managed by LDT. # Panic
/// This function will panic is prover message structure contained in proof
/// is not consistent with `expected_message_structure`.
Receive prover's current round messages, which can possibly contain
multiple oracles with same size. This function will absorb the
merkle tree root and short messages (if any).

If the function contains low-degree oracle, localization parameter in
`expected_message_info` will be ignored, because localization
parameter is managed by LDT. # Panic
This function will panic is prover message structure contained in proof
is not consistent with `expected_message_structure`.
Receive prover ' s current round messages which can possibly contain multiple oracles with same size . This function will absorb the merkle tree root and short messages ( if any ) . If the function contains low - degree oracle localization parameter in ` expected_message_info ` will be ignored because localization parameter is managed by LDT . # Panic This function will panic is prover message structure contained in proof is not consistent with ` expected_message_structure ` .
pub fn receive_prover_current_round(
        &mut self,
        ns: NameSpace,
        expected_message_info: ProverRoundMessageInfo,
        trace: TraceInfo,
    ) -> Result<MsgRoundRef, SynthesisError> {
        if expected_message_info.reed_solomon_code_degree_bound.len() > 0 {
            // LDT is used. This prover round must not use custom domain.
            assert_eq!(expected_message_info.leaves_type, LeavesType::UseCodewordDomain,
                       "This round contains low-degree oracle, but custom length and localization parameter is used. ");
        }
        let index = self.current_prover_round;
        self.current_prover_round += 1;
        let trace_info = {
            ark_std::format!(
                "\n Message trace: {}\n Namespace trace: {}",
                trace,
                ns.trace
            )
        };
        if index >= self.proof.prover_iop_messages_by_round.len() {
            panic!(
                "Verifier tried to receive extra prove round message. {}",
                trace_info
            );
        }
        // check basic consistency with message received
        let current_round = &self.proof.prover_iop_messages_by_round[index];
        let num_short_message_expected = expected_message_info.num_short_messages;
        let num_short_message_received = current_round.short_messages.len();
        let num_oracles_expected = expected_message_info.num_oracles();
        let num_oracles_received = current_round.queried_cosets.get(0).map_or(0, |c| c.len());
        // here are some sanity check to make sure user is not doing wrong thing
        // check 1: `num_short_messages` and `num_oracles` should be consistent with
        // expected
        assert_eq!(
            num_short_message_expected, num_short_message_received,
            "Number of short messages received is not equal to expected. {}",
            trace_info
        );
        assert_eq!(
            num_oracles_expected, num_oracles_received,
            "Number of oracles received is not equal to expected. {}",
            trace_info
        );
        // check 2: number of oracles in each query result should be the same
        current_round.queried_cosets.iter().for_each(|c| {
            assert_eq!(
                c.len(),
                num_oracles_expected,
                "Number of oracles in each query result is not equal to expected. {}",
                trace_info
            );
        });
        // check 3: number of rs-codes should not exceed number of oracles
        assert!(
            expected_message_info.reed_solomon_code_degree_bound.len() <= num_oracles_expected,
            "Number of Reed-Solomon codes is greater than number of oracles. {}",
            trace_info
        );
        // check 4: if there are rs-codes, LeavesType should be UseCodewordDomain
        if expected_message_info.reed_solomon_code_degree_bound.len() > 0 {
            assert_eq!(
                expected_message_info.leaves_type,
                LeavesType::UseCodewordDomain,
                "If there are Reed-Solomon codes, leaves type should be UseCodewordDomain. {}",
                trace_info
            );
        }
        // check 5: if LeavesType is UseCodewordDomain, then length and localization
        // parameter should be same as length and localization for transcript
        if expected_message_info.leaves_type == LeavesType::UseCodewordDomain {
            assert_eq!(
                expected_message_info.length,
                self.ldt_codeword_domain.expect("codeword domain is not set").size(),
                "If leaves type is UseCodewordDomain, then length and localization parameter should be same as length and localization for transcript. {}",
                trace_info
            );
            assert_eq!(
                expected_message_info.localization_parameter,
                self.ldt_localization_parameter.expect("localization parameter is not set"),
                "If leaves type is UseCodewordDomain, then length and localization parameter should be same as length and localization for transcript. {}",
                trace_info
            );
        }
        // check 6.1: if there are no message oracles, length and localization parameter
        // should be 0
        if num_oracles_expected == 0 {
            assert_eq!(
                expected_message_info.length, 0,
                "If there are no message oracles, length should be 0. {}",
                trace_info
            );
            assert_eq!(
                expected_message_info.localization_parameter, 0,
                "If there are no message oracles, localization parameter should be 0. {}",
                trace_info
            );
        }
        // check 6.2: if there are message oracles length should be power of 2, and
        // 2^localization_parameter should <= length
        else {
            assert!(
                expected_message_info.length.is_power_of_two(),
                "Length should be power of 2. {}",
                trace_info
            );
            assert!(
                (1 << expected_message_info.localization_parameter) <= expected_message_info.length,
                "2^localization_parameter should <= oracle length. {}",
                trace_info
            );
        }
        // absorb merkle tree root, if any
        self.sponge
            .absorb(&self.proof.prover_messages_mt_root[index])?;
        // absorb short messages for this round, if any
        self.proof.prover_iop_messages_by_round[index]
            .short_messages
            .iter()
            .try_for_each(|msg| self.sponge.absorb(msg))?;
        // attach prover info to transcript
        self.expected_prover_messages_info
            .push(expected_message_info);
        Ok(self.attach_latest_prover_round_to_namespace(ns, false, trace))
    }
pub fn receive_prover_current_round ( & mut self , ns : NameSpace , expected_message_info : ProverRoundMessageInfo , trace : TraceInfo , ) -> Result < MsgRoundRef , SynthesisError > { if expected_message_info . reed_solomon_code_degree_bound . len ( ) > 0 { // LDT is used. This prover round must not use custom domain. assert_eq ! ( expected_message_info leaves_type LeavesType UseCodewordDomain " " ) ; } let index = self . current_prover_round ; self . current_prover_round += 1 ; let trace_info = { ark_std :: format ! ( " \n \n " trace ns trace ) } ; if index >= self . proof . prover_iop_messages_by_round . len ( ) { panic ! ( " " trace_info ) ; } // check basic consistency with message received let current_round = & self . proof . prover_iop_messages_by_round [ index ] ; let num_short_message_expected = expected_message_info . num_short_messages ; let num_short_message_received = current_round . short_messages . len ( ) ; let num_oracles_expected = expected_message_info . num_oracles ( ) ; let num_oracles_received = current_round . queried_cosets . get ( 0 ) . map_or ( 0 , | c | c . len ( ) ) ; // here are some sanity check to make sure user is not doing wrong thing // check 1: `num_short_messages` and `num_oracles` should be consistent with // expected assert_eq ! ( num_short_message_expected num_short_message_received " " trace_info ) ; assert_eq ! ( num_oracles_expected num_oracles_received " " trace_info ) ; // check 2: number of oracles in each query result should be the same current_round . queried_cosets . iter ( ) . for_each ( | c | { assert_eq ! ( c len ( ) num_oracles_expected " " trace_info ) ; } ) ; // check 3: number of rs-codes should not exceed number of oracles assert ! ( expected_message_info reed_solomon_code_degree_bound len ( ) num_oracles_expected " " trace_info ) ; // check 4: if there are rs-codes, LeavesType should be UseCodewordDomain if expected_message_info . reed_solomon_code_degree_bound . len ( ) > 0 { assert_eq ! ( expected_message_info leaves_type LeavesType UseCodewordDomain " " trace_info ) ; } // check 5: if LeavesType is UseCodewordDomain, then length and localization // parameter should be same as length and localization for transcript if expected_message_info . leaves_type == LeavesType :: UseCodewordDomain { assert_eq ! ( expected_message_info length self ldt_codeword_domain expect ( " " ) size ( ) " " trace_info ) ; assert_eq ! ( expected_message_info localization_parameter self ldt_localization_parameter expect ( " " ) " " trace_info ) ; } // check 6.1: if there are no message oracles, length and localization parameter // should be 0 if num_oracles_expected == 0 { assert_eq ! ( expected_message_info length 0 " " trace_info ) ; assert_eq ! ( expected_message_info localization_parameter 0 " " trace_info ) ; } // check 6.2: if there are message oracles length should be power of 2, and // 2^localization_parameter should <= length else { assert ! ( expected_message_info length is_power_of_two ( ) " " trace_info ) ; assert ! ( ( 1 expected_message_info localization_parameter ) expected_message_info length " " trace_info ) ; } // absorb merkle tree root, if any self . sponge . absorb ( & self . proof . prover_messages_mt_root [ index ] ) ? ; // absorb short messages for this round, if any self . proof . prover_iop_messages_by_round [ index ] . short_messages . iter ( ) . try_for_each ( | msg | self . sponge . absorb ( msg ) ) ? ; // attach prover info to transcript self . expected_prover_messages_info . push ( expected_message_info ) ; Ok ( self . attach_latest_prover_round_to_namespace ( ns , false , trace ) ) }
Receive prover's current round messages, which can possibly contain
multiple oracles with same size.
Receive prover ' s current round messages which can possibly contain multiple oracles with same size .
&mut self
ns
NameSpace
expected_message_info
ProverRoundMessageInfo
trace
TraceInfo
&mut self
ns
NameSpace
expected_message_info
ProverRoundMessageInfo
trace
TraceInfo