Skip to main content

FromEncodedPoint

Trait FromEncodedPoint 

pub trait FromEncodedPoint<C>: Sized{
    // Required method
    fn from_encoded_point(
        point: &EncodedPoint<<C as Curve>::FieldBytesSize>,
    ) -> CtOption<Self>;
}
Expand description

Trait for deserializing a value from a SEC1 encoded curve point.

This is intended for use with the AffinePoint type for a given elliptic curve.

Required Methods§

fn from_encoded_point( point: &EncodedPoint<<C as Curve>::FieldBytesSize>, ) -> CtOption<Self>

Deserialize the type this trait is impl’d on from an EncodedPoint.

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§

§

impl<C> FromEncodedPoint<C> for AffinePoint<C>

§

fn from_encoded_point( encoded_point: &EncodedPoint<<C as Curve>::FieldBytesSize>, ) -> CtOption<AffinePoint<C>>

Attempts to parse the given EncodedPoint as an SEC1-encoded [AffinePoint].

§Returns

None value if encoded_point is not on the secp384r1 curve.

§

impl<C> FromEncodedPoint<C> for ProjectivePoint<C>

§

fn from_encoded_point( p: &EncodedPoint<<C as Curve>::FieldBytesSize>, ) -> CtOption<ProjectivePoint<C>>

Implementors§

§

impl FromEncodedPoint<Secp256k1> for airbender_crypto::k256::AffinePoint

§

impl FromEncodedPoint<Secp256k1> for airbender_crypto::k256::ProjectivePoint

§

impl<C> FromEncodedPoint<C> for PublicKey<C>

Available on crate feature sec1 only.