Skip to main content
This is unreleased documentation for the main (development) branch of crypto-glue.

FromSec1Point

Trait FromSec1Point 

Source
pub trait FromSec1Point<C>: Sized{
    // Required method
    fn from_sec1_point(
        point: &EncodedPoint<<C as Curve>::FieldBytesSize>,
    ) -> CtOption<Self>;

    // Provided methods
    fn from_sec1_bytes(bytes: &[u8]) -> Result<Self, Error> { ... }
    fn from_encoded_point(
        point: &EncodedPoint<<C as Curve>::FieldBytesSize>,
    ) -> CtOption<Self> { ... }
}
Expand description

Decode curve point using the Octet-String-to-Elliptic-Curve-Point conversion described in SEC 1: Elliptic Curve Cryptography (Version 2.0) §2.3.4 (page 11).

Required Methods§

Source

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

Decode curve point from a SEC1 Sec1Point.

Provided Methods§

Source

fn from_sec1_bytes(bytes: &[u8]) -> Result<Self, Error>

Decode curve point from the provided SEC1 encoding (compressed, uncompressed, or identity) using the Octet-String-to-Elliptic-Curve-Point conversion.

§Errors
  • if bytes does not begin with a valid SEC1 tag
  • if bytes is not the appropriate length for its SEC1 tag
  • if bytes does not encode the coordinate(s) of a valid elliptic curve point
Source

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

👎Deprecated since 0.14.0:

use FromSec1Point::from_sec1_point instead

DEPRECATED: legacy name for FromSec1Point::from_sec1_point.

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> FromSec1Point<C> for AffinePoint<C>

Source§

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

Attempts to parse the given Sec1Point as an SEC1-encoded AffinePoint.

§Returns

None value if encoded_point is not on the secp384r1 curve.

Source§

impl<C> FromSec1Point<C> for ProjectivePoint<C>

Implementors§

Source§

impl<C> FromSec1Point<C> for PublicKey<C>

Available on crate feature sec1 only.