Struct secp256k1_zkp::Generator[][src]

pub struct Generator(_);

Represents a generator on the secp256k1 curve.

A generator is a public key internally but has a slightly different serialization with the first byte being tweaked.

Implementations

impl Generator[src]

pub fn serialize(&self) -> [u8; 33][src]

Serialize the generator to a byte array.

pub fn from_slice(bytes: &[u8]) -> Result<Self, Error>[src]

Parse a generator from a slice of bytes.

pub fn new_blinded<C: Signing>(
    secp: &Secp256k1<C>,
    tag: Tag,
    blinding_factor: Tweak
) -> Self
[src]

Creates a new Generator by blinding a Tag using the given blinding factor. Use Generator::new_unblinded for creating a Generator with zero blinding factor

pub fn new_unblinded<C: Signing>(secp: &Secp256k1<C>, tag: Tag) -> Self[src]

Creates a new unblinded Generator by from Tag Same as using zero Tweak with Generator::new_blinded

Trait Implementations

impl Clone for Generator[src]

impl Copy for Generator[src]

impl Debug for Generator[src]

impl<'de> Deserialize<'de> for Generator[src]

impl Display for Generator[src]

impl Eq for Generator[src]

impl FromStr for Generator[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for Generator[src]

impl LowerHex for Generator[src]

impl PartialEq<Generator> for Generator[src]

impl Serialize for Generator[src]

impl StructuralEq for Generator[src]

impl StructuralPartialEq for Generator[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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.