|
purify
C++ Purify implementation with native circuit and BPP support
|
Namespaces | |
| namespace | candidate |
| namespace | accumulation |
| namespace | detail |
| Internal access helpers for experimental BPPP backend implementations. | |
Data Structures | |
| struct | NormArgInputs |
| Inputs for norm commitment computation and standalone BPPP proofs. Proving requires power-of-two vector lengths with n_vec.size() >= l_vec.size(). Commitment computation alone does not establish the proof relation. More... | |
| struct | NormArgProof |
| Standalone BPPP norm-argument proof bundle with all verifier-side inputs. More... | |
| class | ExperimentalCircuitBackend |
| Common interface for reusable experimental BPPP backend state. More... | |
| class | ExperimentalCircuitCacheLine |
| Thread-local clone of one warmed experimental BPPP backend-resource line. More... | |
| class | ExperimentalCircuitCache |
| Caller-owned cache for reusable experimental circuit reduction and BPPP backend data. More... | |
| struct | ExperimentalCircuitNormArgProof |
| Experimental transparent circuit proof backed by the standalone BPPP norm argument. More... | |
| struct | ExperimentalCircuitZkNormArgProof |
| Masked circuit proof with a pre-challenge raw-coordinate commitment. More... | |
| struct | CommittedPurifyWitness |
| Purify witness bundle together with a Pedersen commitment to the output. More... | |
| struct | BpppBackendResourcesDeleter |
| struct | GeneratorBackendCacheKeyHash |
| struct | CircuitNormRoundCallback |
| class | WipeOnDestruction |
Typedefs | |
| using | ScalarBytes = std::array<unsigned char, 32> |
| Big-endian 32-byte scalar encoding. | |
| using | PointBytes = std::array<unsigned char, 33> |
| Compressed 33-byte curve-point encoding. | |
| using | GeneratorBytes = std::array<unsigned char, 33> |
| Serialized generator encoding used by the BPPP bridge. | |
| using | OwnedBpppBackendResources |
| using | GeneratorBackendCacheKey = std::array<unsigned char, 32> |
| using | CircuitNormArgPublicDataCacheKey = std::array<unsigned char, 32> |
| using | CircuitNormArgPublicDataCacheKeyHash = GeneratorBackendCacheKeyHash |
Functions | |
| GeneratorBytes | base_generator (purify_secp_context *secp_context) |
| Returns the serialized secp256k1 base generator used as the blind generator. | |
| GeneratorBytes | value_generator_h (purify_secp_context *secp_context) |
| Returns the serialized alternate generator used for committed values. | |
| Result< std::vector< PointBytes > > | create_generators (std::size_t count, purify_secp_context *secp_context) |
| Expands the BPPP generator list. | |
| Result< PointBytes > | pedersen_commit_char (const ScalarBytes &blind, const ScalarBytes &value, purify_secp_context *secp_context) |
| Computes a Pedersen commitment to an arbitrary 32-byte scalar value using Purify's default generators. | |
| Result< PointBytes > | pedersen_commit_char (const ScalarBytes &blind, const ScalarBytes &value, purify_secp_context *secp_context, const GeneratorBytes &value_gen, const GeneratorBytes &blind_gen) |
| Computes a Pedersen commitment to an arbitrary 32-byte scalar value with explicit generators. | |
| ScalarBytes | scalar_bytes (const FieldElement &value) |
| Serializes a Purify field element into the scalar encoding expected by the BPPP bridge. | |
| std::vector< ScalarBytes > | scalar_bytes (std::span< const FieldElement > values) |
| Serializes a vector of Purify field elements into BPPP scalar encodings. | |
| Result< PointBytes > | commit_norm_arg (const NormArgInputs &inputs, purify_secp_context *secp_context) |
| Computes the public BPPP commitment for a standalone norm-argument input bundle. | |
| Result< NormArgProof > | prove_norm_arg (const NormArgInputs &inputs, purify_secp_context *secp_context) |
| Produces a standalone BPPP norm argument. | |
| Result< NormArgProof > | prove_norm_arg (NormArgInputs &&inputs, purify_secp_context *secp_context) |
| Produces a standalone BPPP norm argument, moving large inputs into the returned proof when possible. | |
| Result< NormArgProof > | prove_norm_arg_to_commitment (const NormArgInputs &inputs, const PointBytes &commitment, purify_secp_context *secp_context) |
| Produces a standalone BPPP norm argument anchored to a caller-supplied public commitment. | |
| bool | verify_norm_arg (const NormArgProof &proof, purify_secp_context *secp_context) |
| Verifies a standalone BPPP norm argument. | |
| Result< PointBytes > | commit_experimental_circuit_witness (const NativeBulletproofCircuit &circuit, const BulletproofAssignmentData &assignment, purify_secp_context *secp_context, ExperimentalCircuitBackend *cache=nullptr) |
| Commits to raw circuit coordinates before reduction challenges exist. | |
| Result< ExperimentalCircuitNormArgProof > | prove_experimental_circuit_norm_arg (const NativeBulletproofCircuit &circuit, const BulletproofAssignmentData &assignment, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding={}, ExperimentalCircuitBackend *cache=nullptr) |
| Produces an anchored transparent circuit proof using the experimental circuit-to-BPPP reduction. | |
| Result< ExperimentalCircuitNormArgProof > | prove_experimental_circuit_norm_arg_to_commitment (const NativeBulletproofCircuit &circuit, const BulletproofAssignmentData &assignment, const PointBytes &witness_commitment, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding={}, ExperimentalCircuitBackend *cache=nullptr) |
| Produces an anchored transparent circuit proof against a caller-supplied raw-coordinate commitment. | |
| Result< bool > | verify_experimental_circuit_norm_arg (const NativeBulletproofCircuit &circuit, const ExperimentalCircuitNormArgProof &proof, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding={}, ExperimentalCircuitBackend *cache=nullptr) |
| Verifies an experimental transparent circuit proof produced by prove_experimental_circuit_norm_arg. | |
| Result< ExperimentalCircuitZkNormArgProof > | prove_experimental_circuit_zk_norm_arg (const NativeBulletproofCircuit &circuit, const BulletproofAssignmentData &assignment, const ScalarBytes &secret_prover_seed, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding={}, ExperimentalCircuitBackend *cache=nullptr) |
| Produces an experimental masked circuit proof over the reduced BPPP relation. | |
| Result< bool > | verify_experimental_circuit_zk_norm_arg (const NativeBulletproofCircuit &circuit, const ExperimentalCircuitZkNormArgProof &proof, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding={}, ExperimentalCircuitBackend *cache=nullptr) |
| Verifies an experimental masked circuit proof produced by prove_experimental_circuit_zk_norm_arg. | |
| Result< ExperimentalCircuitZkNormArgProof > | prove_experimental_circuit_zk_norm_arg_with_public_commitments (const NativeBulletproofCircuit &circuit, const BulletproofAssignmentData &assignment, const ScalarBytes &secret_prover_seed, std::span< const PointBytes > public_commitments, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding={}, ExperimentalCircuitBackend *cache=nullptr) |
| Produces an experimental masked circuit proof bound to explicit public commitment points. | |
| Result< bool > | verify_experimental_circuit_zk_norm_arg_with_public_commitments (const NativeBulletproofCircuit &circuit, const ExperimentalCircuitZkNormArgProof &proof, std::span< const PointBytes > public_commitments, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding={}, ExperimentalCircuitBackend *cache=nullptr) |
| Verifies an experimental masked circuit proof against explicit public commitment points. | |
| Result< CommittedPurifyWitness > | commit_output_witness (const Bytes &message, const SecretKey &secret, const ScalarBytes &blind, purify_secp_context *secp_context) |
| Evaluates Purify, derives its witness, and commits to the output using Purify's default generators. | |
| Result< CommittedPurifyWitness > | commit_output_witness (const Bytes &message, const SecretKey &secret, const ScalarBytes &blind, purify_secp_context *secp_context, const GeneratorBytes &value_gen, const GeneratorBytes &blind_gen) |
| Evaluates Purify, derives its witness, and commits to the output with explicit generators. | |
| template<typename Digest> | |
| std::size_t | digest_prefix_hash (const Digest &digest) noexcept |
| GeneratorBackendCacheKey | generator_backend_cache_key (std::span< const PointBytes > generators) |
| Result< PointBytes > | commit_norm_arg_with_cache (const NormArgInputs &inputs, purify_secp_context *secp_context, ExperimentalCircuitBackend *cache=nullptr) |
| Result< NormArgProof > | prove_norm_arg_to_commitment_with_cache (const NormArgInputs &inputs, const PointBytes &commitment, purify_secp_context *secp_context, ExperimentalCircuitBackend *cache=nullptr) |
| int | append_circuit_norm_round (void *callback_data, const unsigned char point_pair65[65], size_t round, unsigned char challenge32[32]) |
| Result< NormArgProof > | prove_norm_arg_to_commitment_v4 (const NormArgInputs &inputs, const PointBytes &commitment, candidate::CircuitProofTranscriptV4 &transcript, purify_secp_context *secp_context) |
| bool | verify_norm_arg_with_cache (const NormArgProof &proof, purify_secp_context *secp_context, ExperimentalCircuitBackend *cache=nullptr) |
| Result< std::vector< candidate::PackedPointPairV4 > > | parse_norm_rounds_v4 (const Bytes &proof, std::size_t round_count, ScalarBytes &terminal_n, ScalarBytes &terminal_l) |
| std::vector< ScalarBytes > | scalar_challenges (std::span< const candidate::CircuitChallengeV4 > challenges) |
| Result< PointBytes > | prepare_norm_arg_v4 (const NormArgProof &norm, std::span< const candidate::CircuitChallengeV4 > gammas, ScalarBytes &terminal_n, ScalarBytes &terminal_l, purify_secp_context *secp_context) |
| bool | verify_norm_arg_v4 (const NormArgProof &norm, std::span< const candidate::CircuitChallengeV4 > gammas, purify_secp_context *secp_context) |
| Result< ExperimentalCircuitZkNormArgProof > | prove_experimental_circuit_zk_norm_arg_impl (const NativeBulletproofCircuit &circuit, const BulletproofAssignmentData &assignment, const ScalarBytes &secret_prover_seed, std::span< const PointBytes > public_commitments, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding, bool externalize_commitments, ExperimentalCircuitBackend *cache) |
| Result< bool > | verify_experimental_circuit_zk_norm_arg_impl (const NativeBulletproofCircuit &circuit, const ExperimentalCircuitZkNormArgProof &proof, purify_secp_context *secp_context, std::span< const unsigned char > statement_binding, ExperimentalCircuitBackend *cache) |
| using purify::bppp::CircuitNormArgPublicDataCacheKey = std::array<unsigned char, 32> |
| using purify::bppp::GeneratorBackendCacheKey = std::array<unsigned char, 32> |
| using purify::bppp::GeneratorBytes = std::array<unsigned char, 33> |
| using purify::bppp::PointBytes = std::array<unsigned char, 33> |
| using purify::bppp::ScalarBytes = std::array<unsigned char, 32> |
| int purify::bppp::append_circuit_norm_round | ( | void * | callback_data, |
| const unsigned char | point_pair65[65], | ||
| size_t | round, | ||
| unsigned char | challenge32[32] ) |
Definition at line 1904 of file bppp.cpp.
Referenced by prove_norm_arg_to_commitment_v4().
| GeneratorBytes purify::bppp::base_generator | ( | purify_secp_context * | secp_context | ) |
Definition at line 1702 of file bppp.cpp.
References purify_bppp_base_generator().
Referenced by commit_output_witness(), main(), pedersen_commit_char(), purify::bppp::accumulation::PendingClaim::verify_algebraic_norm_reduction, and purify::bppp::accumulation::PendingClaim::verify_norm_reduction.
| Result< PointBytes > purify::bppp::commit_experimental_circuit_witness | ( | const NativeBulletproofCircuit & | circuit, |
| const BulletproofAssignmentData & | assignment, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
| circuit | Native circuit whose coordinate shape determines the fixed bases. |
| assignment | Witness assignment to commit. |
Definition at line 2094 of file bppp.cpp.
References PURIFY_ASSIGN_OR_RETURN.
Referenced by prove_experimental_circuit_norm_arg().
| Result< PointBytes > purify::bppp::commit_norm_arg | ( | const NormArgInputs & | inputs, |
| purify_secp_context * | secp_context ) |
Definition at line 2077 of file bppp.cpp.
References commit_norm_arg_with_cache().
| Result< PointBytes > purify::bppp::commit_norm_arg_with_cache | ( | const NormArgInputs & | inputs, |
| purify_secp_context * | secp_context, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
Definition at line 1745 of file bppp.cpp.
References purify::BackendRejectedInput, purify::bppp::NormArgInputs::c_vec, create_generators(), purify::EmptyInput, purify::bppp::NormArgInputs::generators, purify::bppp::NormArgInputs::l_vec, purify::bppp::NormArgInputs::n_vec, PURIFY_ASSIGN_OR_RETURN, purify_bppp_commit_norm_arg(), purify_bppp_commit_norm_arg_with_resources(), PURIFY_RETURN_IF_ERROR, purify::require_secp_context(), purify::bppp::NormArgInputs::rho, purify::SizeMismatch, and purify::unexpected_error().
Referenced by commit_norm_arg(), and prove_experimental_circuit_zk_norm_arg_impl().
| Result< CommittedPurifyWitness > purify::bppp::commit_output_witness | ( | const Bytes & | message, |
| const SecretKey & | secret, | ||
| const ScalarBytes & | blind, | ||
| purify_secp_context * | secp_context ) |
| message | Message to evaluate. |
| secret | Owned Purify secret key. |
| blind | Blinding factor for the output commitment. |
| secp_context | Active secp256k1 context. |
Definition at line 3847 of file bppp.cpp.
References base_generator(), commit_output_witness(), and value_generator_h().
Referenced by commit_output_witness(), commit_output_witness(), and purify::run_cli().
| Result< CommittedPurifyWitness > purify::bppp::commit_output_witness | ( | const Bytes & | message, |
| const SecretKey & | secret, | ||
| const ScalarBytes & | blind, | ||
| purify_secp_context * | secp_context, | ||
| const GeneratorBytes & | value_gen, | ||
| const GeneratorBytes & | blind_gen ) |
| message | Message to evaluate. |
| secret | Owned Purify secret key. |
| blind | Blinding factor for the output commitment. |
| secp_context | Active secp256k1 context. |
| value_gen | Generator used for the value term. |
| blind_gen | Generator used for the blind term. |
Definition at line 3855 of file bppp.cpp.
References commit_output_witness(), pedersen_commit_char(), purify::prove_assignment_data(), PURIFY_ASSIGN_OR_RETURN, purify_scalar_get_b32(), and purify::detail::FieldElementAccess::raw().
| Result< std::vector< PointBytes > > purify::bppp::create_generators | ( | std::size_t | count, |
| purify_secp_context * | secp_context ) |
| count | Number of generators requested. |
Definition at line 1721 of file bppp.cpp.
References purify::BackendRejectedInput, purify_bppp_create_generators(), PURIFY_RETURN_IF_ERROR, purify::require_secp_context(), purify::unexpected_error(), and purify::UnexpectedSize.
Referenced by commit_norm_arg_with_cache(), purify::bppp::accumulation::Basis::create(), and prove_norm_arg_to_commitment_with_cache().
|
noexcept |
Definition at line 46 of file bppp.cpp.
Referenced by purify::bppp::GeneratorBackendCacheKeyHash::operator()().
| GeneratorBackendCacheKey purify::bppp::generator_backend_cache_key | ( | std::span< const PointBytes > | generators | ) |
Definition at line 63 of file bppp.cpp.
References purify_sha256().
Referenced by purify::bppp::ExperimentalCircuitCache::clone_line_for_thread(), and purify::bppp::candidate::prepare_circuit_zk_norm_arg_v4_impl().
| Result< std::vector< candidate::PackedPointPairV4 > > purify::bppp::parse_norm_rounds_v4 | ( | const Bytes & | proof, |
| std::size_t | round_count, | ||
| ScalarBytes & | terminal_n, | ||
| ScalarBytes & | terminal_l ) |
Definition at line 2003 of file bppp.cpp.
References purify::checked_add_size(), purify::checked_mul_size(), purify::InvalidDimensions, and purify::unexpected_error().
Referenced by purify::bppp::candidate::prepare_circuit_zk_norm_arg_v4_impl().
| Result< PointBytes > purify::bppp::pedersen_commit_char | ( | const ScalarBytes & | blind, |
| const ScalarBytes & | value, | ||
| purify_secp_context * | secp_context ) |
| blind | Blinding factor. |
| value | Committed scalar value. |
| secp_context | Active secp256k1 context. |
Definition at line 1793 of file bppp.cpp.
References base_generator(), pedersen_commit_char(), and value_generator_h().
Referenced by commit_output_witness(), and pedersen_commit_char().
| Result< PointBytes > purify::bppp::pedersen_commit_char | ( | const ScalarBytes & | blind, |
| const ScalarBytes & | value, | ||
| purify_secp_context * | secp_context, | ||
| const GeneratorBytes & | value_gen, | ||
| const GeneratorBytes & | blind_gen ) |
| blind | Blinding factor. |
| value | Committed scalar value. |
| secp_context | Active secp256k1 context. |
| value_gen | Generator used for the value term. |
| blind_gen | Generator used for the blind term. |
Definition at line 1801 of file bppp.cpp.
References purify::BackendRejectedInput, purify_pedersen_commit_char(), PURIFY_RETURN_IF_ERROR, purify::require_secp_context(), and purify::unexpected_error().
| Result< PointBytes > purify::bppp::prepare_norm_arg_v4 | ( | const NormArgProof & | norm, |
| std::span< const candidate::CircuitChallengeV4 > | gammas, | ||
| ScalarBytes & | terminal_n, | ||
| ScalarBytes & | terminal_l, | ||
| purify_secp_context * | secp_context ) |
Definition at line 2036 of file bppp.cpp.
References purify::BackendRejectedInput, purify::bppp::NormArgProof::c_vec, purify::bppp::NormArgProof::commitment, purify::bppp::NormArgProof::generators, purify::bppp::NormArgProof::n_vec_len, purify::bppp::NormArgProof::proof, purify_bppp_prepare_norm_arg_claim_with_challenges(), purify::bppp::NormArgProof::rho, scalar_challenges(), and purify::unexpected_error().
Referenced by purify::bppp::candidate::prepare_circuit_zk_norm_arg_v4_impl().
| Result< ExperimentalCircuitNormArgProof > purify::bppp::prove_experimental_circuit_norm_arg | ( | const NativeBulletproofCircuit & | circuit, |
| const BulletproofAssignmentData & | assignment, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding = {}, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
| circuit | Native circuit to reduce. |
| assignment | Witness assignment to prove. |
| statement_binding | Optional statement bytes folded into the public reduction challenges. |
Definition at line 2186 of file bppp.cpp.
References commit_experimental_circuit_witness(), prove_experimental_circuit_norm_arg_to_commitment(), and PURIFY_ASSIGN_OR_RETURN.
| Result< ExperimentalCircuitNormArgProof > purify::bppp::prove_experimental_circuit_norm_arg_to_commitment | ( | const NativeBulletproofCircuit & | circuit, |
| const BulletproofAssignmentData & | assignment, | ||
| const PointBytes & | witness_commitment, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding = {}, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
| circuit | Native circuit to reduce. |
| assignment | Witness assignment to prove. |
| witness_commitment | Raw-coordinate commitment made before reduction challenges. |
| statement_binding | Optional statement bytes folded into the public reduction challenges. |
Definition at line 2110 of file bppp.cpp.
References purify::BackendRejectedInput, purify::BulletproofAssignmentData::commitments, purify::EquationMismatch, purify::NativeBulletproofCircuit::evaluate(), purify::NativeBulletproofCircuit::has_valid_shape(), purify::InvalidDimensions, purify::is_power_of_two_size(), purify::bppp::NormArgInputs::l_vec, purify::BulletproofAssignmentData::left, purify::NativeBulletproofCircuit::n_commitments, purify::NativeBulletproofCircuit::n_gates, purify::bppp::NormArgInputs::n_vec, purify::BulletproofAssignmentData::output, prove_norm_arg_to_commitment_with_cache(), PURIFY_ASSIGN_OR_RETURN, purify::BulletproofAssignmentData::right, purify::SizeMismatch, and purify::unexpected_error().
Referenced by prove_experimental_circuit_norm_arg().
| Result< ExperimentalCircuitZkNormArgProof > purify::bppp::prove_experimental_circuit_zk_norm_arg | ( | const NativeBulletproofCircuit & | circuit, |
| const BulletproofAssignmentData & | assignment, | ||
| const ScalarBytes & | secret_prover_seed, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding = {}, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
The prover first commits to fixed raw circuit coordinates, then derives structured random reduction coefficients and reciprocal-scales the norm bases so the reduced opening maps back to that commitment. It commits to a random mask and proves only the challenge-combined witness with the inner BPPP norm argument. Secret witness commitments and the inner proof's witness-dependent X/R commitments use constant-time secp256k1 multiplication and addition. Variable-time group operations are confined to transcript-derived public folds, public verification, accumulation, and points already declassified as proof output. This is a reviewed code boundary, not a formal side-channel proof; the API remains experimental.
| circuit | Native circuit to reduce. |
| assignment | Witness assignment to prove. |
| secret_prover_seed | A secret, uniformly unpredictable 32-byte seed. Reuse is permitted only for the identical assignment and statement. Supply a fresh independent seed whenever the assignment may differ, even under the same public statement; disclosure compromises the proof's witness-hiding randomness. |
| statement_binding | Optional statement bytes folded into the public reduction challenges. |
Definition at line 3791 of file bppp.cpp.
References prove_experimental_circuit_zk_norm_arg(), and prove_experimental_circuit_zk_norm_arg_impl().
Referenced by main(), and prove_experimental_circuit_zk_norm_arg().
| Result< ExperimentalCircuitZkNormArgProof > purify::bppp::prove_experimental_circuit_zk_norm_arg_impl | ( | const NativeBulletproofCircuit & | circuit, |
| const BulletproofAssignmentData & | assignment, | ||
| const ScalarBytes & | secret_prover_seed, | ||
| std::span< const PointBytes > | public_commitments, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding, | ||
| bool | externalize_commitments, | ||
| ExperimentalCircuitBackend * | cache ) |
Definition at line 2245 of file bppp.cpp.
References purify::BackendRejectedInput, purify::bppp::NormArgInputs::c_vec, commit_norm_arg_with_cache(), purify::BulletproofAssignmentData::commitments, purify::EmptyInput, purify::EquationMismatch, purify::Expected< T, E >::error(), purify::NativeBulletproofCircuit::evaluate(), purify::experimental_circuit_binding_digest(), purify::FieldElement::from_int(), purify::bppp::NormArgInputs::generators, purify::NativeBulletproofCircuit::has_valid_shape(), purify::Expected< T, E >::has_value(), purify::InternalMismatch, purify::InvalidDimensions, purify::is_power_of_two_size(), purify::FieldElement::is_zero(), purify::bppp::NormArgInputs::l_vec, purify::BulletproofAssignmentData::left, purify::NativeBulletproofCircuit::n_commitments, purify::NativeBulletproofCircuit::n_gates, purify::bppp::NormArgInputs::n_vec, purify::BulletproofAssignmentData::output, prove_norm_arg_to_commitment_with_cache(), PURIFY_ASSIGN_OR_RETURN, PURIFY_RETURN_IF_ERROR, purify::bppp::NormArgInputs::rho, purify::BulletproofAssignmentData::right, scalar_bytes(), purify::SizeMismatch, purify::unexpected_error(), and purify::FieldElement::zero().
Referenced by prove_experimental_circuit_zk_norm_arg(), and prove_experimental_circuit_zk_norm_arg_with_public_commitments().
| Result< ExperimentalCircuitZkNormArgProof > purify::bppp::prove_experimental_circuit_zk_norm_arg_with_public_commitments | ( | const NativeBulletproofCircuit & | circuit, |
| const BulletproofAssignmentData & | assignment, | ||
| const ScalarBytes & | secret_prover_seed, | ||
| std::span< const PointBytes > | public_commitments, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding = {}, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
This variant removes circuit commitment scalars from the hidden witness and binds them through caller-supplied compressed secp256k1 points. Each point must equal the exact public commitment assignment.commitments[i] * G. One 64-byte Schnorr proof checks a transcript-derived random linear combination of all points; it is not a literal independent proof of every opening. In the random-oracle/algebraic-group model, extracting all m openings incurs an additional batch soundness loss of approximately (m - 1) / q, where q is the secp256k1 subgroup order.
| secret_prover_seed | A secret, uniformly unpredictable 32-byte seed. Reuse is permitted only for the identical assignment and statement. Supply a fresh independent seed whenever the assignment may differ, even under the same public statement. The batched Schnorr nonce is also hedged with the canonical batched opening, but seed disclosure still compromises the surrounding proof's witness-hiding randomness. |
Definition at line 3814 of file bppp.cpp.
References prove_experimental_circuit_zk_norm_arg_impl(), and prove_experimental_circuit_zk_norm_arg_with_public_commitments().
Referenced by prove_experimental_circuit_zk_norm_arg_with_public_commitments().
| Result< NormArgProof > purify::bppp::prove_norm_arg | ( | const NormArgInputs & | inputs, |
| purify_secp_context * | secp_context ) |
| inputs | Prover inputs and optional generators. |
Definition at line 1818 of file bppp.cpp.
Referenced by main(), and purify::bppp::ExperimentalCircuitCache::~ExperimentalCircuitCache().
| Result< NormArgProof > purify::bppp::prove_norm_arg | ( | NormArgInputs && | inputs, |
| purify_secp_context * | secp_context ) |
| Result< NormArgProof > purify::bppp::prove_norm_arg_to_commitment | ( | const NormArgInputs & | inputs, |
| const PointBytes & | commitment, | ||
| purify_secp_context * | secp_context ) |
Definition at line 2083 of file bppp.cpp.
References prove_norm_arg_to_commitment_with_cache().
Referenced by purify::bppp::ExperimentalCircuitCache::~ExperimentalCircuitCache().
| Result< NormArgProof > purify::bppp::prove_norm_arg_to_commitment_v4 | ( | const NormArgInputs & | inputs, |
| const PointBytes & | commitment, | ||
| candidate::CircuitProofTranscriptV4 & | transcript, | ||
| purify_secp_context * | secp_context ) |
Definition at line 1926 of file bppp.cpp.
References append_circuit_norm_round(), purify::BackendRejectedInput, purify::bppp::NormArgInputs::c_vec, purify::bppp::CircuitNormRoundCallback::error, purify::bppp::NormArgInputs::generators, purify::InternalMismatch, purify::InvalidDimensions, purify::bppp::NormArgInputs::l_vec, purify::bppp::NormArgInputs::n_vec, purify_bppp_prove_norm_arg_to_commitment_with_callback(), purify_bppp_required_proof_size(), purify::bppp::NormArgInputs::rho, purify::bppp::candidate::CircuitTranscriptShapeV4::round_count(), purify::bppp::CircuitNormRoundCallback::rounds, purify::bppp::candidate::CircuitProofTranscriptV4::shape(), and purify::unexpected_error().
| Result< NormArgProof > purify::bppp::prove_norm_arg_to_commitment_with_cache | ( | const NormArgInputs & | inputs, |
| const PointBytes & | commitment, | ||
| purify_secp_context * | secp_context, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
Definition at line 1828 of file bppp.cpp.
References purify::BackendRejectedInput, purify::bppp::NormArgInputs::c_vec, create_generators(), purify::EmptyInput, purify::bppp::NormArgInputs::generators, purify::InvalidDimensions, purify::bppp::NormArgInputs::l_vec, purify::bppp::NormArgInputs::n_vec, PURIFY_ASSIGN_OR_RETURN, purify_bppp_prove_norm_arg_to_commitment(), purify_bppp_prove_norm_arg_to_commitment_with_resources(), purify_bppp_required_proof_size(), PURIFY_RETURN_IF_ERROR, purify::require_secp_context(), purify::bppp::NormArgInputs::rho, purify::SizeMismatch, and purify::unexpected_error().
Referenced by prove_experimental_circuit_norm_arg_to_commitment(), prove_experimental_circuit_zk_norm_arg_impl(), and prove_norm_arg_to_commitment().
|
inline |
| value | Field element to serialize. |
Definition at line 78 of file bppp.hpp.
References purify_scalar_get_b32(), and purify::detail::FieldElementAccess::raw().
Referenced by prove_experimental_circuit_zk_norm_arg_impl().
|
inline |
| values | Field elements to serialize. |
Definition at line 90 of file bppp.hpp.
References purify_scalar_get_b32(), and purify::detail::FieldElementAccess::raw().
| std::vector< ScalarBytes > purify::bppp::scalar_challenges | ( | std::span< const candidate::CircuitChallengeV4 > | challenges | ) |
Definition at line 2026 of file bppp.cpp.
Referenced by prepare_norm_arg_v4(), and verify_norm_arg_v4().
| GeneratorBytes purify::bppp::value_generator_h | ( | purify_secp_context * | secp_context | ) |
Definition at line 1711 of file bppp.cpp.
References purify_bppp_value_generator_h().
Referenced by commit_output_witness(), and pedersen_commit_char().
| Result< bool > purify::bppp::verify_experimental_circuit_norm_arg | ( | const NativeBulletproofCircuit & | circuit, |
| const ExperimentalCircuitNormArgProof & | proof, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding = {}, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
| circuit | Native circuit to reduce. |
| proof | Raw-coordinate commitment plus proof bytes. |
| statement_binding | Optional statement bytes folded into the public reduction challenges. |
Definition at line 2201 of file bppp.cpp.
References purify::bppp::NormArgProof::c_vec, purify::bppp::NormArgProof::commitment, purify::EmptyInput, purify::bppp::NormArgProof::generators, purify::NativeBulletproofCircuit::has_valid_shape(), purify::InvalidDimensions, purify::is_power_of_two_size(), purify::NativeBulletproofCircuit::n_gates, purify::bppp::NormArgProof::n_vec_len, purify::bppp::ExperimentalCircuitNormArgProof::proof, purify::bppp::NormArgProof::proof, PURIFY_ASSIGN_OR_RETURN, purify::bppp::NormArgProof::rho, purify::unexpected_error(), verify_norm_arg_with_cache(), and purify::bppp::ExperimentalCircuitNormArgProof::witness_commitment.
| Result< bool > purify::bppp::verify_experimental_circuit_zk_norm_arg | ( | const NativeBulletproofCircuit & | circuit, |
| const ExperimentalCircuitZkNormArgProof & | proof, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding = {}, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
| circuit | Native circuit to reduce. |
| proof | Outer commitments plus the inner masked BPPP proof. |
| statement_binding | Optional statement bytes folded into the public reduction challenges. |
Definition at line 3803 of file bppp.cpp.
References verify_experimental_circuit_zk_norm_arg(), and verify_experimental_circuit_zk_norm_arg_impl().
Referenced by main(), and verify_experimental_circuit_zk_norm_arg().
| Result< bool > purify::bppp::verify_experimental_circuit_zk_norm_arg_impl | ( | const NativeBulletproofCircuit & | circuit, |
| const ExperimentalCircuitZkNormArgProof & | proof, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding, | ||
| ExperimentalCircuitBackend * | cache ) |
Definition at line 2703 of file bppp.cpp.
References purify::bppp::detail::prepare_experimental_circuit_zk_norm_arg(), PURIFY_ASSIGN_OR_RETURN, and verify_norm_arg_with_cache().
Referenced by verify_experimental_circuit_zk_norm_arg().
| Result< bool > purify::bppp::verify_experimental_circuit_zk_norm_arg_with_public_commitments | ( | const NativeBulletproofCircuit & | circuit, |
| const ExperimentalCircuitZkNormArgProof & | proof, | ||
| std::span< const PointBytes > | public_commitments, | ||
| purify_secp_context * | secp_context, | ||
| std::span< const unsigned char > | statement_binding = {}, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
The verifier checks the transcript-derived random-linear-combination DLog proof, derives structured reduction coefficients from proof.a_commitment, reconstructs the anchored outer commitment, and checks the inner BPPP proof. Treat opening knowledge as a batched ROM/algebraic- group claim with the soundness loss documented on the proving API, not as independent Schnorr proofs for every commitment.
Definition at line 3827 of file bppp.cpp.
References purify::bppp::detail::prepare_experimental_circuit_zk_norm_arg_with_public_commitments(), PURIFY_ASSIGN_OR_RETURN, verify_experimental_circuit_zk_norm_arg_with_public_commitments(), and verify_norm_arg_with_cache().
Referenced by verify_experimental_circuit_zk_norm_arg_with_public_commitments().
| bool purify::bppp::verify_norm_arg | ( | const NormArgProof & | proof, |
| purify_secp_context * | secp_context ) |
Requires a finite initial commitment and n_vec_len >= c_vec.size().
| proof | Proof bundle returned by prove_norm_arg. |
Definition at line 2089 of file bppp.cpp.
References verify_norm_arg_with_cache().
Referenced by main(), and purify::bppp::ExperimentalCircuitCache::~ExperimentalCircuitCache().
| bool purify::bppp::verify_norm_arg_v4 | ( | const NormArgProof & | norm, |
| std::span< const candidate::CircuitChallengeV4 > | gammas, | ||
| purify_secp_context * | secp_context ) |
Definition at line 2060 of file bppp.cpp.
References purify::bppp::NormArgProof::c_vec, purify::bppp::NormArgProof::commitment, purify::bppp::NormArgProof::generators, purify::bppp::NormArgProof::n_vec_len, purify::bppp::NormArgProof::proof, purify_bppp_verify_norm_arg_with_challenges(), purify::bppp::NormArgProof::rho, and scalar_challenges().
Referenced by purify::bppp::candidate::verify_circuit_zk_norm_arg_v4(), and purify::bppp::candidate::verify_circuit_zk_norm_arg_v4_with_public_commitments().
| bool purify::bppp::verify_norm_arg_with_cache | ( | const NormArgProof & | proof, |
| purify_secp_context * | secp_context, | ||
| ExperimentalCircuitBackend * | cache = nullptr ) |
Definition at line 1975 of file bppp.cpp.
References purify::bppp::NormArgProof::c_vec, purify::bppp::NormArgProof::commitment, purify::bppp::NormArgProof::generators, purify::bppp::NormArgProof::n_vec_len, purify::bppp::NormArgProof::proof, purify_bppp_verify_norm_arg(), purify_bppp_verify_norm_arg_with_resources(), and purify::bppp::NormArgProof::rho.
Referenced by verify_experimental_circuit_norm_arg(), verify_experimental_circuit_zk_norm_arg_impl(), verify_experimental_circuit_zk_norm_arg_with_public_commitments(), and verify_norm_arg().