Skip to content

Added const for EcPoint including non-zero.#8750

Merged
orizi merged 1 commit intomainfrom
orizi/11-24-added_const_for_ecpoint_including_non-zero
Nov 30, 2025
Merged

Added const for EcPoint including non-zero.#8750
orizi merged 1 commit intomainfrom
orizi/11-24-added_const_for_ecpoint_including_non-zero

Conversation

@orizi
Copy link
Collaborator

@orizi orizi commented Nov 24, 2025

Added actual usage of it in ECDSA - blocked by cfg.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

orizi commented Nov 24, 2025

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

@orizi orizi force-pushed the orizi/11-24-added_const_for_ecpoint_including_non-zero branch 2 times, most recently from 107388f to 9dcfe93 Compare November 24, 2025 10:51
@orizi orizi marked this pull request as ready for review November 24, 2025 10:52
Added actual usage of it in ECDSA - blocked by cfg.

SIERRA_UPDATE_PATCH_CHANGE_TAG=Extending an existing libfunc option.
@orizi orizi force-pushed the orizi/11-24-added_const_for_ecpoint_including_non-zero branch from 9dcfe93 to 341a23a Compare November 24, 2025 12:57
@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-sierra/src/extensions/modules/const_type.rs line 242 at r2 (raw file):

        return Err(SpecializationError::UnsupportedGenericArg);
    }
    match AffinePoint::new(Felt252::from(x), Felt252::from(y)) {

Does this check if the point is on the curve?

Code quote:

AffinePoint::new(Felt252::from(x), Felt252::from(y))

@ilyalesokhin-starkware
Copy link
Contributor

corelib/src/ecdsa.cairo line 217 at r2 (raw file):

}

#[cfg(sierra: "future")]

what does this do?

Code quote:

cfg(sierra: "future")

Copy link
Collaborator Author

@orizi orizi 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: 0 of 5 files reviewed, 2 unresolved discussions (waiting on @ilyalesokhin-starkware and @TomerStarkware)


corelib/src/ecdsa.cairo line 217 at r2 (raw file):

Previously, ilyalesokhin-starkware wrote…

what does this do?

just hides the rest of the unused code.

Copy link
Collaborator Author

@orizi orizi 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: 0 of 5 files reviewed, 2 unresolved discussions (waiting on @ilyalesokhin-starkware and @TomerStarkware)


crates/cairo-lang-sierra/src/extensions/modules/const_type.rs line 242 at r2 (raw file):

Previously, ilyalesokhin-starkware wrote…

Does this check if the point is on the curve?

yes - that is the exact error type.

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

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

@ilyalesokhin-starkware reviewed 4 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TomerStarkware)

@orizi orizi added this pull request to the merge queue Nov 30, 2025
Merged via the queue into main with commit b5938c6 Nov 30, 2025
54 checks passed
@orizi orizi deleted the orizi/11-24-added_const_for_ecpoint_including_non-zero branch December 1, 2025 10:52
Copy link
Collaborator

@liorgold2 liorgold2 left a comment

Choose a reason for hiding this comment

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

@liorgold2 reviewed 1 file and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions.


crates/cairo-lang-sierra/src/extensions/modules/const_type.rs line 188 at r2 (raw file):

            return Ok(());
        }
        [GenericArg::Value(_x), GenericArg::Value(y)] if !y.is_zero() => {

Let's discuss this f2f.
(check EcPoint first + return error if y is zero)


crates/cairo-lang-sierra/src/extensions/modules/const_type.rs line 226 at r2 (raw file):

}

/// Given a

Fix doc.

Code quote:

/// Given a

crates/cairo-lang-sierra/src/extensions/modules/const_type.rs line 228 at r2 (raw file):

/// Given a
fn validate_const_ec_data(
    _context: &dyn TypeSpecializationContext,

Remove _context parameter.

Copy link
Collaborator Author

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi made 4 comments.
Reviewable status: all files reviewed, 4 unresolved discussions.


crates/cairo-lang-sierra/src/extensions/modules/const_type.rs line 188 at r2 (raw file):

Previously, liorgold2 wrote…

Let's discuss this f2f.
(check EcPoint first + return error if y is zero)

basically in all these options - i prefer the option that does not require reading the context to fail, before i fail.
otherwise i need to always call the get_type_info.


crates/cairo-lang-sierra/src/extensions/modules/const_type.rs line 226 at r2 (raw file):

Previously, liorgold2 wrote…

Fix doc.

Done.


crates/cairo-lang-sierra/src/extensions/modules/const_type.rs line 228 at r2 (raw file):

Previously, liorgold2 wrote…

Remove _context parameter.

Done.


a discussion (no related file):
https://reviewable.io/reviews/starkware-libs/cairo/9380

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.

4 participants