Skip to content

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
This was referenced Jun 3, 2024
This was referenced Jun 11, 2024
@github-actions github-actions bot mentioned this pull request Jun 19, 2024
This was referenced Mar 10, 2025
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.

2 participants