 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file. 1 #ifndef _SECP256K1_SURJECTIONPROOF_
2 #define _SECP256K1_SURJECTIONPROOF_
12 #define SECP256K1_SURJECTIONPROOF_MAX_N_INPUTS 256
17 #define SECP256K1_SURJECTIONPROOF_SERIALIZATION_BYTES(n_inputs, n_used_inputs) \
18 (2 + (n_inputs + 7)/8 + 32 * (1 + (n_used_inputs)))
21 #define SECP256K1_SURJECTIONPROOF_SERIALIZATION_BYTES_MAX \
22 SECP256K1_SURJECTIONPROOF_SERIALIZATION_BYTES(SECP256K1_SURJECTIONPROOF_MAX_N_INPUTS, SECP256K1_SURJECTIONPROOF_MAX_N_INPUTS)
70 const unsigned char *input,
88 unsigned char *output,
100 unsigned char data[32];
162 const
size_t n_input_tags,
163 const
size_t n_input_tags_to_use,
165 const
size_t n_max_iterations,
166 const
unsigned char *random_seed32
186 size_t n_ephemeral_input_tags,
189 const
unsigned char *input_blinding_key,
190 const
unsigned char *output_blinding_key
208 size_t n_ephemeral_input_tags,
#define SECP256K1_SURJECTIONPROOF_MAX_N_INPUTS
Maximum number of inputs that may be given in a surjection proof.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_surjectionproof_generate(const secp256k1_context2 *ctx, secp256k1_surjectionproof *proof, const secp256k1_generator *ephemeral_input_tags, size_t n_ephemeral_input_tags, const secp256k1_generator *ephemeral_output_tag, size_t input_index, const unsigned char *input_blinding_key, const unsigned char *output_blinding_key) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(7) SECP256K1_ARG_NONNULL(8)
Surjection proof generation function Returns 0: proof could not be created 1: proof was successfully ...
Opaque data structure that stores a base point.
SECP256K1_API int secp256k1_surjectionproof_verify(const secp256k1_context2 *ctx, const secp256k1_surjectionproof *proof, const secp256k1_generator *ephemeral_input_tags, size_t n_ephemeral_input_tags, const secp256k1_generator *ephemeral_output_tag) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(5)
Surjection proof verification function Returns 0: proof was invalid 1: proof was valid.
#define SECP256K1_WARN_UNUSED_RESULT
Warning attributes NONNULL is not used if SECP256K1_BUILD is set to avoid the compiler optimizing out...
Opaque data structure that holds a parsed surjection proof.
SECP256K1_API int secp256k1_surjectionproof_parse(const secp256k1_context2 *ctx, secp256k1_surjectionproof *proof, const unsigned char *input, size_t inputlen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse a surjection proof.
SECP256K1_API size_t secp256k1_surjectionproof_n_used_inputs(const secp256k1_context2 *ctx, const secp256k1_surjectionproof *proof) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Returns the actual number of inputs that a proof uses.
SECP256K1_API int secp256k1_surjectionproof_serialize(const secp256k1_context2 *ctx, unsigned char *output, size_t *outputlen, const secp256k1_surjectionproof *proof) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Serialize a surjection proof.
#define SECP256K1_ARG_NONNULL(_x)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_surjectionproof_initialize(const secp256k1_context2 *ctx, secp256k1_surjectionproof *proof, size_t *input_index, const secp256k1_fixed_asset_tag *fixed_input_tags, const size_t n_input_tags, const size_t n_input_tags_to_use, const secp256k1_fixed_asset_tag *fixed_output_tag, const size_t n_max_iterations, const unsigned char *random_seed32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(7)
Surjection proof initialization function; decides on inputs to use Returns 0: inputs could not be sel...
SECP256K1_API size_t secp256k1_surjectionproof_serialized_size(const secp256k1_context2 *ctx, const secp256k1_surjectionproof *proof) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Returns the total size this proof would take, in bytes, when serialized.
Data structure that holds a fixed asset tag.
SECP256K1_API size_t secp256k1_surjectionproof_n_total_inputs(const secp256k1_context2 *ctx, const secp256k1_surjectionproof *proof) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Returns the total number of inputs a proof expects to be over.
size_t n_inputs
Total number of input asset tags.