Struct secp256k1_zkp::PedersenCommitment[][src]

pub struct PedersenCommitment(_);

Represents a commitment to a single u64 value.

Implementations

impl PedersenCommitment[src]

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

Serialize a pedersen commitment.

The format of this serialization is stable and platform-independent.

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

Parse a pedersen commitment from a byte slice.

pub fn new<C: Signing>(
    secp: &Secp256k1<C>,
    value: u64,
    blinding_factor: Tweak,
    generator: Generator
) -> Self
[src]

Create a new PedersenCommitment that commits to the given value with a certain blinding factor and generator. Use the PedersenCommitment::new_unblinded for creating a commitment using zero blinding factor.

pub fn new_unblinded<C: Signing>(
    secp: &Secp256k1<C>,
    value: u64,
    generator: Generator
) -> Self
[src]

Create a new PedersenCommitment that commits to the given value with a zero blinding factor and the Generator.

Trait Implementations

impl Clone for PedersenCommitment[src]

impl Copy for PedersenCommitment[src]

impl Debug for PedersenCommitment[src]

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

impl Display for PedersenCommitment[src]

impl Eq for PedersenCommitment[src]

impl FromStr for PedersenCommitment[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for PedersenCommitment[src]

impl LowerHex for PedersenCommitment[src]

impl PartialEq<PedersenCommitment> for PedersenCommitment[src]

impl Serialize for PedersenCommitment[src]

impl StructuralEq for PedersenCommitment[src]

impl StructuralPartialEq for PedersenCommitment[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.