Skip to main content

SWMapping

Trait SWMapping 

Source
pub trait SWMapping<C: SWCurveConfig>: Sized {
    // Required methods
    fn from_sw(sw: SWAffine<C>) -> Option<Self>;
    fn into_sw(self) -> Option<SWAffine<C>>;
    fn to_sw_slice(slice: &[Self]) -> Option<Cow<'_, [SWAffine<C>]>>;
}
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>) -> Option<Self>

Convert a Short Weierstrass point to this type.

Returns None for identity or degenerate points.

Source

fn into_sw(self) -> Option<SWAffine<C>>

Convert this type to a Short Weierstrass point.

Returns None for identity or degenerate points.

Source

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

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

Returns None if any element fails conversion. 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".

Implementations on Foreign Types§

Source§

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

Source§

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

Source§

fn into_sw(self) -> Option<SWAffine<C>>

Source§

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

Source§

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

Source§

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

Source§

fn into_sw(self) -> Option<SWAffine<C>>

Source§

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

Implementors§