pub fn verify<C: Verification>(
        &self,
        secp: &Secp256k1<C>,
        commitment: PedersenCommitment,
        additional_commitment: &[u8],
        additional_generator: Generator,
    ) -> Result<Range<u64>, Error> {
        let mut min_value = 0u64;
        let mut max_value = 0u64;

        let ret = unsafe {
            ffi::secp256k1_rangeproof_verify(
                *secp.ctx(),
                &mut min_value,
                &mut max_value,
                commitment.as_inner(),
                self.inner.as_ptr(),
                self.inner.len(),
                additional_commitment.as_ptr(),
                additional_commitment.len(),
                additional_generator.as_inner(),
            )
        };

        if ret == 0 {
            return Err(Error::InvalidRangeProof);
        }

        Ok(Range {
            start: min_value,
            end: max_value + 1,
        })
    }
/// Verify that the committed value is within a range.
///
/// If the verification is successful, return the actual range of possible values.
Verify that the committed value is within a range.
If the verification is successful, return the actual range of possible values.
Verify that the committed value is within a range . If the verification is successful return the actual range of possible values .
pub fn verify<C: Verification>(
        &self,
        secp: &Secp256k1<C>,
        commitment: PedersenCommitment,
        additional_commitment: &[u8],
        additional_generator: Generator,
    ) -> Result<Range<u64>, Error> {
        let mut min_value = 0u64;
        let mut max_value = 0u64;
        let ret = unsafe {
            ffi::secp256k1_rangeproof_verify(
                *secp.ctx(),
                &mut min_value,
                &mut max_value,
                commitment.as_inner(),
                self.inner.as_ptr(),
                self.inner.len(),
                additional_commitment.as_ptr(),
                additional_commitment.len(),
                additional_generator.as_inner(),
            )
        };
        if ret == 0 {
            return Err(Error::InvalidRangeProof);
        }
        Ok(Range {
            start: min_value,
            end: max_value + 1,
        })
    }
pub fn verify < C : Verification > ( & self , secp : & Secp256k1 < C > , commitment : PedersenCommitment , additional_commitment : & [ u8 ] , additional_generator : Generator , ) -> Result < Range < u64 > , Error > { let mut min_value = 0u64 ; let mut max_value = 0u64 ; let ret = unsafe { ffi :: secp256k1_rangeproof_verify ( * secp . ctx ( ) , & mut min_value , & mut max_value , commitment . as_inner ( ) , self . inner . as_ptr ( ) , self . inner . len ( ) , additional_commitment . as_ptr ( ) , additional_commitment . len ( ) , additional_generator . as_inner ( ) , ) } ; if ret == 0 { return Err ( Error :: InvalidRangeProof ) ; } Ok ( Range { start : min_value , end : max_value + 1 , } ) }
Verify that the committed value is within a range.
Verify that the committed value is within a range .
&self
secp
&Secp256k1<C>
commitment
PedersenCommitment
additional_commitment
&[u8]
additional_generator
Generator
&self
secp
&Secp256k1<C>
commitment
PedersenCommitment
additional_commitment
&[u8]
additional_generator
Generator