Struct secp256k1_zkp::RangeProof[][src]

pub struct RangeProof { /* fields omitted */ }

Represents a range proof.

TODO: Store rangeproof info

Implementations

impl RangeProof[src]

pub fn serialize(&self) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Serialize to bytes.

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

Parse from byte slice.

TODO: Rename to parse (and other similar functions)

pub fn len(&self) -> usize[src]

Get length.

pub fn is_empty(&self) -> bool[src]

Check if it’s empty.

pub fn new<C: Signing>(
    secp: &Secp256k1<C>,
    min_value: u64,
    commitment: PedersenCommitment,
    value: u64,
    commitment_blinding: Tweak,
    message: &[u8],
    additional_commitment: &[u8],
    sk: SecretKey,
    exp: i32,
    min_bits: u8,
    additional_generator: Generator
) -> Result<RangeProof, Error>
[src]

Prove that commitment hides a value within a range, with the lower bound set to min_value.

pub fn verify<C: Verification>(
    &self,
    secp: &Secp256k1<C>,
    commitment: PedersenCommitment,
    additional_commitment: &[u8],
    additional_generator: Generator
) -> Result<Range<u64>, Error>
[src]

Verify that the committed value is within a range.

If the verification is successful, return the actual range of possible values.

pub fn rewind<C: Verification>(
    &self,
    secp: &Secp256k1<C>,
    commitment: PedersenCommitment,
    sk: SecretKey,
    additional_commitment: &[u8],
    additional_generator: Generator
) -> Result<(Opening, Range<u64>), Error>
[src]

Verify a range proof proof and rewind the proof to recover information sent by its author.

Trait Implementations

impl Clone for RangeProof[src]

impl Debug for RangeProof[src]

impl Eq for RangeProof[src]

impl Hash for RangeProof[src]

impl PartialEq<RangeProof> for RangeProof[src]

impl StructuralEq for RangeProof[src]

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