Skip to content

Commit

Permalink
fixed formatting and removed infos
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasxia01 committed Oct 5, 2023
1 parent 2e55921 commit 3455f3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ template <typename FF> class BaseTranscript {
/**
* @brief Compute next challenge c_next = H( Compress(c_prev || round_buffer) )
* @details This function computes a new challenge for the current round using the previous challenge
* and the current round data, if they are exist.
* It clears the current_round_data if nonempty after computing the challenge to minimize how much we
* compress. It also sets previous_challenge_buffer to the current challenge buffer to set up next function
* call.
* and the current round data, if they are exist. It clears the current_round_data if nonempty after
* computing the challenge to minimize how much we compress. It also sets previous_challenge_buffer
* to the current challenge buffer to set up next function call.
* @return std::array<uint8_t, HASH_OUTPUT_SIZE>
*/
[[nodiscard]] std::array<uint8_t, HASH_OUTPUT_SIZE> get_next_challenge_buffer()
Expand Down Expand Up @@ -146,7 +145,7 @@ template <typename FF> class BaseTranscript {
* the number of requested challenges.
* @details Challenges are generated by iteratively hashing over the previous challenge, using
* get_next_challenge_buffer().
* TODO(#741): Optimizations for this function include generalizing type of hash, splitting hashes into
* TODO(#741): Optimizations for this function include generalizing type of hash, splitting hashes into
* multiple challenges.
*
* @param labels human-readable names for the challenges for the manifest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ TEST_F(UltraTranscriptTests, ProverManifestConsistency)
auto manifest_expected = construct_ultra_honk_manifest(instance->proving_key->circuit_size);
auto prover_manifest = prover.transcript.get_manifest();
// Note: a manifest can be printed using manifest.print()
prover_manifest.print();
manifest_expected.print();
for (size_t round = 0; round < manifest_expected.size(); ++round) {
ASSERT_EQ(prover_manifest[round], manifest_expected[round]) << "Prover manifest discrepency in round " << round;
}
Expand Down Expand Up @@ -171,9 +169,6 @@ TEST_F(UltraTranscriptTests, VerifierManifestConsistency)
auto verifier = composer.create_verifier(instance);
verifier.verify_proof(proof);

prover.transcript.print();
verifier.transcript.print();

// Check consistency between the manifests generated by the prover and verifier
auto prover_manifest = prover.transcript.get_manifest();
auto verifier_manifest = verifier.transcript.get_manifest();
Expand All @@ -196,18 +191,14 @@ TEST_F(UltraTranscriptTests, ChallengeGenerationTest)
auto transcript = ProverTranscript<FF>::init_empty();
// test a bunch of challenges
auto challenges = transcript.get_challenges("a", "b", "c", "d", "e", "f");
// print challenges and check they are not 0
// check they are not 0
for (size_t i = 0; i < challenges.size(); ++i) {
info("Challenge ", i, ": ", challenges[i]);
ASSERT_NE(challenges[i], 0) << "Challenge " << i << " is 0";
}
constexpr uint32_t random_val{ 17 }; // arbitrary
transcript.send_to_verifier("random val", random_val);
// test more challenges
auto [a, b, c] = transcript.get_challenges("a", "b", "c");
info("Challenge a: ", a);
info("Challenge b: ", b);
info("Challenge c: ", c);
ASSERT_NE(a, 0) << "Challenge a is 0";
ASSERT_NE(b, 0) << "Challenge a is 0";
ASSERT_NE(b, 0) << "Challenge a is 0";
Expand Down Expand Up @@ -244,9 +235,6 @@ TEST_F(UltraTranscriptTests, FoldingManifestTest)
auto prover_res = prover.fold_instances();
verifier.fold_public_parameters(prover_res.folding_data);

prover.transcript.print();
verifier.transcript.print();

// Check consistency between the manifests generated by the prover and verifier
auto prover_manifest = prover.transcript.get_manifest();
auto verifier_manifest = verifier.transcript.get_manifest();
Expand Down

0 comments on commit 3455f3c

Please sign in to comment.