Module filecoin_proofs_api::seal
source · Expand description
Proof-of-Replication for sealing, unsealing, and verifying data sectors
Structs§
- The output of
seal_pre_commit_phase1
. - The output of
seal_pre_commit_phase2
.
Enums§
Functions§
- Computes a NUL-byte prefix and/or suffix for
source
using the providedpiece_lengths
andpiece_size
(such that thesource
, after preprocessing, will occupy a subtree of a Merkle tree built using the bytes fromtarget
), runs the resultant byte stream through the preprocessor, and writes the result totarget
. Returns a tuple containing the number of bytes written totarget
(source
plus alignment) and the commitment. - Given a
porep_config
and a list of seal commit outputs, this method aggregates those proofs (naively padding the count if necessary up to a power of 2) and returns the aggregate proof bytes. - Ensure that any persisted cached data for specified sector size is discarded.
- Ensure that any persisted layers are discarded.
- Ensure that any persisted synthetic proofs are discarded.
- Computes a sectors’s
comm_d
data commitment given its pieces. - Arguments
- fauxrep2 is a faster way to generate sectors for network genesis setup by reusing data from a previously generated sector.
- Generates a piece commitment for the provided byte source. Returns an error if the byte source produced more than
piece_size
bytes. - Generate and persist synthetic Merkle tree proofs for sector replica. Must be called with output from
seal_pre_commit_phase2
. - Generate Merkle tree for the label layers (TreeC) and return the root hash (CommC).
- Generate Merkle tree for sector replica (TreeRLast) and return the root hash (CommRLast).
- Given the specified arguments, this method returns the inputs that were used to generate the seal proof. This can be useful for proof aggregation, as verification requires these inputs.
- Unseals the sector at
sealed_path
and returns the bytes for a piece whose first (unpadded) byte begins atoffset
and ends atoffset
plusnum_bytes
, inclusive. Note that the entire sector is unsealed each time this function is called. - Unseals the sector read from
sealed_sector
, memory maps the sector into virtal memory, and returns the bytes for a piece whose first (unpadded) byte begins atoffset
and ends atoffset
plusnum_bytes
, inclusive. Note that the entire sector is unsealed each time this function is called. - Generate label layers (SDR).
- Generate Merkle tree proofs for sector replica. Must be called with output from
seal_pre_commit_phase2
. - Generates zk-SNARK proof for sector replica. Must be called with output of
seal_commit_phase1
. - Generates zk-SNARK proof for sector replica. Must be called with output of
seal_commit_phase1
. - First step in sector sealing process. Called before
seal_pre_commit_phase2
. Reads unsealed data fromin_path
, generates sealed data and writes toout_path
. - Second phase of seal precommit operation, must be called with output of
seal_pre_commit_phase1
. Generatescomm_r
replica commitment from outputs of previous step. - Unseals the sector read from
sealed_sector
and returns the bytes for a piece whose first (unpadded) byte begins atoffset
and ends atoffset
plusnum_bytes
, inclusive. Note that the entire sector is unsealed each time this function is called. - Given a
porep_config
, an aggregate proof, a list of seeds and a combined and flattened list of public inputs, this method verifies the aggregate seal proof. - Verify multiple proofs of sealed sector. Each input argument is an ordered vector corresponding to the proof to verify.
- Verify a single proof of a sealed sector.
- Writes bytes from
source
totarget
, adding bit-padding (“preprocessing”) as needed. Returns a tuple containing the number of bytes written totarget
and the commitment.