prove_range

Function prove_range 

Source
pub fn prove_range(
    params: &BulletproofParams,
    value: u64,
) -> BulletproofResult<(BulletproofCommitment, BulletproofRangeProof)>
Expand description

Prove that a value is within the range [0, 2^bit_length).

Returns a commitment to the value and a proof of range.

§Arguments

  • params - Bulletproof parameters
  • value - The value to prove is in range

§Example

use chie_crypto::bulletproof::{BulletproofParams, prove_range};

let params = BulletproofParams::new(32);
let value = 1000u64;
let (commitment, proof) = prove_range(&params, value).unwrap();