Skip to main content

Crate qp_plonky2_core

Crate qp_plonky2_core 

Source
Expand description

Core traits and types shared between plonky2 prover and verifier.

This crate provides the foundational types and traits that both the full plonky2 prover and the lightweight verifier depend on.

Re-exports§

pub extern crate alloc;
pub use challenger::Challenger;
pub use circuit_config::CircuitConfig;
pub use circuit_config::PolyFriZkConfig;
pub use circuit_config::ZkConfig;
pub use circuit_config::ZkMode;
pub use config::GenericConfig;
pub use config::GenericHashOut;
pub use config::Hasher;
pub use config::KeccakGoldilocksConfig;
pub use config::PoseidonGoldilocksConfig;
pub use fri::FriBatchMaskingParams;
pub use fri::FriChallenger;
pub use fri::FriConfig;
pub use fri::FriConfigObserve;
pub use fri::FriFinalPolyLayout;
pub use fri::FriParams;
pub use fri::FriParamsObserve;
pub use fri::FriReductionStrategy;
pub use fri_proof::combine_final_poly_chunks;
pub use fri_proof::eval_final_polys_at_point;
pub use fri_proof::CompressedFriProof;
pub use fri_proof::CompressedFriQueryRounds;
pub use fri_proof::FriBatchMaskProof;
pub use fri_proof::FriBatchMaskQuery;
pub use fri_proof::FriFinalPolys;
pub use fri_proof::FriInitialTreeProof;
pub use fri_proof::FriProof;
pub use fri_proof::FriQueryRound;
pub use fri_proof::FriQueryStep;
pub use fri_structure::FriBatchInfo;
pub use fri_structure::FriChallenges;
pub use fri_structure::FriCoefficient;
pub use fri_structure::FriInstanceInfo;
pub use fri_structure::FriOpeningBatch;
pub use fri_structure::FriOpeningExpression;
pub use fri_structure::FriOpeningTerm;
pub use fri_structure::FriOpenings;
pub use fri_structure::FriOracleInfo;
pub use fri_structure::FriOracleLayout;
pub use fri_structure::FriOracleRepresentation;
pub use fri_structure::FriPolynomialInfo;
pub use fri_validate_shape::validate_batch_fri_proof_shape;
pub use fri_validate_shape::validate_fri_proof_shape;
pub use fri_verifier::compute_evaluation;
pub use fri_verifier::fri_combine_initial;
pub use fri_verifier::fri_verify_proof_of_work;
pub use fri_verifier::verify_fri_proof;
pub use fri_verifier::PrecomputedReducedOpenings;
pub use hash::path_compression::compress_merkle_proofs;
pub use hash::path_compression::decompress_merkle_proofs;
pub use hash_types::BytesHash;
pub use hash_types::HashOut;
pub use hash_types::RichField;
pub use hash_types::NUM_HASH_OUT_ELTS;
pub use hashing::PlonkyPermutation;
pub use iop::flatten_target;
pub use iop::unflatten_target;
pub use iop::BoolTarget;
pub use iop::ExtensionAlgebraTarget;
pub use iop::ExtensionTarget;
pub use iop::HashOutTarget;
pub use iop::MerkleCapTarget;
pub use iop::Target;
pub use iop::Wire;
pub use keccak::KeccakHash;
pub use keccak::KeccakPermutation;
pub use merkle_proofs::MerkleProof;
pub use merkle_tree::capacity_up_to_mut;
pub use merkle_tree::fill_digests_buf;
pub use merkle_tree::fill_subtree;
pub use merkle_tree::merkle_tree_prove;
pub use merkle_tree::MerkleCap;
pub use merkle_tree::MerkleTree;
pub use plonk_common::eval_l_0;
pub use plonk_common::eval_zero_poly;
pub use plonk_common::reduce_with_powers;
pub use plonk_common::reduce_with_powers_multi;
pub use plonk_common::salt_size;
pub use plonk_common::PlonkOracle;
pub use plonk_common::SALT_SIZE;
pub use poseidon::Permuter;
pub use poseidon::Poseidon;
pub use poseidon::PoseidonHash;
pub use poseidon::PoseidonPermutation;
pub use poseidon::ALL_ROUND_CONSTANTS;
pub use poseidon::HALF_N_FULL_ROUNDS;
pub use poseidon::N_FULL_ROUNDS_TOTAL;
pub use poseidon::N_PARTIAL_ROUNDS;
pub use poseidon::N_ROUNDS;
pub use poseidon::SPONGE_CAPACITY;
pub use poseidon::SPONGE_RATE;
pub use poseidon::SPONGE_WIDTH;
pub use proof::FriInferredElements;
pub use proof::ProofChallenges;
pub use selectors::LookupSelectors;
pub use selectors::SelectorsInfo;
pub use selectors::UNUSED_SELECTOR;
pub use util::reverse_bits;

Modules§

challenger
circuit_config
Circuit configuration types shared between prover and verifier.
config
Hashing configuration for plonky2.
field
Re-export of plonky2_field for field types.
fri
FRI (Fast Reed-Solomon IOP) configuration types.
fri_proof
FRI proof types shared between prover and verifier.
fri_structure
FRI structure types shared between prover and verifier.
fri_validate_shape
FRI proof shape validation.
fri_verifier
FRI verification logic shared between prover and verifier.
hash
Hash-related utilities shared between prover and verifier.
hash_types
Core hash output types used throughout plonky2.
hashing
Concrete instantiation of a hash function.
iop
IOP (Interactive Oracle Proof) types shared between prover and verifier.
keccak
merkle_proofs
merkle_tree
plonk
PLONK types shared between prover and verifier.
plonk_common
Utility methods and constants for Plonk shared between prover and verifier.
poseidon
Implementation of the Poseidon hash function, as described in https://eprint.iacr.org/2019/458.pdf
poseidon_crandall
poseidon_goldilocks
Implementations for Poseidon over Goldilocks field of widths 8 and 12.
proof
Proof challenge types shared between prover and verifier.
reducing
selectors
Selector information shared between prover and verifier.
strided_view
util
Utility functions shared between prover and verifier.

Constants§

D
The extension degree for the field extension (D=2 provides 100-bits of security)

Functions§

assume
branch_hint
Try to force Rust to emit a branch. Example: if x > 2 { y = foo(); branch_hint(); } else { y = bar(); } This function has no semantics. It is a hint only.
log2_ceil
Computes ceil(log_2(n)).
log2_strict
Computes log_2(n), panicking if n is not a power of two.
reverse_index_bits
Permutes arr such that each index is mapped to its reverse in binary.
reverse_index_bits_in_place

Type Aliases§

C
The standard Plonky2 configuration using Poseidon hash over Goldilocks field
F
The Goldilocks prime field