Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small change that was left out of construct_addition_chains fix #404

Merged
merged 2 commits into from
May 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -482,15 +482,15 @@ TEST(scalar_multiplication, construct_addition_chains)
bucket_counts,
&bit_offsets[0],
state.point_schedule,
num_points,
static_cast<uint32_t>(state.round_counts[0]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, so num_points is really the number of points in a round, and this is determined where round_counts is set in the call to compute_wnaf_states. This test is not a real test because there are no assertions or expectations expressed, and probably a proper test would have made this error clear long ago. Is that right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover, the commented-out line here should not be there, and the timing output is misleading: the line
std::cout << "scalar mul: " << diff.count() << "ms" << std::endl;
should be
info("construct addition chains: ", diff.count(), "ms");
Would you please delete the commented out line and change the printing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, one sec

static_cast<uint32_t>(num_buckets),
bucket_empty_status };

start = std::chrono::steady_clock::now();
scalar_multiplication::construct_addition_chains(product_state, true);
// scalar_multiplication::scalar_multiplication_internal<num_points>(state, monomials);
end = std::chrono::steady_clock::now();
diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
info("construct addition chains: ", diff.count(), "ms");
std::cout << "scalar mul: " << diff.count() << "ms" << std::endl;

aligned_free(bucket_empty_status);
Expand Down