Skip to content

Commit

Permalink
Merge branch 'main' into pedersen-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
pefontana committed Nov 1, 2023
2 parents d85de4f + 14b58ff commit 236dfa1
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions crates/starknet-types-core/src/curve/affine_point.rs
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ use lambdaworks_math::elliptic_curve::short_weierstrass::curves::stark_curve::St
use lambdaworks_math::elliptic_curve::short_weierstrass::point::ShortWeierstrassProjectivePoint;
use lambdaworks_math::elliptic_curve::traits::FromAffine;

/// Represents a point on the Stark elliptic curve.
/// Doc: https://docs.starkware.co/starkex/crypto/stark-curve.html
#[repr(transparent)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AffinePoint(pub(crate) ShortWeierstrassProjectivePoint<StarkCurve>);

10 changes: 7 additions & 3 deletions crates/starknet-types-core/src/curve/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
pub mod affine_point;
pub mod curve_errors;
pub mod projective_point;
mod affine_point;
mod curve_errors;
mod projective_point;

pub use self::affine_point::*;
pub use self::curve_errors::*;
pub use self::projective_point::*;
2 changes: 2 additions & 0 deletions crates/starknet-types-core/src/curve/projective_point.rs
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ use lambdaworks_math::elliptic_curve::short_weierstrass::point::ShortWeierstrass
use lambdaworks_math::elliptic_curve::traits::EllipticCurveError::InvalidPoint;
use lambdaworks_math::unsigned_integer::traits::IsUnsignedInteger;

/// Represents a projective point on the Stark elliptic curve.
#[repr(transparent)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ProjectivePoint(pub(crate) ShortWeierstrassProjectivePoint<StarkCurve>);

1 change: 1 addition & 0 deletions crates/starknet-types-core/src/felt.rs
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ use lambdaworks_math::{
#[cfg(feature = "arbitrary")]
use arbitrary::{self, Arbitrary, Unstructured};

#[repr(transparent)]
/// Definition of the Field Element type.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Felt(pub(crate) FieldElement<Stark252PrimeField>);

0 comments on commit 236dfa1

Please sign in to comment.