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

#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

Detailed Description

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.

Constructor & Destructor Documentation

◆ Sha256Transcript()

purify::bppp::candidate::Sha256Transcript::Sha256Transcript ( )

Definition at line 75 of file sha256_transcript.cpp.

References purify_sha256().

Member Function Documentation

◆ append_bytes()

◆ append_field()

void purify::bppp::candidate::Sha256Transcript::append_field ( const TranscriptBytes32 & value)

Definition at line 93 of file sha256_transcript.cpp.

◆ append_point()

Status purify::bppp::candidate::Sha256Transcript::append_point ( unsigned char prefix,
const TranscriptBytes32 & x )
nodiscard

◆ append_point_pair()

Status purify::bppp::candidate::Sha256Transcript::append_point_pair ( unsigned char parity,
const TranscriptBytes32 & first_x,
const TranscriptBytes32 & second_x )
nodiscard

◆ append_scalar()

◆ append_u64()

void purify::bppp::candidate::Sha256Transcript::append_u64 ( std::uint64_t value)

Definition at line 145 of file sha256_transcript.cpp.

◆ challenge()

Result< Sha256Challenge > purify::bppp::candidate::Sha256Transcript::challenge ( std::uint64_t round)
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().

◆ opening_base_scalar()

Result< Sha256Challenge > purify::bppp::candidate::Sha256Transcript::opening_base_scalar ( const TranscriptDigest & basis_digest,
std::uint64_t role ) const
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.


The documentation for this class was generated from the following files: