 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file. 1 #ifndef _SECP256K1_BULLETPROOF_
2 # define _SECP256K1_BULLETPROOF_
22 #define SECP256K1_BULLETPROOF_CIRCUIT_VERSION 1
25 #define SECP256K1_BULLETPROOF_MAX_DEPTH 31
28 #define SECP256K1_BULLETPROOF_MAX_CIRCUIT (1024*1024*25)
31 #define SECP256K1_BULLETPROOF_MAX_PROOF (160 + 36*32 + 7)
76 const unsigned char* proof,
78 const uint64_t* min_value,
83 const unsigned char* extra_commit,
84 size_t extra_commit_len
108 const
unsigned char* const* proof,
111 const uint64_t* const* min_value,
116 const
unsigned char* const* extra_commit,
117 size_t *extra_commit_len
140 unsigned char* blind,
141 const
unsigned char* proof,
146 const
unsigned char* nonce,
147 const
unsigned char* extra_commit,
148 size_t extra_commit_len
173 unsigned char* proof,
175 const uint64_t *value,
176 const uint64_t *min_value,
177 const
unsigned char* const* blind,
181 const
unsigned char* nonce,
182 const
unsigned char* extra_commit,
183 size_t extra_commit_len
196 const
char *description
254 const
unsigned char* proof,
259 const
unsigned char* extra_commit,
260 size_t extra_commit_len
284 const
unsigned char* const* proof,
290 const
unsigned char** extra_commit,
291 size_t *extra_commit_len
316 unsigned char* proof,
319 const
unsigned char** blind,
321 const
unsigned char* nonce,
323 const
unsigned char* extra_commit,
324 size_t extra_commit_len
SECP256K1_WARN_UNUSED_RESULT SECP256K1_API int secp256k1_bulletproof_rangeproof_rewind(const secp256k1_context2 *ctx, const secp256k1_bulletproof_generators *gens, uint64_t *value, unsigned char *blind, const unsigned char *proof, size_t plen, uint64_t min_value, const secp256k1_pedersen_commitment *commit, const secp256k1_generator *value_gen, const unsigned char *nonce, const unsigned char *extra_commit, size_t extra_commit_len) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(8) SECP256K1_ARG_NONNULL(9)
Extracts the value and blinding factor from a single-commit rangeproof given a secret nonce Returns: ...
SECP256K1_API secp256k1_bulletproof_generators * secp256k1_bulletproof_generators_create(const secp256k1_context2 *ctx, const secp256k1_generator *blinding_gen, size_t n) SECP256K1_ARG_NONNULL(1)
Allocates and initializes a list of NUMS generators, along with precomputation data Returns a list of...
Opaque data structure that stores a base point.
SECP256K1_WARN_UNUSED_RESULT SECP256K1_API int secp256k1_bulletproof_rangeproof_verify_multi(const secp256k1_context2 *ctx, secp256k1_scratch_space2 *scratch, const secp256k1_bulletproof_generators *gens, const unsigned char *const *proof, size_t n_proofs, size_t plen, const uint64_t *const *min_value, const secp256k1_pedersen_commitment *const *commit, size_t n_commits, size_t nbits, const secp256k1_generator *value_gen, const unsigned char *const *extra_commit, size_t *extra_commit_len) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(8)
Batch-verifies multiple bulletproof (aggregate) rangeproofs of the same size using same generator Ret...
SECP256K1_WARN_UNUSED_RESULT SECP256K1_API int secp256k1_bulletproof_rangeproof_prove(const secp256k1_context2 *ctx, secp256k1_scratch_space2 *scratch, const secp256k1_bulletproof_generators *gens, unsigned char *proof, size_t *plen, const uint64_t *value, const uint64_t *min_value, const unsigned char *const *blind, size_t n_commits, const secp256k1_generator *value_gen, size_t nbits, const unsigned char *nonce, const unsigned char *extra_commit, size_t extra_commit_len) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(6) SECP256K1_ARG_NONNULL(8) SECP256K1_ARG_NONNULL(10) SECP256K1_ARG_NONNULL(12)
Produces an aggregate Bulletproof rangeproof for a set of Pedersen commitments Returns: 1: rangeproof...
SECP256K1_API secp256k1_bulletproof_generators * secp256k1_bulletproof_generators_create_with_pregenerated(const secp256k1_context2 *ctx) SECP256K1_ARG_NONNULL(1)
SECP256K1_WARN_UNUSED_RESULT SECP256K1_API int secp256k1_bulletproof_rangeproof_verify(const secp256k1_context2 *ctx, secp256k1_scratch_space2 *scratch, const secp256k1_bulletproof_generators *gens, const unsigned char *proof, size_t plen, const uint64_t *min_value, const secp256k1_pedersen_commitment *commit, size_t n_commits, size_t nbits, const secp256k1_generator *value_gen, const unsigned char *extra_commit, size_t extra_commit_len) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(7) SECP256K1_ARG_NONNULL(10)
Verifies a single bulletproof (aggregate) rangeproof Returns: 1: rangeproof was valid 0: rangeproof w...
SECP256K1_API int secp256k1_bulletproof_circuit_verify(const secp256k1_context2 *ctx, secp256k1_scratch_space2 *scratch, const secp256k1_bulletproof_generators *gens, const secp256k1_bulletproof_circuit *circ, const unsigned char *proof, size_t plen, const secp256k1_pedersen_commitment *commit, size_t n_commits, const secp256k1_generator *value_gen, const unsigned char *extra_commit, size_t extra_commit_len) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(9)
Verifies a single bulletproof zero-knowledge proof (zkp) Returns: 1: zkp accepted 0: zkp did not acce...
SECP256K1_API secp256k1_bulletproof_circuit_assignment * secp256k1_bulletproof_circuit_assignment_decode(const secp256k1_context2 *ctx, const char *fname) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Decodes an accepting wire assignment which is serialized in an opaque binary format Returns a circuit...
#define SECP256K1_WARN_UNUSED_RESULT
Warning attributes NONNULL is not used if SECP256K1_BUILD is set to avoid the compiler optimizing out...
SECP256K1_API void secp256k1_bulletproof_circuit_destroy(const secp256k1_context2 *ctx, secp256k1_bulletproof_circuit *circ) SECP256K1_ARG_NONNULL(1)
Destroys a circuit Args: ctx: pointer to a context object (cannot be NULL) gen: pointer to the circui...
SECP256K1_API void secp256k1_bulletproof_generators_destroy(const secp256k1_context2 *ctx, secp256k1_bulletproof_generators *gen) SECP256K1_ARG_NONNULL(1)
Destroys a list of NUMS generators, freeing allocated memory Args: ctx: pointer to a context object (...
Opaque data structure that stores a Pedersen commitment.
SECP256K1_API void secp256k1_bulletproof_circuit_assignment_destroy(const secp256k1_context2 *ctx, secp256k1_bulletproof_circuit_assignment *assn) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Destroys a circuit assignment Args: ctx: pointer to a context object (cannot be NULL) gen: pointer to...
#define SECP256K1_ARG_NONNULL(_x)
SECP256K1_API int secp256k1_bulletproof_circuit_verify_multi(const secp256k1_context2 *ctx, secp256k1_scratch_space2 *scratch, const secp256k1_bulletproof_generators *gens, const secp256k1_bulletproof_circuit *const *circ, const unsigned char *const *proof, size_t n_proofs, size_t plen, const secp256k1_pedersen_commitment **commit, size_t *n_commits, const secp256k1_generator *value_gen, const unsigned char **extra_commit, size_t *extra_commit_len) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(10)
Batch-verifies multiple bulletproof zero-knowledge proofs of equally-sized circuits (zkp) Returns: 1:...
SECP256K1_API secp256k1_bulletproof_circuit * secp256k1_bulletproof_circuit_parse(const secp256k1_context2 *ctx, const char *description) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Parses a circuit from an ad-hoc text string format Returns a circuit, or NULL on failure Args: ctx: p...
secp256k1_bulletproof_circuit * secp256k1_bulletproof_circuit_decode(const secp256k1_context2 *ctx, const char *fname)
Decodes a circuit which is serialized in an opaque binary format Returns a circuit,...
SECP256K1_API int secp256k1_bulletproof_circuit_prove(const secp256k1_context2 *ctx, secp256k1_scratch_space2 *scratch, const secp256k1_bulletproof_generators *gens, const secp256k1_bulletproof_circuit *circ, unsigned char *proof, size_t *plen, const secp256k1_bulletproof_circuit_assignment *assn, const unsigned char **blind, size_t n_commits, const unsigned char *nonce, const secp256k1_generator *value_gen, const unsigned char *extra_commit, size_t extra_commit_len) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(6) SECP256K1_ARG_NONNULL(7) SECP256K1_ARG_NONNULL(10) SECP256K1_ARG_NONNULL(11)
Produces a bulletproof zero-knowledge proof (zkp) Returns: 1: proof was successfully created 0: pro...