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§
Sourcefn from_sec1_point(
point: &EncodedPoint<<C as Curve>::FieldBytesSize>,
) -> CtOption<Self>
fn from_sec1_point( point: &EncodedPoint<<C as Curve>::FieldBytesSize>, ) -> CtOption<Self>
Decode curve point from a SEC1 Sec1Point.
Provided Methods§
Sourcefn from_sec1_bytes(bytes: &[u8]) -> Result<Self, Error>
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
bytesdoes not begin with a valid SEC1 tag - if
bytesis not the appropriate length for its SEC1 tag - if
bytesdoes not encode the coordinate(s) of a valid elliptic curve point
Sourcefn from_encoded_point(
point: &EncodedPoint<<C as Curve>::FieldBytesSize>,
) -> CtOption<Self>
👎Deprecated since 0.14.0: use FromSec1Point::from_sec1_point instead
fn from_encoded_point( point: &EncodedPoint<<C as Curve>::FieldBytesSize>, ) -> CtOption<Self>
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>where
C: PrimeCurveParams,
impl<C> FromSec1Point<C> for AffinePoint<C>where
C: PrimeCurveParams,
Source§fn from_sec1_point(
encoded_point: &EncodedPoint<<C as Curve>::FieldBytesSize>,
) -> CtOption<AffinePoint<C>>
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>where
C: PrimeCurveParams,
impl<C> FromSec1Point<C> for ProjectivePoint<C>where
C: PrimeCurveParams,
fn from_sec1_point( p: &EncodedPoint<<C as Curve>::FieldBytesSize>, ) -> CtOption<ProjectivePoint<C>>
Implementors§
impl<C> FromSec1Point<C> for PublicKey<C>where
C: CurveArithmetic,
<C as CurveArithmetic>::AffinePoint: FromSec1Point<C> + ToSec1Point<C>,
<C as Curve>::FieldBytesSize: ModulusSize,
Available on crate feature
sec1 only.