[][src]Struct private_currency::crypto::SimpleRangeProof

pub struct SimpleRangeProof { /* fields omitted */ }

Range proof for a single value in the range [0; 1 << 64).

Theory

Bulletproofs provide an efficient scheme for proving that a committed value belongs to an interval. The scheme is non-interactive, succinct (i.e., the size of the data and the amount of computations necessary to verify the proof are small), and zero-knowledge (i.e., the verifier does not learn anything about the committed value besides the range).

Implementation details

We use the bulletproofs crate to implement proofs. The crate allows to efficiently prove several values at once, but this capability is not used as of now. Generators for proofs are initialized for a single party with Self::BITS range capacity.

Examples

let (commitment, opening) = Commitment::new(42_000_000);
// We need an opening to produce the proof
let proof = SimpleRangeProof::prove(&opening).unwrap();
// ...but don’t need one to verify it
assert!(proof.verify(&commitment));

Methods

impl SimpleRangeProof
[src]

Number of variable bits in the committed value: 64. The range to which the value must belong is [0, 1 << BITS).

Creates a proof for the specified value (which is provided together with the blinding factor as an Opening).

Return value

This method may fail along the lines of the underlying implementation. In this case, None is returned.

Attempts to deserialize this proof from a byte slice.

Verifies this proof with respect to the given committed value.

Serializes this proof into bytes.

Trait Implementations

impl Clone for SimpleRangeProof
[src]

Performs copy-assignment from source. Read more

impl Debug for SimpleRangeProof
[src]

impl ExonumJson for SimpleRangeProof
[src]

impl<'a> SegmentField<'a> for SimpleRangeProof
[src]

Auto Trait Implementations

impl Send for SimpleRangeProof

impl Sync for SimpleRangeProof

Blanket Implementations

impl<T> From for T
[src]

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<'a, T> Field for T where
    T: SegmentField<'a>, 
[src]

impl<T> Erased for T

impl<T> Erased for T

impl<T> Same for T

Should always be Self