openvm_ecc_guest::weierstrass

Trait IntrinsicCurve

Source
pub trait IntrinsicCurve {
    type Scalar: Clone;
    type Point: Clone;

    // Required method
    fn msm(coeffs: &[Self::Scalar], bases: &[Self::Point]) -> Self::Point;
}
Expand description

A trait for elliptic curves that bridges the openvm types and external types with CurveArithmetic etc. Implement this for external curves with corresponding openvm point and scalar types.

Required Associated Types§

Required Methods§

Source

fn msm(coeffs: &[Self::Scalar], bases: &[Self::Point]) -> Self::Point

Multi-scalar multiplication. The implementation may be specialized to use properties of the curve (e.g., if the curve order is prime).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntrinsicCurve for Secp256k1

Source§

type Scalar = Secp256k1Scalar

Source§

type Point = Secp256k1Point

Source§

fn msm(coeffs: &[Self::Scalar], bases: &[Self::Point]) -> Self::Point
where for<'a> &'a Self::Point: Add<&'a Self::Point, Output = Self::Point>,

Implementors§