|
purify
C++ Purify implementation with native circuit and BPP support
|
Data Structures | |
| struct | CircuitZkNormArgProofV4 |
| struct | CircuitZkNormArgPublicationV4 |
| class | PreparedCircuitZkNormArgV4 |
| struct | CircuitNormParentConstantsV4 |
| class | CircuitTranscriptShapeV4 |
| class | CircuitPrecommitmentDigestV4 |
| struct | CircuitChallengeV4 |
| struct | CircuitPrecommitmentResultV4 |
| struct | CircuitProofTranscriptInputV4 |
| struct | CircuitProofTranscriptResultV4 |
| class | CircuitProofTranscriptV4 |
| struct | Sha256Challenge |
| class | Sha256Transcript |
Typedefs | |
| using | PackedPointPairV4 = std::array<unsigned char, 65> |
| using | TranscriptBytes32 = std::array<unsigned char, 32> |
| using | TranscriptDigest = TranscriptBytes32 |
Enumerations | |
| enum class | CircuitCommitmentModeV4 : std::uint64_t { Hidden = 0 , Public = 1 } |
| using purify::bppp::candidate::PackedPointPairV4 = std::array<unsigned char, 65> |
Definition at line 83 of file sha256_circuit_transcript.hpp.
| using purify::bppp::candidate::TranscriptBytes32 = std::array<unsigned char, 32> |
Definition at line 16 of file sha256_transcript.hpp.
Definition at line 17 of file sha256_transcript.hpp.
|
strong |
Whether circuit commitment values remain hidden or use public points.
| Enumerator | |
|---|---|
| Hidden | |
| Public | |
Definition at line 20 of file sha256_circuit_transcript.hpp.
|
nodiscard |
Derive public-leaf constants from a public nonzero precommitment.
A parent relation must separately constrain this precommitment to the private raw commitment and returned circuit binding digest, while binding the exact ordered public commitments. These derived constants alone do not authenticate a caller-supplied precommitment.
Definition at line 3744 of file bppp.cpp.
References derive_circuit_norm_parent_constants_v4_with_public_commitments().
Referenced by derive_circuit_norm_parent_constants_v4_with_public_commitments().
|
nodiscard |
Bind verifier-known circuit data and the hidden raw commitment.
The returned digest is public parent input. This function does not verify a circuit proof or authenticate any later proof field.
Definition at line 201 of file sha256_circuit_transcript.cpp.
References purify::bppp::candidate::Sha256Transcript::append_bytes(), purify::bppp::candidate::Sha256Transcript::challenge(), purify::bppp::candidate::CircuitPrecommitmentDigestV4::parse(), PURIFY_ASSIGN_OR_RETURN, PURIFY_RETURN_IF_ERROR, and purify::require_secp_context().
Referenced by prepare_circuit_zk_norm_arg_v4_impl().
|
nodiscard |
Replay the fixed V4 proof transcript and return its public challenges.
Definition at line 415 of file sha256_circuit_transcript.cpp.
References purify::bppp::candidate::CircuitProofTranscriptResultV4::alpha, purify::bppp::candidate::CircuitProofTranscriptInputV4::anchored_commitment, purify::bppp::candidate::CircuitProofTranscriptInputV4::anchored_offset, purify::bppp::candidate::CircuitProofTranscriptInputV4::batched_public_commitment, purify::bppp::candidate::CircuitProofTranscriptInputV4::coefficient_commitment, purify::bppp::candidate::CircuitProofTranscriptInputV4::combined_commitment, purify::bppp::candidate::CircuitProofTranscriptV4::create(), purify::bppp::candidate::CircuitProofTranscriptResultV4::dlog_challenge, purify::bppp::candidate::CircuitProofTranscriptInputV4::dlog_nonce, purify::bppp::candidate::CircuitProofTranscriptInputV4::dlog_response, purify::bppp::candidate::CircuitProofTranscriptResultV4::eta, purify::bppp::candidate::CircuitProofTranscriptResultV4::gammas, purify::bppp::candidate::CircuitProofTranscriptInputV4::mask_commitment, purify::bppp::candidate::CircuitProofTranscriptResultV4::mul_ratio, purify::bppp::candidate::CircuitProofTranscriptResultV4::mul_scale, purify::bppp::candidate::CircuitProofTranscriptResultV4::prepared_binding, PURIFY_ASSIGN_OR_RETURN, PURIFY_RETURN_IF_ERROR, purify::bppp::candidate::CircuitProofTranscriptInputV4::raw_generator_digest, purify::require_secp_context(), purify::bppp::candidate::CircuitProofTranscriptResultV4::rho, purify::bppp::candidate::CircuitTranscriptShapeV4::round_count(), purify::bppp::candidate::CircuitProofTranscriptInputV4::rounds, purify::bppp::candidate::CircuitProofTranscriptResultV4::row_ratio, purify::SizeMismatch, purify::bppp::candidate::CircuitProofTranscriptInputV4::t2, purify::bppp::candidate::CircuitProofTranscriptInputV4::terminal_l, purify::bppp::candidate::CircuitProofTranscriptInputV4::terminal_n, purify::FieldElement::try_from_bytes32(), and purify::unexpected_error().
Referenced by prepare_circuit_zk_norm_arg_v4_impl().
|
nodiscard |
Definition at line 3652 of file bppp.cpp.
References prepare_circuit_zk_norm_arg_v4(), and prepare_circuit_zk_norm_arg_v4_impl().
Referenced by prepare_circuit_zk_norm_arg_v4(), and verify_circuit_zk_norm_arg_v4().
| Result< std::optional< candidate::PreparedCircuitZkNormArgV4 > > purify::bppp::candidate::prepare_circuit_zk_norm_arg_v4_impl | ( | const NativeBulletproofCircuit & | circuit, |
| const CircuitZkNormArgPublicationV4 & | publication, | ||
| 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 3374 of file bppp.cpp.
References purify::bppp::candidate::CircuitPrecommitmentDigestV4::bytes(), purify::bppp::candidate::CircuitProofTranscriptV4::create(), derive_circuit_precommitment_v4(), derive_circuit_proof_transcript_v4(), purify::EmptyInput, purify::bppp::generator_backend_cache_key(), purify::InternalMismatch, purify::bppp::candidate::CircuitZkNormArgProofV4::mask_commitment, purify::bppp::candidate::CircuitZkNormArgProofV4::norm_proof, purify::bppp::parse_norm_rounds_v4(), purify::bppp::candidate::CircuitZkNormArgPublicationV4::precommitment, prepare_circuit_zk_norm_arg_v4_impl(), purify::bppp::prepare_norm_arg_v4(), purify::bppp::candidate::CircuitZkNormArgPublicationV4::proof, purify::bppp::candidate::CircuitZkNormArgProofV4::public_commitment_dlog_nonce, purify::bppp::candidate::CircuitZkNormArgProofV4::public_commitment_dlog_response, PURIFY_ASSIGN_OR_RETURN, PURIFY_RETURN_IF_ERROR, purify::bppp::candidate::CircuitZkNormArgProofV4::raw_commitment, purify::bppp::candidate::CircuitZkNormArgProofV4::t2, purify::FieldElement::try_from_bytes32(), and purify::unexpected_error().
Referenced by prepare_circuit_zk_norm_arg_v4(), prepare_circuit_zk_norm_arg_v4_impl(), and prepare_circuit_zk_norm_arg_v4_with_public_commitments().
|
nodiscard |
Definition at line 3664 of file bppp.cpp.
References prepare_circuit_zk_norm_arg_v4_impl(), and prepare_circuit_zk_norm_arg_v4_with_public_commitments().
Referenced by prepare_circuit_zk_norm_arg_v4_with_public_commitments(), and verify_circuit_zk_norm_arg_v4_with_public_commitments().
|
nodiscard |
Produce a hidden-commitment V4 proof.
secret_prover_seed must be secret and uniformly unpredictable. The synthetic randomness binds the complete ordered assignment and statement, so one seed may be reused safely; an identical input tuple is deterministic. Seed disclosure compromises witness-hiding randomness.
Definition at line 3625 of file bppp.cpp.
References prove_circuit_zk_norm_arg_v4().
Referenced by prove_circuit_zk_norm_arg_v4().
|
nodiscard |
Produce a public-commitment V4 proof.
secret_prover_seed has the same secret, uniformly unpredictable contract as the hidden prover. Synthetic randomness binds the complete assignment, ordered public points, and statement, so reuse is safe. The DLog nonce is additionally hedged with the public precommitment, but seed disclosure still compromises witness hiding.
Definition at line 3638 of file bppp.cpp.
References prove_circuit_zk_norm_arg_v4_with_public_commitments().
Referenced by prove_circuit_zk_norm_arg_v4_with_public_commitments().
|
nodiscard |
Recompute the hidden proof's public precommitment from its fields.
Definition at line 3350 of file bppp.cpp.
References reconstruct_circuit_zk_norm_arg_publication_v4().
Referenced by reconstruct_circuit_zk_norm_arg_publication_v4().
|
nodiscard |
|
nodiscard |
Validate a hidden-mode proof body's canonical fixed-shape encoding.
Definition at line 3331 of file bppp.cpp.
References validate_circuit_zk_norm_arg_proof_v4_encoding().
Referenced by validate_circuit_zk_norm_arg_proof_v4_encoding().
|
nodiscard |
|
nodiscard |
Validate canonical proof fields for an exact V4 mode and round count.
Definition at line 3323 of file bppp.cpp.
References validate_circuit_zk_norm_arg_proof_v4_fixed_encoding().
Referenced by validate_circuit_zk_norm_arg_proof_v4_fixed_encoding().
|
nodiscard |
Validate one canonical packed V4 norm-round point pair.
Definition at line 144 of file sha256_circuit_transcript.cpp.
References PURIFY_ASSIGN_OR_RETURN.
|
nodiscard |
Definition at line 3755 of file bppp.cpp.
References prepare_circuit_zk_norm_arg_v4(), PURIFY_ASSIGN_OR_RETURN, verify_circuit_zk_norm_arg_v4(), and purify::bppp::verify_norm_arg_v4().
Referenced by verify_circuit_zk_norm_arg_v4().
|
nodiscard |
Definition at line 3772 of file bppp.cpp.
References prepare_circuit_zk_norm_arg_v4_with_public_commitments(), PURIFY_ASSIGN_OR_RETURN, verify_circuit_zk_norm_arg_v4_with_public_commitments(), and purify::bppp::verify_norm_arg_v4().
Referenced by purify::accountable::AnchorEscrowRecord::verify_anchor_escrow, verify_circuit_zk_norm_arg_v4_with_public_commitments(), and purify::accountable::RecoveryRootContribution::verify_recovery_root_contribution.