|
purify
C++ Purify implementation with native circuit and BPP support
|
Lowering helper that converts a symbolic transcript into native Bulletproof witness and circuit forms. More...
#include <bulletproof.hpp>
Public Member Functions | |
| void | replace_expr_v_with_bp_var (Expr &expr) |
| Rewrites transcript variable names to their eventual Bulletproof wire aliases. | |
| bool | replace_and_insert (Expr &expr, Symbol symbol) |
| Detects simple witness aliases and records them for later assignment lowering. | |
| void | add_assignment (Symbol symbol, Expr expr) |
| Adds one symbolic wire assignment to the lowering state. | |
| Status | from_transcript (const Transcript &transcript, std::size_t n_bits) |
| Imports a symbolic transcript and pads it to a power-of-two multiplication count. | |
| Status | add_pubkey_and_out (const UInt512 &pubkey, Expr p1x, Expr p2x, Expr out) |
| Binds packed public-key coordinates and the output commitment into explicit constraints. | |
| std::string | to_string () const |
| Renders the lowered circuit in the legacy textual verifier format. | |
| bool | evaluate (const WitnessAssignments &vars, const FieldElement &commitment) const |
| Evaluates the lowered symbolic constraints with a concrete commitment value. | |
| NativeBulletproofCircuit | native_circuit () const |
| Builds the native sparse circuit object from the lowered assignments and constraints. | |
| Result< BulletproofAssignmentData > | assignment_data (const WitnessAssignments &vars) const |
| Materializes the witness columns expected by the native circuit representation. | |
| Result< BulletproofAssignmentData > | assignment_data (const WitnessAssignments &vars, const FieldElement &commitment) const |
| Materializes the witness columns with an explicit output commitment value. | |
| Result< Bytes > | serialize_assignment (const WitnessAssignments &vars) const |
| Serializes the derived witness assignment using the legacy blob format. | |
Definition at line 425 of file bulletproof.hpp.
Definition at line 1703 of file bulletproof.cpp.
| Status purify::BulletproofTranscript::add_pubkey_and_out | ( | const UInt512 & | pubkey, |
| Expr | p1x, | ||
| Expr | p2x, | ||
| Expr | out | ||
| ) |
Definition at line 1773 of file bulletproof.cpp.
References purify::NativeBulletproofCircuit::add_constraint(), purify::Symbol::commitment(), purify::Expected< T, E >::error(), purify::Expected< T, E >::has_value(), purify::FieldElement::try_from_uint256(), purify::unexpected_error(), purify::unpack_public(), and purify::Expr::variable().
Referenced by purify::prove_assignment_data(), and purify::verifier().
| Result< BulletproofAssignmentData > purify::BulletproofTranscript::assignment_data | ( | const WitnessAssignments & | vars | ) | const |
Definition at line 2023 of file bulletproof.cpp.
Referenced by purify::prove_assignment_data().
| Result< BulletproofAssignmentData > purify::BulletproofTranscript::assignment_data | ( | const WitnessAssignments & | vars, |
| const FieldElement & | commitment | ||
| ) | const |
Definition at line 2027 of file bulletproof.cpp.
| bool purify::BulletproofTranscript::evaluate | ( | const WitnessAssignments & | vars, |
| const FieldElement & | commitment | ||
| ) | const |
Definition at line 1832 of file bulletproof.cpp.
References purify::Symbol::commitment(), and purify::Expected< T, E >::has_value().
Referenced by purify::prove_assignment_data().
| Status purify::BulletproofTranscript::from_transcript | ( | const Transcript & | transcript, |
| std::size_t | n_bits | ||
| ) |
Definition at line 1708 of file bulletproof.cpp.
References purify::Transcript::eqs(), purify::Symbol::left(), purify::Transcript::muls(), purify::NativeBulletproofCircuit::n_bits, purify::Symbol::output(), purify::Symbol::right(), purify::unexpected_error(), purify::UnsupportedSymbol, purify::Expr::variable(), purify::Transcript::varmap(), and purify::Symbol::witness().
Referenced by purify::prove_assignment_data(), purify::verifier(), and purify::verifier_circuit_template().
| NativeBulletproofCircuit purify::BulletproofTranscript::native_circuit | ( | ) | const |
Definition at line 1875 of file bulletproof.cpp.
References purify::NativeBulletproofCircuit::c, purify::NativeBulletproofCircuit::n_bits, purify::NativeBulletproofCircuit::n_commitments, purify::NativeBulletproofCircuit::n_gates, purify::Expr::variable(), purify::NativeBulletproofCircuit::wl, purify::NativeBulletproofCircuit::wo, purify::NativeBulletproofCircuit::wr, and purify::NativeBulletproofCircuit::wv.
Referenced by purify::verifier_circuit_template().
Definition at line 1685 of file bulletproof.cpp.
References purify::Expr::constant(), purify::FieldElement::is_zero(), purify::Expr::linear(), purify::FieldElement::one(), and purify::Witness.
| void purify::BulletproofTranscript::replace_expr_v_with_bp_var | ( | Expr & | expr | ) |
Definition at line 1675 of file bulletproof.cpp.
References purify::Expr::linear(), and purify::Witness.
Referenced by purify::verifier_circuit_template().
| Result< Bytes > purify::BulletproofTranscript::serialize_assignment | ( | const WitnessAssignments & | vars | ) | const |
Definition at line 2095 of file bulletproof.cpp.
References purify::Expected< T, E >::error(), purify::Expected< T, E >::has_value(), and purify::unexpected_error().
| std::string purify::BulletproofTranscript::to_string | ( | ) | const |
Definition at line 1801 of file bulletproof.cpp.
References purify::to_string().
Referenced by purify::verifier().