Struct secp256k1_zkp::RangeProof [−][src]
pub struct RangeProof { /* fields omitted */ }
Represents a range proof.
TODO: Store rangeproof info
Implementations
impl RangeProof
[src]
impl RangeProof
[src]pub fn serialize(&self) -> Vec<u8>ⓘ
[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]
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>
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]
&self,
secp: &Secp256k1<C>,
commitment: PedersenCommitment,
additional_commitment: &[u8],
additional_generator: Generator
) -> Result<Range<u64>, Error>
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]
&self,
secp: &Secp256k1<C>,
commitment: PedersenCommitment,
sk: SecretKey,
additional_commitment: &[u8],
additional_generator: Generator
) -> Result<(Opening, Range<u64>), Error>
Verify a range proof proof and rewind the proof to recover information sent by its author.
Trait Implementations
impl Clone for RangeProof
[src]
impl Clone for RangeProof
[src]fn clone(&self) -> RangeProof
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for RangeProof
[src]
impl Eq for RangeProof
[src]impl Hash for RangeProof
[src]
impl Hash for RangeProof
[src]impl PartialEq<RangeProof> for RangeProof
[src]
impl PartialEq<RangeProof> for RangeProof
[src]fn eq(&self, other: &RangeProof) -> bool
[src]
fn ne(&self, other: &RangeProof) -> bool
[src]
impl StructuralEq for RangeProof
[src]
impl StructuralEq for RangeProof
[src]impl StructuralPartialEq for RangeProof
[src]
impl StructuralPartialEq for RangeProof
[src]Auto Trait Implementations
impl RefUnwindSafe for RangeProof
impl RefUnwindSafe for RangeProof
impl Send for RangeProof
impl Send for RangeProof
impl Sync for RangeProof
impl Sync for RangeProof
impl Unpin for RangeProof
impl Unpin for RangeProof
impl UnwindSafe for RangeProof
impl UnwindSafe for RangeProof