|
purify
C++ Purify implementation with native circuit and BPP support
|
#include "third_party/secp256k1-zkp/src/group.h"#include "third_party/secp256k1-zkp/src/scalar.h"#include "src/legacy_bulletproof/core.h"#include "src/legacy_bulletproof/util.h"Go to the source code of this file.
Macros | |
| #define | POPCOUNT(x) (secp256k1_popcount_size_t((size_t)(x))) |
| #define | CTZ(x) (secp256k1_ctz_size_t((size_t)(x))) |
| #define | IP_AB_SCALARS 4 |
Typedefs | |
| typedef int() | secp256k1_bulletproof_vfy_callback(secp256k1_scalar *sc, secp256k1_ge *pt, secp256k1_scalar *randomizer, size_t idx, void *data) |
Functions | |
| size_t | secp256k1_bulletproof_innerproduct_proof_length (size_t n) |
| static void | secp256k1_bulletproof_innerproduct_vfy_xproduct (secp256k1_scalar *out, const secp256k1_bulletproof_innerproduct_vfy_data *proof, size_t idx, size_t lg_vec_len, int invert) |
| static void | secp256k1_bulletproof_innerproduct_vfy_yinvpow (secp256k1_scalar *out, const secp256k1_bulletproof_innerproduct_vfy_data *proof, size_t idx, size_t lg_vec_len) |
| static void | secp256k1_bulletproof_innerproduct_vfy_generator_term (secp256k1_scalar *term, const secp256k1_bulletproof_innerproduct_vfy_ecmult_context *ctx, const secp256k1_bulletproof_innerproduct_vfy_data *proof, const secp256k1_scalar *randomizer, size_t idx) |
| static int | secp256k1_bulletproof_innerproduct_vfy_ecmult_callback (secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *data) |
| static int | secp256k1_bulletproof_inner_product_verify_impl (const secp256k1_ecmult_context *ecmult_ctx, secp256k1_scratch *scratch, const secp256k1_bulletproof_generators *gens, size_t vec_len, const secp256k1_bulletproof_innerproduct_context *proof, size_t n_proofs, size_t plen, int shared_g) |
| static int | secp256k1_bulletproof_innerproduct_pf_ecmult_callback_l (secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *data) |
| static int | secp256k1_bulletproof_innerproduct_pf_ecmult_callback_r (secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *data) |
| static int | secp256k1_bulletproof_innerproduct_pf_ecmult_callback_g (secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *data) |
| static int | secp256k1_bulletproof_innerproduct_pf_ecmult_callback_h (secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *data) |
| static int | secp256k1_bulletproof_inner_product_real_prove_impl (const secp256k1_ecmult_context *ecmult_ctx, secp256k1_scratch *scratch, secp256k1_ge *out_pt, size_t *pt_idx, const secp256k1_ge *g, secp256k1_ge *geng, secp256k1_ge *genh, secp256k1_scalar *a_arr, secp256k1_scalar *b_arr, const secp256k1_scalar *yinv, const secp256k1_scalar *ux, const size_t n, unsigned char *commit) |
| static int | secp256k1_bulletproof_inner_product_prove_impl (const secp256k1_ecmult_context *ecmult_ctx, secp256k1_scratch *scratch, unsigned char *proof, size_t *proof_len, const secp256k1_bulletproof_generators *gens, const secp256k1_scalar *yinv, const size_t n, secp256k1_ecmult_multi_callback *cb, void *cb_data, const unsigned char *commit_inp) |
| #define CTZ | ( | x | ) | (secp256k1_ctz_size_t((size_t)(x))) |
Definition at line 17 of file inner_product_impl.h.
| #define IP_AB_SCALARS 4 |
Definition at line 19 of file inner_product_impl.h.
| #define POPCOUNT | ( | x | ) | (secp256k1_popcount_size_t((size_t)(x))) |
Definition at line 16 of file inner_product_impl.h.
| typedef int() secp256k1_bulletproof_vfy_callback(secp256k1_scalar *sc, secp256k1_ge *pt, secp256k1_scalar *randomizer, size_t idx, void *data) |
Definition at line 21 of file inner_product_impl.h.
|
static |
Definition at line 666 of file inner_product_impl.h.
References secp256k1_bulletproof_generators::blinding_gen, secp256k1_bulletproof_generators::gens, IP_AB_SCALARS, secp256k1_bulletproof_generators::n, secp256k1_bulletproof_inner_product_real_prove_impl(), secp256k1_bulletproof_innerproduct_proof_length(), secp256k1_bulletproof_serialize_points(), secp256k1_floor_lg(), secp256k1_scalar_dot_product(), secp256k1_scratch_alloc, secp256k1_scratch_allocate_frame(), and secp256k1_scratch_deallocate_frame().
Referenced by secp256k1_bulletproof_relation66_prove_impl().
|
static |
Definition at line 567 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_pf_ecmult_context::a, secp256k1_bulletproof_innerproduct_pf_ecmult_context::b, secp256k1_bulletproof_innerproduct_pf_ecmult_context::g, secp256k1_bulletproof_innerproduct_pf_ecmult_context::g_sc, secp256k1_bulletproof_innerproduct_pf_ecmult_context::geng, secp256k1_bulletproof_innerproduct_pf_ecmult_context::genh, secp256k1_bulletproof_innerproduct_pf_ecmult_context::grouping, IP_AB_SCALARS, secp256k1_bulletproof_innerproduct_pf_ecmult_context::n, secp256k1_bulletproof_inner_product_real_prove_impl(), secp256k1_bulletproof_innerproduct_pf_ecmult_callback_g(), secp256k1_bulletproof_innerproduct_pf_ecmult_callback_h(), secp256k1_bulletproof_innerproduct_pf_ecmult_callback_l(), secp256k1_bulletproof_innerproduct_pf_ecmult_callback_r(), secp256k1_bulletproof_update_commit(), secp256k1_bulletproof_innerproduct_pf_ecmult_context::yinv, and secp256k1_bulletproof_innerproduct_pf_ecmult_context::yinvn.
Referenced by secp256k1_bulletproof_inner_product_prove_impl(), and secp256k1_bulletproof_inner_product_real_prove_impl().
|
static |
Definition at line 260 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_vfy_data::a, secp256k1_bulletproof_innerproduct_vfy_data::b, secp256k1_bulletproof_generators::blinding_gen, secp256k1_bulletproof_innerproduct_vfy_data::block_size, secp256k1_bulletproof_innerproduct_vfy_data::final_grouping, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::g, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::geng, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::genh, secp256k1_bulletproof_generators::gens, IP_AB_SCALARS, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::lg_vec_len, secp256k1_bulletproof_innerproduct_vfy_data::lr, secp256k1_bulletproof_generators::n, secp256k1_bulletproof_innerproduct_context::n_extra_rangeproof_points, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::n_proofs, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::p_offs, secp256k1_bulletproof_innerproduct_context::proof, secp256k1_bulletproof_innerproduct_vfy_data::proof, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::proof, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::randomizer, secp256k1_bulletproof_deserialize_point(), secp256k1_bulletproof_innerproduct_proof_length(), secp256k1_bulletproof_innerproduct_vfy_ecmult_callback(), secp256k1_bulletproof_update_commit(), secp256k1_floor_lg(), secp256k1_scalar_dot_product(), secp256k1_scratch_alloc, secp256k1_scratch_allocate_frame(), secp256k1_scratch_deallocate_frame(), secp256k1_bulletproof_innerproduct_vfy_ecmult_context::shared_g, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::vec_len, secp256k1_bulletproof_innerproduct_vfy_data::x, secp256k1_bulletproof_innerproduct_vfy_data::xinv, secp256k1_bulletproof_innerproduct_vfy_data::xsq, secp256k1_bulletproof_innerproduct_vfy_data::xsqinv, secp256k1_bulletproof_innerproduct_context::yinv, and secp256k1_bulletproof_innerproduct_vfy_data::yinvpow2.
Referenced by secp256k1_bulletproof_relation66_verify_impl().
|
static |
Definition at line 530 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_pf_ecmult_context::geng, secp256k1_bulletproof_innerproduct_pf_ecmult_context::grouping, secp256k1_bulletproof_innerproduct_pf_ecmult_context::x, and secp256k1_bulletproof_innerproduct_pf_ecmult_context::xinv.
Referenced by secp256k1_bulletproof_inner_product_real_prove_impl().
|
static |
Definition at line 546 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_pf_ecmult_context::genh, secp256k1_bulletproof_innerproduct_pf_ecmult_context::grouping, secp256k1_bulletproof_innerproduct_pf_ecmult_context::x, secp256k1_bulletproof_innerproduct_pf_ecmult_context::xinv, secp256k1_bulletproof_innerproduct_pf_ecmult_context::yinv, and secp256k1_bulletproof_innerproduct_pf_ecmult_context::yinvn.
Referenced by secp256k1_bulletproof_inner_product_real_prove_impl().
|
static |
Definition at line 454 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_pf_ecmult_context::a, secp256k1_bulletproof_innerproduct_pf_ecmult_context::b, secp256k1_bulletproof_innerproduct_pf_ecmult_context::g, secp256k1_bulletproof_innerproduct_pf_ecmult_context::g_sc, secp256k1_bulletproof_innerproduct_pf_ecmult_context::geng, secp256k1_bulletproof_innerproduct_pf_ecmult_context::genh, secp256k1_bulletproof_innerproduct_pf_ecmult_context::grouping, secp256k1_bulletproof_innerproduct_pf_ecmult_context::n, secp256k1_bulletproof_innerproduct_pf_ecmult_context::x, secp256k1_bulletproof_innerproduct_pf_ecmult_context::xinv, secp256k1_bulletproof_innerproduct_pf_ecmult_context::yinv, and secp256k1_bulletproof_innerproduct_pf_ecmult_context::yinvn.
Referenced by secp256k1_bulletproof_inner_product_real_prove_impl().
|
static |
Definition at line 493 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_pf_ecmult_context::a, secp256k1_bulletproof_innerproduct_pf_ecmult_context::b, secp256k1_bulletproof_innerproduct_pf_ecmult_context::g, secp256k1_bulletproof_innerproduct_pf_ecmult_context::g_sc, secp256k1_bulletproof_innerproduct_pf_ecmult_context::geng, secp256k1_bulletproof_innerproduct_pf_ecmult_context::genh, secp256k1_bulletproof_innerproduct_pf_ecmult_context::grouping, secp256k1_bulletproof_innerproduct_pf_ecmult_context::n, secp256k1_bulletproof_innerproduct_pf_ecmult_context::x, secp256k1_bulletproof_innerproduct_pf_ecmult_context::xinv, secp256k1_bulletproof_innerproduct_pf_ecmult_context::yinv, and secp256k1_bulletproof_innerproduct_pf_ecmult_context::yinvn.
Referenced by secp256k1_bulletproof_inner_product_real_prove_impl().
| size_t secp256k1_bulletproof_innerproduct_proof_length | ( | size_t | n | ) |
Definition at line 67 of file inner_product_impl.h.
References IP_AB_SCALARS, POPCOUNT, and secp256k1_floor_lg().
Referenced by purify_bulletproof_required_proof_size(), secp256k1_bulletproof_inner_product_prove_impl(), and secp256k1_bulletproof_inner_product_verify_impl().
|
static |
Definition at line 192 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_vfy_ecmult_context::g, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::geng, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::genh, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::lg_vec_len, secp256k1_bulletproof_innerproduct_vfy_data::lr, secp256k1_bulletproof_innerproduct_context::n_extra_rangeproof_points, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::n_proofs, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::p_offs, secp256k1_bulletproof_innerproduct_vfy_data::proof, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::proof, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::randomizer, secp256k1_bulletproof_innerproduct_context::rangeproof_cb, secp256k1_bulletproof_innerproduct_context::rangeproof_cb_data, secp256k1_bulletproof_innerproduct_vfy_generator_term(), secp256k1_bulletproof_innerproduct_vfy_ecmult_context::shared_g, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::vec_len, secp256k1_bulletproof_innerproduct_vfy_data::xsq, and secp256k1_bulletproof_innerproduct_vfy_data::xsqinv.
Referenced by secp256k1_bulletproof_inner_product_verify_impl().
|
static |
Definition at line 162 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_vfy_data::a, secp256k1_bulletproof_innerproduct_vfy_data::b, secp256k1_bulletproof_innerproduct_vfy_data::block_size, secp256k1_bulletproof_innerproduct_vfy_data::final_grouping, secp256k1_bulletproof_innerproduct_vfy_ecmult_context::lg_vec_len, secp256k1_bulletproof_innerproduct_vfy_xproduct(), secp256k1_bulletproof_innerproduct_vfy_yinvpow(), and secp256k1_bulletproof_innerproduct_vfy_ecmult_context::vec_len.
Referenced by secp256k1_bulletproof_innerproduct_vfy_ecmult_callback().
|
static |
Definition at line 123 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_vfy_data::x, and secp256k1_bulletproof_innerproduct_vfy_data::xinv.
Referenced by secp256k1_bulletproof_innerproduct_vfy_generator_term().
|
static |
Definition at line 144 of file inner_product_impl.h.
References secp256k1_bulletproof_innerproduct_vfy_data::yinvpow2.
Referenced by secp256k1_bulletproof_innerproduct_vfy_generator_term().