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§
Sourcefn from_sw(sw: SWAffine<C>) -> Option<Self>
fn from_sw(sw: SWAffine<C>) -> Option<Self>
Convert a Short Weierstrass point to this type.
Returns None for identity or degenerate points.
Sourcefn into_sw(self) -> Option<SWAffine<C>>
fn into_sw(self) -> Option<SWAffine<C>>
Convert this type to a Short Weierstrass point.
Returns None for identity or degenerate points.
Sourcefn to_sw_slice(slice: &[Self]) -> Option<Cow<'_, [SWAffine<C>]>>
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".