 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file. 1 #ifndef _SECP256K1_COMMITMENT_
2 # define _SECP256K1_COMMITMENT_
23 unsigned char data[64];
41 const unsigned char *input
54 unsigned char *output,
78 const
unsigned char *blind,
97 unsigned char *blind_out,
98 const
unsigned char * const *blinds,
145 unsigned char* pubkey,
150 const
unsigned char* pubkey,
187 const uint64_t *value,
188 const
unsigned char* const* generator_blind,
189 unsigned char* const* blinding_factor,
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_pedersen_commit(const secp256k1_context2 *ctx, secp256k1_pedersen_commitment *commit, const unsigned char *blind, uint64_t value, const secp256k1_generator *value_gen, const secp256k1_generator *blind_gen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(6)
Generate a Pedersen commitment.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_pedersen_commitment_parse(const secp256k1_context2 *ctx, secp256k1_pedersen_commitment *commit, const unsigned char *input) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse a 33-byte commitment into a commitment object.
void secp256k1_pedersen_context_initialize(secp256k1_context2 *ctx)
Initialize a context for usage with Pedersen commitments.
Opaque data structure that stores a base point.
const SECP256K1_API secp256k1_generator * secp256k1_generator_h
Static constant generator 'h' maintained for historical reasons.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_pedersen_blind_generator_blind_sum(const secp256k1_context2 *ctx, const uint64_t *value, const unsigned char *const *generator_blind, unsigned char *const *blinding_factor, size_t n_total, size_t n_inputs)
Sets the final Pedersen blinding factor correctly when the generators themselves have blinding factor...
SECP256K1_API int secp256k1_pedersen_commitment_serialize(const secp256k1_context2 *ctx, unsigned char *output, const secp256k1_pedersen_commitment *commit) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Serialize a commitment object into a serialized byte sequence.
#define SECP256K1_WARN_UNUSED_RESULT
Warning attributes NONNULL is not used if SECP256K1_BUILD is set to avoid the compiler optimizing out...
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_pedersen_commitment_to_serialized_pubkey(secp256k1_pedersen_commitment *commit, unsigned char *pubkey, size_t *length) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_pedersen_verify_tally(const secp256k1_context2 *ctx, const secp256k1_pedersen_commitment *const *pos, size_t n_pos, const secp256k1_pedersen_commitment *const *neg, size_t n_neg) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(4)
Verify a tally of Pedersen commitments Returns 1: commitments successfully sum to zero.
Opaque data structure that stores a Pedersen commitment.
#define SECP256K1_ARG_NONNULL(_x)
SECP256K1_API void secp256k1_pedersen_serialized_pubkey_to_commitment(const unsigned char *pubkey, size_t length, secp256k1_pedersen_commitment *commit) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_pedersen_commitment_sum_pos(const secp256k1_context2 *ctx, const secp256k1_pedersen_commitment *const *pos, size_t n_pos, secp256k1_pedersen_commitment *out) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(4)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_pedersen_commitment_sum(const secp256k1_context2 *ctx, const secp256k1_pedersen_commitment *const *pos, size_t n_pos, const secp256k1_pedersen_commitment *const *neg, size_t n_neg, secp256k1_pedersen_commitment *out) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(6)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_pedersen_blind_sum(const secp256k1_context2 *ctx, unsigned char *blind_out, const unsigned char *const *blinds, size_t n, size_t npositive) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Computes the sum of multiple positive and negative blinding factors.