pub fn prove<P: Prover<F>>(transcript: &mut Transcript, mut prover: P) -> Self {
        let rounds = prover.rounds();
        let mut messages = Vec::with_capacity(rounds);
        let mut challenges = Vec::with_capacity(rounds);

        while let Some(message) = prover.next_message() {
            // add the message sent to the transcript
            transcript.append_prover_message(b"evaluations", &message);
            // compute the challenge for the next round
            let challenge = transcript.get_challenge::<F>(b"challenge");
            // Extract current randomness and fold the polynomials.
            prover.fold(challenge);

            // add the message to the final proof
            messages.push(message);
            challenges.push(challenge);
        }

        let rounds = prover.rounds();
        let final_foldings = vec![prover.final_foldings().unwrap()];
        // Add the final foldings to the transcript
        transcript.append_scalar(b"final-folding", &final_foldings[0][0]);
        transcript.append_scalar(b"final-folding", &final_foldings[0][1]);

        Sumcheck {
            messages,
            challenges,
            rounds,
            final_foldings,
        }
    }
/// Prove function for the scalar product.
/// The input contains a randomness generator and a prover struct.
/// The prover struct can be either time-efficient or space-efficient
/// depending on the configuration.
Prove function for the scalar product.
The input contains a randomness generator and a prover struct.
The prover struct can be either time-efficient or space-efficient
depending on the configuration.
Prove function for the scalar product . The input contains a randomness generator and a prover struct . The prover struct can be either time - efficient or space - efficient depending on the configuration .
pub fn prove<P: Prover<F>>(transcript: &mut Transcript, mut prover: P) -> Self {
        let rounds = prover.rounds();
        let mut messages = Vec::with_capacity(rounds);
        let mut challenges = Vec::with_capacity(rounds);
        while let Some(message) = prover.next_message() {
            // add the message sent to the transcript
            transcript.append_prover_message(b"evaluations", &message);
            // compute the challenge for the next round
            let challenge = transcript.get_challenge::<F>(b"challenge");
            // Extract current randomness and fold the polynomials.
            prover.fold(challenge);
            // add the message to the final proof
            messages.push(message);
            challenges.push(challenge);
        }
        let rounds = prover.rounds();
        let final_foldings = vec![prover.final_foldings().unwrap()];
        // Add the final foldings to the transcript
        transcript.append_scalar(b"final-folding", &final_foldings[0][0]);
        transcript.append_scalar(b"final-folding", &final_foldings[0][1]);
        Sumcheck {
            messages,
            challenges,
            rounds,
            final_foldings,
        }
    }
pub fn prove < P : Prover < F > > ( transcript : & mut Transcript , mut prover : P ) -> Self { let rounds = prover . rounds ( ) ; let mut messages = Vec :: with_capacity ( rounds ) ; let mut challenges = Vec :: with_capacity ( rounds ) ; while let Some ( message ) = prover . next_message ( ) { // add the message sent to the transcript transcript . append_prover_message ( b" " , & message ) ; // compute the challenge for the next round let challenge = transcript . get_challenge :: < F > ( b" " ) ; // Extract current randomness and fold the polynomials. prover . fold ( challenge ) ; // add the message to the final proof messages . push ( message ) ; challenges . push ( challenge ) ; } let rounds = prover . rounds ( ) ; let final_foldings = vec ! [ prover final_foldings ( ) unwrap ( ) ] ; // Add the final foldings to the transcript transcript . append_scalar ( b" " , & final_foldings [ 0 ] [ 0 ] ) ; transcript . append_scalar ( b" " , & final_foldings [ 0 ] [ 1 ] ) ; Sumcheck { messages , challenges , rounds , final_foldings , } }
Prove function for the scalar product.
Prove function for the scalar product .
transcript
&mut Transcript
prover
P