Skip to main content

SWMapping

Trait SWMapping 

Source
pub trait SWMapping<C: SWCurveConfig> {
    // Required methods
    fn from_sw(sw: SWAffine<C>) -> Self;
    fn into_sw(self) -> SWAffine<C>;
    fn to_sw_slice(slice: &[Self]) -> Cow<'_, [SWAffine<C>]>
       where Self: Sized;
}
Expand description

Trait for types that can be converted from/to Short Weierstrass form.

This trait provides methods to convert between a type and its Short Weierstrass representation, both for individual points and slices of points.

Required Methods§

Source

fn from_sw(sw: SWAffine<C>) -> Self

Convert a Short Weierstrass point to this type.

Source

fn into_sw(self) -> SWAffine<C>

Convert this type to a Short Weierstrass point.

Source

fn to_sw_slice(slice: &[Self]) -> Cow<'_, [SWAffine<C>]>
where Self: Sized,

Convert a slice of this type to a slice of Short Weierstrass points.

Returns a borrowed slice if no conversion is needed, or an owned vector if conversion is required.

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<C: SWCurveConfig> SWMapping<C> for Affine<C>

Source§

fn from_sw(sw: SWAffine<C>) -> Self

Source§

fn into_sw(self) -> SWAffine<C>

Source§

fn to_sw_slice(slice: &[Self]) -> Cow<'_, [SWAffine<C>]>

Source§

impl<C: MapConfig> SWMapping<C> for Affine<C>

Source§

fn from_sw(sw: SWAffine<C>) -> Self

Source§

fn into_sw(self) -> SWAffine<C>

Source§

fn to_sw_slice(slice: &[Self]) -> Cow<'_, [SWAffine<C>]>

Implementors§