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 ff.metal and refactor rust test #29

Merged
merged 2 commits into from
Jan 3, 2025
Merged

Fix ff.metal and refactor rust test #29

merged 2 commits into from
Jan 3, 2025

Conversation

moven0831
Copy link
Collaborator

@moven0831 moven0831 commented Jan 3, 2025

Related issue

Improvements to arithmetic operations:

Updates to tests:

  • mopro-msm/src/msm/metal_msm/tests/field/ff_add.rs: Updated the test_ff_add function to use rand for generating random values and added checks to ensure values are non-negative and less than the modulus. Also, included validation of the result using Arkworks. [1] [2]
  • mopro-msm/src/msm/metal_msm/tests/field/ff_sub.rs: Updated the test_ff_sub function to use rand for generating random values and added checks to ensure values are non-negative and less than the modulus. Also, included validation of the result using Arkworks.

…andom BigInt values

- Changed the field tests to utilize random number generation for inputs, enhancing robustness against edge cases.
- Updated the limb size and number of limbs from 20 to 16 for consistency.
- Replaced the hardcoded values for the scalar field modulus with the BaseField's modulus.
- Added assertions to ensure non-negativity and proper range for generated values.
- Improved correctness checks by directly comparing results with expected values derived from Arkworks operations.
@moven0831 moven0831 self-assigned this Jan 3, 2025
@moven0831 moven0831 linked an issue Jan 3, 2025 that may be closed by this pull request
@moven0831 moven0831 merged commit a6df775 into main Jan 3, 2025
1 check passed
@moven0831 moven0831 deleted the test/metal/field branch January 3, 2025 15:22
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.

Improve Carry Handling of BigInt and Field Arithmetic
1 participant