[−][src]Struct hash2curve::bls381g1::G1
feature="bls"
only.Represents a point on G1
Methods
impl G1
[src]
pub const COMPRESSED_BYTES: usize
[src]
feature="bls"
only.The bytes in G1 compressed form
pub const UNCOMPRESSED_BYTES: usize
[src]
feature="bls"
only.The bytes in G1 uncompressed form
pub fn to_bytes(&self) -> [u8; 48]
[src]
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]
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]
feature="bls"
only.Serialize the point to compressed lower hex string Only the x-coordinate
pub fn encode_to_hex_uncompressed(&self) -> String
[src]
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]
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]
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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
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]
fn eq(&self, other: &GenericArray<u8, U48>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Vec<u8>> for G1
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,