[][src]Crate secp256k1_zkp

Secp256k1-zkp

Rust bindings for libsecp256k1-zkp, a fork of Pieter Wuille's secp256k1 library.

This library re-exports everything from secp256k1 and adds bindings for the following modules:

  • generators
  • range proofs
  • pedersen commitments

As such, it can be used as a drop-in replacement for secp256k1. All types are interoperable (as long as you are dependening on the correct version) which means SecretKeys and the Context are interoperable.

Re-exports

pub extern crate secp256k1_zkp_sys;
pub extern crate rand;
pub extern crate serde;
pub use secp256k1_zkp_sys as ffi;

Modules

constants

Constants

ecdh

ECDH

key

Public and secret keys

rand

Utilities for random number generation

recovery

Recovery module

schnorrsig

schnorrsig

secp256k1_sys

secp256k1-sys FFI bindings

serde

Serde

Structs

AllPreallocated

Represents the set of all capabilities with a user preallocated memory.

CommitmentSecrets

Represents all secret data involved in making a PedersenCommitment where one of the generators is blinded.

Generator

Represents a generator on the secp256k1 curve.

Message

A (hashed) message input to an ECDSA signature

Opening

The result of rewinding a range proof.

PedersenCommitment

Represents a commitment to a single u64 value.

PublicKey

A Secp256k1 public key, used for verification of signatures

RangeProof

Represents a range proof.

Secp256k1

The secp256k1 engine, used to execute all signature operations

SecretKey

Secret 256-bit key used as x in an ECDSA signature

SerializedSignature

A DER serialized Signature

SignOnlyPreallocated

Represents the set of capabilities needed for signing with a user preallocated memory.

Signature

An ECDSA signature

SurjectionProof

Represents a surjection proof.

Tag

Represents a tag.

VerifyOnlyPreallocated

Represents the set of capabilities needed for verification with a user preallocated memory.

Enums

All

Represents the set of all capabilities.

Error

An ECDSA error

Error

An ECDSA error

SignOnly

Represents the set of capabilities needed for signing.

UpstreamError

An ECDSA error

VerifyOnly

Represents the set of capabilities needed for verification.

Traits

Context

A trait for all kinds of Context's that Lets you define the exact flags and a function to deallocate memory. It shouldn't be possible to implement this for types outside this crate.

Signing

Marker trait for indicating that an instance of Secp256k1 can be used for signing.

ThirtyTwoByteHash

Trait describing something that promises to be a 32-byte random number; in particular, it has negligible probability of being zero or overflowing the group order. Such objects may be converted to Messages without any error paths.

Verification

Marker trait for indicating that an instance of Secp256k1 can be used for verification.

Functions

compute_adaptive_blinding_factor

Compute a blinding factor such that the sum of all blinding factors in both sets is equal.

verify_commitments_sum_to_equal

Verifies that the sum of the committed values within the commitments of both sets is equal.