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

M31 and CM31 Fields #1

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Conversation

spapinistarkware
Copy link
Contributor

@spapinistarkware spapinistarkware commented Apr 24, 2024

This change is Reviewable

@spapinistarkware
Copy link
Contributor Author

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

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

@spapinistarkware spapinistarkware force-pushed the spapini/04-24-m31_and_cm31_fields branch 6 times, most recently from 87a5c99 to 1be1f57 Compare April 24, 2024 14:05
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.

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


stwo_cairo_verifier/Scarb.toml line 2 at r1 (raw file):

[package]
name = "stwo_cairo_verifier"

not stwo_cairo?

Code quote:

stwo_cairo_verifier

stwo_cairo_verifier/src/fields/cm31.cairo line 52 at r1 (raw file):

}
pub impl CM31Neg of Neg<CM31> {
    fn neg(a: CM31) -> CM31 {

a.a is odd

Suggestion:

fn neg(x: CM31) -> CM31 {

stwo_cairo_verifier/src/fields/cm31.cairo line 68 at r1 (raw file):

    #[test]
    fn test_m31() {

rename

Suggestion:

    fn test_cm31() { 

stwo_cairo_verifier/src/fields/m31.cairo line 38 at r1 (raw file):

            Result::Ok(res) => M31 { inner: res },
            Result::Err(res) => M31 { inner: core::integer::u32_wrapping_add(res, P) }
        }

Can you instead just add neg(rhs)

Code quote:

        match core::integer::u32_overflowing_sub(lhs.inner, rhs.inner) {
            Result::Ok(res) => M31 { inner: res },
            Result::Err(res) => M31 { inner: core::integer::u32_wrapping_add(res, P) }
        }

@spapinistarkware spapinistarkware force-pushed the spapini/04-24-m31_and_cm31_fields branch from 1be1f57 to 7495849 Compare April 25, 2024 12:48
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: 5 of 8 files reviewed, 4 unresolved discussions (waiting on @shaharsamocha7)


stwo_cairo_verifier/Scarb.toml line 2 at r1 (raw file):

Previously, shaharsamocha7 wrote…

not stwo_cairo?

I put all fo this in a subdirectory under root, called stwo_cairo_verifier. I imagine there will be more folders in this repo, for other things, such as the AIRs.


stwo_cairo_verifier/src/fields/cm31.cairo line 52 at r1 (raw file):

Previously, shaharsamocha7 wrote…

a.a is odd

Done.


stwo_cairo_verifier/src/fields/cm31.cairo line 68 at r1 (raw file):

Previously, shaharsamocha7 wrote…

rename

Done.


stwo_cairo_verifier/src/fields/m31.cairo line 38 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Can you instead just add neg(rhs)

Done.

@spapinistarkware spapinistarkware force-pushed the spapini/04-24-m31_and_cm31_fields branch from 7495849 to d91d4b7 Compare April 25, 2024 12:57
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: 5 of 8 files reviewed, 4 unresolved discussions (waiting on @shaharsamocha7)


stwo_cairo_verifier/src/fields/cm31.cairo line 52 at r1 (raw file):

Previously, spapinistarkware (Shahar Papini) wrote…

Done.

Can't

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.

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


.github/workflows/cairo-ci.yaml line 1 at r2 (raw file):

name: Cairo workflow

I'm not sure how to check this file :(

Code quote:

name: Cairo workflow

@spapinistarkware
Copy link
Contributor Author

spapinistarkware commented Apr 25, 2024

Merge activity

@spapinistarkware spapinistarkware merged commit f1b8d89 into main Apr 25, 2024
1 check passed
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