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

fix: check canonical Fp elements #1434

Merged
merged 6 commits into from
May 26, 2024
Merged

Conversation

Rjected
Copy link
Collaborator

@Rjected Rjected commented May 17, 2024

This adds the negative test vectors that surfaced some issues in the EIP-2537 implementation. The issue was that the blst_fp_from_bendian method did not check that the blst_fp or blst_fp2 is canonical. There does not seem to be any method in blst for checking this, so instead we convert to big-endian again, checking that the input equals the re-encoded field element.

Finding a better way to do this would be highly appreciated.

This is encapsulated into check_canonical_fp and check_canonical_fp2.

After this change, the positive and negative test vectors from the EIP pass.

@Rjected Rjected added bug Something isn't working hf-prague Prague related EIPs labels May 17, 2024
@Rjected Rjected changed the title fix: check canonical field elements fix: check canonical Fp elements May 20, 2024
@rakita rakita merged commit 3a8b5d0 into bluealloy:main May 26, 2024
25 checks passed
This was referenced Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hf-prague Prague related EIPs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants