purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
purify::bppp Namespace Reference

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)

Typedef Documentation

◆ CircuitNormArgPublicDataCacheKey

using purify::bppp::CircuitNormArgPublicDataCacheKey = std::array<unsigned char, 32>

Definition at line 60 of file bppp.cpp.

◆ CircuitNormArgPublicDataCacheKeyHash

◆ GeneratorBackendCacheKey

using purify::bppp::GeneratorBackendCacheKey = std::array<unsigned char, 32>

Definition at line 43 of file bppp.cpp.

◆ GeneratorBytes

using purify::bppp::GeneratorBytes = std::array<unsigned char, 33>

Definition at line 34 of file bppp.hpp.

◆ OwnedBpppBackendResources

Initial value:
std::unique_ptr<purify_bppp_backend_resources, BpppBackendResourcesDeleter>

Definition at line 40 of file bppp.cpp.

◆ PointBytes

using purify::bppp::PointBytes = std::array<unsigned char, 33>

Definition at line 32 of file bppp.hpp.

◆ ScalarBytes

using purify::bppp::ScalarBytes = std::array<unsigned char, 32>

Definition at line 30 of file bppp.hpp.

Function Documentation

◆ append_circuit_norm_round()

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().

◆ base_generator()

◆ commit_experimental_circuit_witness()

Result< PointBytes > purify::bppp::commit_experimental_circuit_witness ( const NativeBulletproofCircuit & circuit,
const BulletproofAssignmentData & assignment,
purify_secp_context * secp_context,
ExperimentalCircuitBackend * cache = nullptr )
Parameters
circuitNative circuit whose coordinate shape determines the fixed bases.
assignmentWitness assignment to commit.
Returns
Commitment to the raw hidden witness coordinates.

Definition at line 2094 of file bppp.cpp.

References PURIFY_ASSIGN_OR_RETURN.

Referenced by prove_experimental_circuit_norm_arg().

◆ commit_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().

◆ commit_norm_arg_with_cache()

◆ commit_output_witness() [1/2]

Result< CommittedPurifyWitness > purify::bppp::commit_output_witness ( const Bytes & message,
const SecretKey & secret,
const ScalarBytes & blind,
purify_secp_context * secp_context )
Parameters
messageMessage to evaluate.
secretOwned Purify secret key.
blindBlinding factor for the output commitment.
secp_contextActive secp256k1 context.
Returns
Witness bundle extended with the serialized output commitment.

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().

◆ commit_output_witness() [2/2]

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 )
Parameters
messageMessage to evaluate.
secretOwned Purify secret key.
blindBlinding factor for the output commitment.
secp_contextActive secp256k1 context.
value_genGenerator used for the value term.
blind_genGenerator used for the blind term.
Returns
Witness bundle extended with the serialized output commitment.

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().

◆ create_generators()

Result< std::vector< PointBytes > > purify::bppp::create_generators ( std::size_t count,
purify_secp_context * secp_context )
Parameters
countNumber of generators requested.
Returns
Serialized generator points, or a BPPP input/backend error.

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().

◆ digest_prefix_hash()

template<typename Digest>
std::size_t purify::bppp::digest_prefix_hash ( const Digest & digest)
noexcept

Definition at line 46 of file bppp.cpp.

Referenced by purify::bppp::GeneratorBackendCacheKeyHash::operator()().

◆ generator_backend_cache_key()

GeneratorBackendCacheKey purify::bppp::generator_backend_cache_key ( std::span< const PointBytes > generators)

◆ parse_norm_rounds_v4()

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 )

◆ pedersen_commit_char() [1/2]

Result< PointBytes > purify::bppp::pedersen_commit_char ( const ScalarBytes & blind,
const ScalarBytes & value,
purify_secp_context * secp_context )
Parameters
blindBlinding factor.
valueCommitted scalar value.
secp_contextActive secp256k1 context.
Returns
Serialized compressed commitment point, or a backend rejection error.

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().

◆ pedersen_commit_char() [2/2]

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 )
Parameters
blindBlinding factor.
valueCommitted scalar value.
secp_contextActive secp256k1 context.
value_genGenerator used for the value term.
blind_genGenerator used for the blind term.
Returns
Serialized compressed commitment point, or a backend rejection error.

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().

◆ prepare_norm_arg_v4()

◆ prove_experimental_circuit_norm_arg()

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 )
Parameters
circuitNative circuit to reduce.
assignmentWitness assignment to prove.
statement_bindingOptional statement bytes folded into the public reduction challenges.
Returns
Proof carrying the raw-coordinate commitment and BPPP proof bytes.

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.

◆ prove_experimental_circuit_norm_arg_to_commitment()

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 )

◆ prove_experimental_circuit_zk_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.

Parameters
circuitNative circuit to reduce.
assignmentWitness assignment to prove.
secret_prover_seedA 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_bindingOptional statement bytes folded into the public reduction challenges.
Returns
Masked proof bundle, or a reduction/backend error.

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().

◆ prove_experimental_circuit_zk_norm_arg_impl()

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 )

◆ 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.

Parameters
secret_prover_seedA 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().

◆ prove_norm_arg() [1/2]

Result< NormArgProof > purify::bppp::prove_norm_arg ( const NormArgInputs & inputs,
purify_secp_context * secp_context )
Parameters
inputsProver inputs and optional generators.
Returns
Proof bundle containing all verifier-side inputs, or a BPPP input/backend error.

Definition at line 1818 of file bppp.cpp.

Referenced by main(), and purify::bppp::ExperimentalCircuitCache::~ExperimentalCircuitCache().

◆ prove_norm_arg() [2/2]

Result< NormArgProof > purify::bppp::prove_norm_arg ( NormArgInputs && inputs,
purify_secp_context * secp_context )

Definition at line 1823 of file bppp.cpp.

◆ prove_norm_arg_to_commitment()

Result< NormArgProof > purify::bppp::prove_norm_arg_to_commitment ( const NormArgInputs & inputs,
const PointBytes & commitment,
purify_secp_context * secp_context )

◆ prove_norm_arg_to_commitment_v4()

◆ prove_norm_arg_to_commitment_with_cache()

◆ scalar_bytes() [1/2]

ScalarBytes purify::bppp::scalar_bytes ( const FieldElement & value)
inline
Parameters
valueField element to serialize.
Returns
Big-endian scalar bytes.

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().

◆ scalar_bytes() [2/2]

std::vector< ScalarBytes > purify::bppp::scalar_bytes ( std::span< const FieldElement > values)
inline
Parameters
valuesField elements to serialize.
Returns
Serialized scalar vector.

Definition at line 90 of file bppp.hpp.

References purify_scalar_get_b32(), and purify::detail::FieldElementAccess::raw().

◆ scalar_challenges()

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().

◆ value_generator_h()

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().

◆ verify_experimental_circuit_norm_arg()

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 )

◆ verify_experimental_circuit_zk_norm_arg()

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 )
Parameters
circuitNative circuit to reduce.
proofOuter commitments plus the inner masked BPPP proof.
statement_bindingOptional statement bytes folded into the public reduction challenges.
Returns
True when the masked proof verifies against the public circuit statement.

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().

◆ verify_experimental_circuit_zk_norm_arg_impl()

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 )

◆ verify_experimental_circuit_zk_norm_arg_with_public_commitments()

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().

◆ verify_norm_arg()

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().

Parameters
proofProof bundle returned by prove_norm_arg.
Returns
True when the proof verifies.

Definition at line 2089 of file bppp.cpp.

References verify_norm_arg_with_cache().

Referenced by main(), and purify::bppp::ExperimentalCircuitCache::~ExperimentalCircuitCache().

◆ verify_norm_arg_v4()

◆ verify_norm_arg_with_cache()