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

ToSec1Point

Trait ToSec1Point 

Source
pub trait ToSec1Point<C>{
    // Required method
    fn to_sec1_point(
        &self,
        compress: bool,
    ) -> EncodedPoint<<C as Curve>::FieldBytesSize>;

    // Provided methods
    fn to_sec1_bytes(&self) -> Box<[u8]>
       where C: PointCompression { ... }
    fn to_compressed_point(
        &self,
    ) -> Array<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::CompressedPointSize> { ... }
    fn to_uncompressed_point(
        &self,
    ) -> Array<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::UncompressedPointSize> { ... }
    fn to_encoded_point(
        &self,
        compress: bool,
    ) -> EncodedPoint<<C as Curve>::FieldBytesSize> { ... }
}
Expand description

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

Required Methods§

Source

fn to_sec1_point( &self, compress: bool, ) -> EncodedPoint<<C as Curve>::FieldBytesSize>

Serialize curve point as a SEC1 Sec1Point, optionally applying point compression according to the compress flag.

Provided Methods§

Source

fn to_sec1_bytes(&self) -> Box<[u8]>

Encode curve point using the Elliptic-Curve-Point-to-Octet-String conversion and the point compression default for this curve as specified by the PointCompression trait.

Source

fn to_compressed_point( &self, ) -> Array<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::CompressedPointSize>

Serialize curve point as a CompressedPoint.

Source

fn to_uncompressed_point( &self, ) -> Array<u8, <<C as Curve>::FieldBytesSize as ModulusSize>::UncompressedPointSize>

Serialize curve point as a CompressedPoint.

Source

fn to_encoded_point( &self, compress: bool, ) -> EncodedPoint<<C as Curve>::FieldBytesSize>

👎Deprecated since 0.14.0:

use ToSec1Point::to_sec1_point instead

DEPRECATED: legacy name for ToSec1Point::to_sec1_point.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<C> ToSec1Point<C> for AffinePoint<C>

Source§

fn to_sec1_point( &self, compress: bool, ) -> EncodedPoint<<C as Curve>::FieldBytesSize>

Source§

impl<C> ToSec1Point<C> for ProjectivePoint<C>

Source§

fn to_sec1_point( &self, compress: bool, ) -> EncodedPoint<<C as Curve>::FieldBytesSize>

Implementors§

Source§

impl<C> ToSec1Point<C> for PublicKey<C>

Available on crate feature sec1 only.