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

QM31 #4

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Conversation

spapinistarkware
Copy link
Contributor

@spapinistarkware spapinistarkware commented Jun 16, 2024

This change is Reviewable

Copy link
Contributor Author

spapinistarkware commented Jun 16, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @spapinistarkware and the rest of your teammates on Graphite Graphite

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @spapinistarkware)


stwo_cairo_verifier/src/fields/qm31.cairo line 16 at r1 (raw file):

#[generate_trait]
impl QM31Impl of QM31Trait {
    fn inverse(self: QM31) -> QM31 {

should fail on zero. Is it ok to ignore that?

Code quote:

fn inverse(self: QM31) -> QM31 {

stwo_cairo_verifier/src/fields/qm31.cairo line 70 at r1 (raw file):

pub impl CM31IntoQM31 of core::traits::Into<CM31, QM31> {
    fn into(self: CM31) -> QM31 {
        QM31 { a: self, b: core::num::traits::zero::Zero::zero() }

Suggestion:

b: Zero::zero() 

Copy link
Contributor Author

@spapinistarkware spapinistarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7)


stwo_cairo_verifier/src/fields/qm31.cairo line 16 at r1 (raw file):

Previously, shaharsamocha7 wrote…

should fail on zero. Is it ok to ignore that?

Done.

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @spapinistarkware)


stwo_cairo_verifier/src/fields/cm31.cairo line 12 at r2 (raw file):

pub impl CM31Impl of CM31Trait {
    fn inverse(self: CM31) -> CM31 {
        assert_ne!(self, core::num::traits::Zero::zero());

Consider

Suggestion:

       assert_ne!(self, Zero::zero());

@spapinistarkware spapinistarkware merged commit a86e564 into spapini/05-09-merkleverifier Jun 20, 2024
1 check passed
@spapinistarkware spapinistarkware mentioned this pull request Jun 20, 2024
Merged
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.

2 participants