Skip to main content

Crate sp1_hypercube

Crate sp1_hypercube 

Source
Expand description

STARK-based primitives for proof generation and verification over AIRs.

Modules§

air
Building blocks for defining AIRs.
ir
Base types, enums, and structs for the constraint compiler.
operations
Common AIR operations used across SP1.
prover
Prover components.
septic_curve
Elliptic Curve y^2 = x^3 + 45x + 41z^3 over the F_{p^7} = F_p[z]/(z^7 - 3z - 5) extension field.
septic_digest
Elliptic Curve digests with a starting point to avoid weierstrass addition exceptions.
septic_extension
A septic extension with an irreducible polynomial z^7 - 3z - 5.
shape
Utilities for working with shapes

Macros§

chip_name
Macro to get the name of a chip.

Structs§

AirOpenedValues
The opening values for a given table section at a random point.
Chip
An Air that encodes lookups based on interactions.
ChipDimensions
A specification of preprocessed polynomial batch dimensions.
ChipEvaluation
The evaluations for a chip
ChipOpenedValues
The opening values for a given chip at a random point.
ChipStatistics
Statistics about a chip.
ConstraintSumcheckFolder
A folder for the zerocheck sumcheck poly.
DebugConstraintBuilder
A builder for debugging constraints.
GenericDebugPublicValuesConstraintFolder
A folder for verifier constraints.
GenericVerifierConstraintFolder
A folder for verifier constraints.
GenericVerifierPublicValuesConstraintFolder
A folder for verifier constraints.
GkrProverImpl
TODO
Interaction
An interaction for a lookup or a permutation argument.
InteractionBuilder
A builder for the lookup table interactions.
InteractionData
The data for an interaction.
InteractionLayer
An interaction layer of the GKR circuit (num_row_variables == 1).
LogUpEvaluations
The data passed from the GKR prover to the zerocheck prover.
LogUpGkrCpuLayer
A layer of the GKR circuit.
LogUpGkrOutput
The output of the log-up GKR circuit.
LogUpGkrVerifier
Verifier for LogUp GKR.
LogupGkrCpuCircuit
A trace generator for the GKR circuit.
LogupGkrCpuTraceGenerator
A trace generator for the GKR circuit.
LogupGkrProof
The proof for the log-up GKR circuit.
LogupGkrRoundProof
The proof for a single round of the log-up GKR circuit.
LogupRoundPolynomial
Polynomial representing a round of the GKR circuit.
Machine
A STARK for proving RISC-V execution.
MachineProof
A complete proof of program execution.
MachineShape
A shape for a machine.
MachineVerifier
A verifier for a machine proof.
MachineVerifyingKey
A verifying key.
MerkleProof
A Merkle tree proof for proving membership in the recursion verifying key set.
Poseidon2KoalaBearConfig
SP1RecursionProof
An intermediate proof which proves the execution of a Hypercube verifier.
SP1VerifyingKey
The information necessary to verify a proof for a given RISC-V program.
SP1WrapProof
An intermediate proof which proves the execution of a Hypercube verifier.
ShardContextImpl
The canonical type implementing ShardContext.
ShardOpenedValues
The values of the chips in the shard at a random point.
ShardProof
A proof for a shard.
ShardVerifier
A verifier for shard proofs.
TestingData
Data required for testing.
VcsError
The error type for Merkle proof verification.
Word
An array of four u16 limbs to represent a 64-bit value.

Enums§

GkrCircuitLayer
A layer of the GKR circuit.
InteractionKind
The type of interaction for a lookup argument.
LogupGkrVerificationError
An error type for LogUp GKR.
MachineVerifierError
An error that occurs during the verification of a machine proof.
OpeningShapeError
An error that occurs when the shape of the openings does not match the expected shape.
PolynomialLayer
A layer of the GKR circuit for the LogupRoundPolynomial.
ShardVerifierError
An error that occurs during the verification of a shard proof.

Constants§

DIGEST_SIZE
The digest size.
MAX_CONSTRAINT_DEGREE
The maximum constraint degree for a chip.
NUM_SP1_COMMITMENTS
The number of commitments in an SP1 shard proof, corresponding to the preprocessed and main commitments.
PROOF_MAX_NUM_PVS
The maximum number of elements that can be stored in the public values vec. Both SP1 and recursive proofs need to pad their public values vec to this length. This is required since the recursion verification program expects the public values vec to be fixed length.

Traits§

HashableKey
A trait for keys that can be hashed into a digest.
MachineRecord
A record that can be proven by a machine.
ShardContext
A shortcut trait to package a multilinear PCS verifier and a zerocheck AIR. Reduces number of generic parameters in the MachineVerifier type and AirProver trait.

Functions§

debug_constraints
Checks that the constraints of the given AIR are satisfied, including the permutation trace.
debug_constraints_all_chips
Checks that the constraints of all the given AIRs are satisfied on the proposed witnesses sent in main and preprocessed.
debug_interactions
Debugs the interactions of a chip.
debug_interactions_with_all_chips
Calculate the number of times we send and receive each event of the given interaction type, and print out the ones for which the set of sends and receives don’t match.
indices_arr
Get an array xs such that xs[i] = i.
inner_perm
Get the inner perm
koalabears_to_bn254
Convert 8 SP1Field words into a Bn254Fr field element by shifting by 31 bits each time. The last word becomes the least significant bits.
log2_ceil_usize
Compute the ceiling of the base-2 logarithm of a number.
next_multiple_of_32
Returns the internal value of the option if it is set, otherwise returns the next multiple of 32.
pad_rows_fixed
Pad to the next multiple of 32, with an option to specify the fixed height.
vec_to_string
Converts a vector of field elements to a string.
verify_merkle_proof
Verify a Merkle proof.
words_to_bytes_be
Utility method for converting u32 words to bytes in big endian.

Type Aliases§

DebugPublicValuesConstraintFolder
A folder for verifier constraints on public values.
InnerSC
A type alias for the shard contexts used in all stages of SP1 proving except wrap. Generic only in the AIR (allowing this SC to be used for the Risc-V and the recursion AIRs).
MachineVerifierConfigError
Derive the error type from the machine config.
OuterSC
A type alias for the shard contexts used in the outer (wrap) stage of SP1 proving. Generic only in the AIR.
SP1BasefoldConfig
The basefold configuration (field, extension field, challenger, tensor commitment scheme) for SP1.
SP1InnerPcs
The PCS used for all stages of SP1 proving except for wrap.
SP1MerkleTreeConfig
The Merkle tree configuration for SP1.
SP1OuterPcs
The PCS used for wrap proving.
SP1Pcs
The Multilinear PCS used in SP1 shard proofs, generic in the IopCtx.
SP1PcsProof
The PCS proof type used in SP1 shard proofs.
SP1PcsProofInner
The proof type for all stages of SP1 proving except for wrap.
SP1PcsProofOuter
The proof type for wrap proving.
SP1SC
A type alias assuming SP1Pcs (stacked Basefold) as the PCS verifier, generic in the IopCtx and the AIR.
ShardContextProof
The ShardProof type generic in GC and SC.
ShardVerifierConfigError
Derive the error type from the jagged config.
VerifierConstraintFolder
A folder for verifier constraints.
VerifierPublicValuesConstraintFolder
A folder for verifier constraints on public values.