|
purify
C++ Purify implementation with native circuit and BPP support
|
#include <sha256_transcript.hpp>
Public Member Functions | |
| Sha256Transcript () | |
| void | append_field (const TranscriptBytes32 &value) |
| void | append_scalar (const FieldElement &value) |
| Status | append_point (unsigned char prefix, const TranscriptBytes32 &x) |
| Status | append_point_pair (unsigned char parity, const TranscriptBytes32 &first_x, const TranscriptBytes32 &second_x) |
| Status | append_bytes (std::span< const unsigned char > bytes) |
| void | append_u64 (std::uint64_t value) |
| Result< Sha256Challenge > | challenge (std::uint64_t round) |
| Result< Sha256Challenge > | opening_base_scalar (const TranscriptDigest &basis_digest, std::uint64_t role) const |
Versioned, typed SHA-256 transcript for native and constrained replay.
The transcript starts from SHA256("Purify/SHA256Transcript/v1"). Appended items collect in a pending byte string. A challenge hashes the current state, the pending items, and a typed round marker, then replaces the state with that digest and clears the pending string. This bounds every constrained challenge to one SHA-256 compression chain over only the data added since the previous challenge.
Definition at line 38 of file sha256_transcript.hpp.
| purify::bppp::candidate::Sha256Transcript::Sha256Transcript | ( | ) |
Definition at line 75 of file sha256_transcript.cpp.
References purify_sha256().
|
nodiscard |
Definition at line 135 of file sha256_transcript.cpp.
References purify::Overflow, purify::size_fits_u64(), and purify::unexpected_error().
Referenced by purify::bppp::candidate::CircuitProofTranscriptV4::append_public_opening(), purify::bppp::candidate::CircuitProofTranscriptV4::create(), and purify::bppp::candidate::derive_circuit_precommitment_v4().
| void purify::bppp::candidate::Sha256Transcript::append_field | ( | const TranscriptBytes32 & | value | ) |
Definition at line 93 of file sha256_transcript.cpp.
|
nodiscard |
Definition at line 104 of file sha256_transcript.cpp.
References purify::BindingMismatch, purify::unexpected_error(), and purify::UnsupportedSymbol.
|
nodiscard |
Definition at line 122 of file sha256_transcript.cpp.
References purify::RangeViolation, and purify::unexpected_error().
Referenced by purify::bppp::candidate::CircuitProofTranscriptV4::append_round().
| void purify::bppp::candidate::Sha256Transcript::append_scalar | ( | const FieldElement & | value | ) |
Definition at line 98 of file sha256_transcript.cpp.
References purify::FieldElement::to_bytes_be().
Referenced by purify::bppp::candidate::CircuitProofTranscriptV4::append_mask(), purify::bppp::candidate::CircuitProofTranscriptV4::create(), and purify::bppp::candidate::CircuitProofTranscriptV4::finish().
| void purify::bppp::candidate::Sha256Transcript::append_u64 | ( | std::uint64_t | value | ) |
Definition at line 145 of file sha256_transcript.cpp.
|
nodiscard |
Advance the transcript and derive one nonzero 255-bit scalar.
Definition at line 149 of file sha256_transcript.cpp.
References challenge(), and PURIFY_ASSIGN_OR_RETURN.
Referenced by challenge(), purify::bppp::candidate::derive_circuit_precommitment_v4(), and purify::bppp::candidate::CircuitProofTranscriptV4::finish().
|
nodiscard |
Derive an opening scalar from a non-mutating transcript fork.
The fork additionally binds the basis digest and a typed opening role.
Definition at line 161 of file sha256_transcript.cpp.