[][src]Struct hash2curve::bls381g1::G1

pub struct G1(pub ECP);
This is supported on feature="bls" only.

Represents a point on G1

Methods

impl G1[src]

pub const COMPRESSED_BYTES: usize[src]

This is supported on feature="bls" only.

The bytes in G1 compressed form

pub const UNCOMPRESSED_BYTES: usize[src]

This is supported on feature="bls" only.

The bytes in G1 uncompressed form

pub fn to_bytes(&self) -> [u8; 48][src]

This is supported on feature="bls" only.

Serialize the point to compressed bytes in big endian form Only the x-coordinate

NOTE: Must use GenericArray due to rust error error[E0277]: arrays only have std trait implementations for lengths 0..=32 The caller can use section 4.3 in https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html to reconstruct Y if needed

pub fn to_bytes_uncompressed(&self) -> [u8; 96][src]

This is supported on feature="bls" only.

Serialize the point to uncompressed bytes in big endian form The x-coordinate followed by the y-coordinate NOTE: Must use GenericArray due to rust error error[E0277]: arrays only have std trait implementations for lengths 0..=32

pub fn encode_to_hex(&self) -> String[src]

This is supported on feature="bls" only.

Serialize the point to compressed lower hex string Only the x-coordinate

pub fn encode_to_hex_uncompressed(&self) -> String[src]

This is supported on feature="bls" only.

Serialize the point to uncompressed lower hex string The x-coordinate followed by the y-coordinate

pub fn decode_from_hex_points(x: &str, y: &str) -> Result<Self, String>[src]

This is supported on feature="bls" only.

Convenience method when x and y are supplied separately

pub fn from_byte_points<B: AsRef<[u8]>>(x: B, y: B) -> Result<G1, String>[src]

This is supported on feature="bls" only.

Convenience method when x and y are supplied separately

Trait Implementations

impl Clone for G1[src]

impl Copy for G1[src]

impl Debug for G1[src]

impl Display for G1[src]

impl<'_> From<&'_ [u8; 48]> for G1[src]

impl<'_> From<&'_ [u8; 96]> for G1[src]

impl From<[u8; 48]> for G1[src]

impl From<[u8; 96]> for G1[src]

impl From<ECP> for G1[src]

impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, B0>>> for G1[src]

Deserialize the point from x and y coordinates in big endian form

impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>> for G1[src]

Deserialize the point from a compressed x-coordinate in big endian form

impl FromStr for G1[src]

Deserialize from a hex string. If the hex string is COMPRESSED_HEX_LENGTH It will assume compressed form––x-coordinate only.

If the hex string is UNCOMPRESSED_HEX_LENGTH, it assumes uncompressed form–– x and y coordinates

type Err = String

The associated error which can be returned from parsing.

impl PartialEq<[u8; 48]> for G1[src]

impl PartialEq<[u8; 96]> for G1[src]

impl PartialEq<[u8]> for G1[src]

impl PartialEq<ECP> for G1[src]

impl PartialEq<G1> for G1[src]

impl PartialEq<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>> for G1[src]

impl PartialEq<Vec<u8>> for G1[src]

Auto Trait Implementations

impl RefUnwindSafe for G1

impl Send for G1

impl Sync for G1

impl Unpin for G1

impl UnwindSafe for G1

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.