|
purify
C++ Purify implementation with native circuit and BPP support
|
Mutable transcript used to record symbolic multiplication, division, and boolean constraints. More...
#include <expr.hpp>
Data Structures | |
| struct | MulConstraint |
| One multiplicative relation emitted by the symbolic transcript. More... | |
Public Member Functions | |
| Transcript ()=default | |
| Transcript (const Transcript &)=delete | |
| Transcript & | operator= (const Transcript &)=delete |
| Transcript (Transcript &&) noexcept=default | |
| Transcript & | operator= (Transcript &&)=delete |
| ~Transcript () | |
| Expr | secret (const std::optional< FieldElement > &value) |
| Allocates a new secret witness variable, optionally with a known concrete value. | |
| Expr | mul (const Expr &lhs, const Expr &rhs) |
| Allocates or reuses a multiplication witness enforcing lhs * rhs = out. | |
| Expr | div (const Expr &lhs, const Expr &rhs) |
| Allocates or reuses a division witness enforcing out * rhs = lhs. | |
| Expr | boolean (const Expr &expr) |
| Constrains an expression to be boolean by adding x * (x - 1) = 0. | |
| void | equal (const Expr &lhs, const Expr &rhs) |
| Records a linear equality constraint between two expressions. | |
| std::optional< FieldElement > | evaluate (const Expr &expr) const |
| Evaluates an expression against the transcript's current witness vector. | |
| const WitnessAssignments & | varmap () const |
| Returns the underlying witness assignment vector. | |
| const std::vector< MulConstraint > & | muls () const |
| Returns the multiplication and division constraints accumulated so far. | |
| const std::vector< Expr > & | eqs () const |
| Returns the linear equality constraints accumulated so far. | |
|
default |
Referenced by operator=(), operator=(), Transcript(), and Transcript().
|
delete |
References Transcript().
|
defaultnoexcept |
References Transcript().
| purify::Transcript::~Transcript | ( | ) |
Definition at line 60 of file expr.cpp.
References purify::detail::secure_clear_bytes().
Definition at line 448 of file expr.cpp.
References boolean(), purify::Expr::evaluate(), purify::FieldElement::is_zero(), and purify::FieldElement::one().
Referenced by boolean(), and purify::circuit_main().
Definition at line 424 of file expr.cpp.
References div(), purify::Expr::evaluate(), purify::FieldElement::inverse_consttime(), and secret().
Referenced by purify::circuit_combine(), purify::circuit_ec_add(), purify::circuit_ec_add_x(), div(), and operator=().
|
inline |
Definition at line 260 of file expr.hpp.
Referenced by purify::BulletproofTranscript::from_transcript().
Definition at line 469 of file expr.cpp.
References equal(), and purify::Expr::evaluate().
Referenced by equal(), and operator=().
| std::optional< FieldElement > purify::Transcript::evaluate | ( | const Expr & | expr | ) | const |
Definition at line 479 of file expr.cpp.
References purify::Expr::evaluate(), and evaluate().
Referenced by evaluate(), operator=(), and purify::prove_assignment_data().
Definition at line 398 of file expr.cpp.
References purify::Expr::evaluate(), mul(), and secret().
Referenced by purify::circuit_2bit(), purify::circuit_3bit(), purify::circuit_combine(), purify::circuit_ec_add(), purify::circuit_ec_add_x(), purify::circuit_optionally_negate_ec(), mul(), and operator=().
|
inline |
Definition at line 255 of file expr.hpp.
Referenced by purify::accountable::anchor_escrow_circuit_shape_for_testing(), and purify::BulletproofTranscript::from_transcript().
|
delete |
References Transcript().
|
delete |
References div(), equal(), evaluate(), mul(), secret(), and Transcript().
| Expr purify::Transcript::secret | ( | const std::optional< FieldElement > & | value | ) |
Definition at line 390 of file expr.cpp.
References secret(), purify::Expr::variable(), and purify::Symbol::witness().
Referenced by purify::circuit_main(), div(), mul(), operator=(), and secret().
|
inline |
Definition at line 243 of file expr.hpp.
References varmap().
Referenced by purify::BulletproofTranscript::from_transcript(), purify::prove_assignment_data(), and varmap().