@@ -711,7 +711,7 @@ void print_detailed_transcript_data(
711711
712712 const size_t digest_len_bytes = 2 * (params.security_parameter / 8 );
713713 const size_t field_size = (libff::log_of_field_size_helper<FieldT>(FieldT::zero ()) + 7 ) / 8 ;
714- std::vector<size_t > two_to_one_hashes_by_round ;
714+ std::vector<size_t > internal_hash_complexity_by_round ;
715715 std::vector<size_t > leaf_hashes_by_round;
716716 std::vector<size_t > zk_hashes_by_round;
717717 std::vector<size_t > IOP_size_by_round;
@@ -743,10 +743,9 @@ void print_detailed_transcript_data(
743743 query_positions.emplace_back (MT_position);
744744 }
745745 }
746- size_t num_two_to_one_hashes_in_round =
747- MT.count_hashes_to_verify_set_membership_proof (
748- query_positions);
749- two_to_one_hashes_by_round.emplace_back (num_two_to_one_hashes_in_round);
746+ size_t internal_hash_complexity_in_round =
747+ MT.count_internal_hash_complexity_to_verify_set_membership (query_positions);
748+ internal_hash_complexity_by_round.emplace_back (internal_hash_complexity_in_round);
750749 const size_t num_values_per_leaf = transcript.query_responses_ [round][0 ].size ();
751750 const size_t num_leaves = transcript.query_responses_ [round].size ();
752751 leaf_hashes_by_round.emplace_back (num_values_per_leaf * num_leaves);
@@ -790,14 +789,17 @@ void print_detailed_transcript_data(
790789
791790 printf (" \n " );
792791 printf (" total prover messages size: %lu\n " , total_prover_message_size);
793- const size_t total_two_to_one_hashes = std::accumulate (
794- two_to_one_hashes_by_round .begin (), two_to_one_hashes_by_round .end (), 0 );
792+ const size_t total_internal_hash_complexity = std::accumulate (
793+ internal_hash_complexity_by_round .begin (), internal_hash_complexity_by_round .end (), 0 );
795794 const size_t total_leaves_hashed = std::accumulate (
796795 leaf_hashes_by_round.begin (), leaf_hashes_by_round.end (), 0 );
797796 const size_t total_zk_hashes = std::accumulate (
798797 zk_hashes_by_round.begin (), zk_hashes_by_round.end (), 0 );
799- const size_t total_hashes = total_two_to_one_hashes + total_leaves_hashed + total_zk_hashes;
800- printf (" total two to one hashes: %lu\n " , total_two_to_one_hashes);
798+ /* Since each two-to-one hash is counted as two units, we divide by 2 here to make it consistent.
799+ It would be nice to take into account how many leaves are hashed, but we are unfortunately
800+ not provided this information. */
801+ const size_t total_hashes = total_internal_hash_complexity / 2 + total_leaves_hashed + total_zk_hashes;
802+ printf (" total internal hash complexity: %lu\n " , total_internal_hash_complexity);
801803 printf (" total leaves hashed: %lu\n " , total_leaves_hashed);
802804 printf (" total hashes: %lu\n " , total_hashes);
803805 printf (" \n " );
@@ -810,7 +812,7 @@ void print_detailed_transcript_data(
810812 printf (" MT_depth %lu\n " , MT_depths[round]);
811813 printf (" IOP size: %lu bytes\n " , IOP_size_by_round[round]);
812814 printf (" BCS size: %lu bytes\n " , BCS_size_by_round[round]);
813- printf (" number of two to one hashes : %lu\n " , two_to_one_hashes_by_round [round]);
815+ printf (" internal hash complexity : %lu\n " , internal_hash_complexity_by_round [round]);
814816 printf (" number of leaves hashed: %lu\n " , leaf_hashes_by_round[round]);
815817 if (make_zk[round])
816818 {
0 commit comments