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

Add more tests for assert_equal_point #726

Merged
merged 2 commits into from
Jan 25, 2023
Merged

Add more tests for assert_equal_point #726

merged 2 commits into from
Jan 25, 2023

Conversation

moCello
Copy link
Member

@moCello moCello commented Jan 24, 2023

Resolves #725

Finish up for issue #721:
- Move test to the ecc tests
- Add entry in changelog
@codecov
Copy link

codecov bot commented Jan 24, 2023

Codecov Report

Merging #726 (8690aa9) into master (5c4dc47) will decrease coverage by 0.04%.
The diff coverage is 80.85%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #726      +/-   ##
==========================================
- Coverage   85.10%   85.07%   -0.04%     
==========================================
  Files          47       47              
  Lines        3860     3879      +19     
==========================================
+ Hits         3285     3300      +15     
- Misses        575      579       +4     
Impacted Files Coverage Δ
src/composer.rs 91.97% <ø> (ø)
tests/composer.rs 95.45% <ø> (+5.17%) ⬆️
tests/ecc.rs 81.76% <80.85%> (-0.39%) ⬇️
tests/debugger.rs 66.66% <0.00%> (ø)
src/permutation.rs 92.64% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c4dc47...8690aa9. Read the comment docs.

@moCello moCello self-assigned this Jan 24, 2023
@@ -304,3 +304,202 @@ fn mul_point_works() {
.expect_err("circuit is not satisfied");
}
}

#[test]
fn assert_equal_point_works() {
Copy link
Member

Choose a reason for hiding this comment

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

I suggest having only one circuit that executes the assertation, and the function is called with two points as arguments. Then, compute each variant in each test and call that circuit.

Copy link
Member Author

@moCello moCello Jan 24, 2023

Choose a reason for hiding this comment

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

Yeah, I'm actually just doing these changes! Was a bit too quick setting the PR as done, sorry!

tests/ecc.rs Outdated
let w_p2 = composer.append_point(self.point);
composer.assert_equal_point(w_p1, w_p2);

// test: 42 * generator = 42 * generator
Copy link
Member

Choose a reason for hiding this comment

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

personally, I'd prefer to hardcode one of the points and compute the other one. But that's a nit.

@moCello moCello marked this pull request as draft January 24, 2023 12:47
@moCello moCello marked this pull request as ready for review January 24, 2023 14:18
@moCello moCello merged commit c162d2b into master Jan 25, 2023
@moCello moCello deleted the mocello/ecc_tests branch January 25, 2023 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more tests for point equality assertion
2 participants