Skip to main content

FromSec1Point

Trait FromSec1Point 

Source
pub trait FromSec1Point<C>
where Self: Sized, C: Curve, FieldBytesSize<C>: ModulusSize,
{ // Required method fn from_sec1_point(point: &Sec1Point<C>) -> CtOption<Self>; // Provided methods fn from_sec1_bytes(bytes: &[u8]) -> Result<Self> { ... } fn from_encoded_point(point: &Sec1Point<C>) -> 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: &Sec1Point<C>) -> CtOption<Self>

Decode curve point from a SEC1 Sec1Point.

Provided Methods§

Source

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

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: &Sec1Point<C>) -> 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", so this trait is not object safe.

Implementors§

Source§

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

Available on crate feature sec1 only.