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

feat: Implement hints on field_arithmetic lib (Part 2) #1004

Merged
merged 88 commits into from
Apr 22, 2023

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Apr 17, 2023

Depends on #985

Description

Description of the pull request changes and motivation.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@fmoletta fmoletta linked an issue Apr 21, 2023 that may be closed by this pull request
@fmoletta fmoletta marked this pull request as ready for review April 21, 2023 14:34
Copy link
Member

@Oppen Oppen left a comment

Choose a reason for hiding this comment

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

LGTM. There are a few comments but they are non-blocking. Please address them if something else comes up, otherwise feel free to ignore them.

fmoletta and others added 2 commits April 21, 2023 12:02
Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
@fmoletta fmoletta added the whitelisted-hint Implementation of hint on whitelist directory label Apr 21, 2023
Copy link
Contributor

@MegaRedHand MegaRedHand left a comment

Choose a reason for hiding this comment

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

LGTM

@MegaRedHand MegaRedHand added this pull request to the merge queue Apr 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 21, 2023
@Oppen Oppen enabled auto-merge April 22, 2023 04:38
@Oppen Oppen added this pull request to the merge queue Apr 22, 2023
Merged via the queue into main with commit 6e32e71 Apr 22, 2023
14 of 15 checks passed
@Oppen Oppen deleted the field-arithmetic-hints-2 branch April 22, 2023 05:34
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
)

* Add hint code for UINT348_UNSIGNED_DIV_REM

* Add file for uint348 files

* Add pack & split for uint348

* Move comment

* Implement uint348_unsigned_div_rem hint

* Add integration test

* Add integration test

* Add unit tests

* Add hint on split_128

* Test split_128 hint

* Add add_no_uint384_hint

* Fix hint + add tests

* Add hint code for UINT348_UNSIGNED_DIV_REM_EXPAND

* Msc fixes

* Add integration test

* Reduce Uint384_expand representation to the 3 used limbs

* Add unit test

* Add hint code for UINT384_SQRT

* Add implementation for hint on sqrt

* Integration test

* Add unit tests

* Fix missing directive

* Run cairo-format

* Add changelog entry

* Spelling

* Add hint code + Uint768 type

* Implement hint unsigned_div_rem_uint768_by_uint384

* Update src/hint_processor/builtin_hint_processor/uint384.rs

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>

* Update src/hint_processor/builtin_hint_processor/uint384.rs

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>

* Update src/hint_processor/builtin_hint_processor/uint384.rs

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>

* Make hint code more readable

* Add integration test

* Add test

* Add unit test

* Add changelog entry + fmt

* Fix plural

* cargo fmt

* Add first draft of get_square_root

* Fix test

* Fix syntax

* Fix test

* Add necessary lib fns

* fix fmt

* Fix test value

* Add test program

* Add hint to execute_hint

* Fix wrong hint being tested

* Implement sqrt

* Add test fix file

* Fix _sqrt_mod_tonelli_shanks implementation

* Expand integration test

* Add unit test

* Add proptests

* Fix merge conflict

* Fix merge conflict

* Add changelog entry

* Use no-std compatible rng when std is not enabled

* Clippy

* Use seeded rng instead of from_entropy

* Catch potential zero divison errors

* Implement hint on div

* Expand field_arithmetic integration test

* Expand field_arithmetic integration test

* Add test + fix hint

* Fix merge conflict

* Use mul_inv instead of div_mod

* Add Changelog entry

* Add unit tests

* remove unused feature

* Fix test value

* Update cairo_programs/field_arithmetic.cairo

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>

* Increase number of memory holes for field_arithmetic test

---------

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whitelisted-hint Implementation of hint on whitelist directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Hints] 384_bit_prime_field.json
4 participants