Crate filecoin_proofs

Source

Re-exports§

pub use chunk_iter::ChunkIterator;
pub use constants::*;
pub use types::*;

Modules§

caches
chunk_iter
constants
param
parameters
pieces
types

Macros§

with_shape
Calls a function with the type hint of the sector shape matching the provided sector. Panics if provided with an unknown sector size.

Structs§

CommitmentReader
Calculates comm-d of the data piped through to it. Data must be bit padded and power of 2 bytes.

Functions§

add_piece
Computes a NUL-byte prefix and/or suffix for source using the provided piece_lengths and piece_size (such that the source, after preprocessing, will occupy a subtree of a merkle tree built using the bytes from target), runs the resultant byte stream through the preprocessor, and writes the result to target. Returns a tuple containing the number of bytes written to target (source plus alignment) and the commitment.
aggregate_empty_sector_update_proofs
aggregate_seal_commit_proofs
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.
as_safe_commitment
clear_cache
clear_synthetic_proofs
commitment_from_fr
compute_comm_d
Computes a sectors’s comm_d given its pieces.
decode_from
Reverses the encoding process and outputs the data into out_data_path.
decode_from_range
Decodes a range of data with the given sector key.
encode_into
Encodes data into an existing replica. The original replica is not modified and the resulting output data is written as new_replica_path (with required artifacts located in new_cache_path).
fauxrep
fauxrep2
fauxrep_aux
generate_empty_sector_update_proof
generate_empty_sector_update_proof_with_vanilla
generate_fallback_sector_challenges
Generates the challenges per SectorId required for either a Window proof-of-spacetime or a Winning proof-of-spacetime.
generate_partition_proofs
Generate all vanilla partition proofs across all partitions.
generate_piece_commitment
Generates a piece commitment for the provided byte source. Returns an error if the byte source produced more than piece_size bytes.
generate_single_partition_proof
Generate a single vanilla partition proof for a specified partition.
generate_single_vanilla_proof
Generates a single vanilla proof required for either Window proof-of-spacetime or Winning proof-of-spacetime.
generate_single_window_post_with_vanilla
Generates a Window proof-of-spacetime with provided vanilla proofs of a single partition.
generate_synth_proofs
generate_tree_c
Generate the merkle tree on top of the labels (TreeC).
generate_tree_r_last
Generate the merkle tree on top of the replica (TreeRLast).
generate_window_post
Generates a Window proof-of-spacetime.
generate_window_post_with_vanilla
Generates a Window proof-of-spacetime with provided vanilla proofs.
generate_winning_post
Generates a Winning proof-of-spacetime.
generate_winning_post_sector_challenge
Given some randomness and the length of available sectors, generates the challenged sector.
generate_winning_post_with_vanilla
Generates a Winning proof-of-spacetime with provided vanilla proofs.
get_base_tree_leafs
get_base_tree_size
get_num_partition_for_fallback_post
get_seal_inputs
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.
get_sector_update_h_select_from_porep_config
get_sector_update_inputs
Given the specified arguments, this method returns the inputs that were used to generate the sector update proof. This can be useful for proof aggregation, as verification requires these inputs.
get_unsealed_range
Unseals the sector at sealed_path and returns the bytes for a piece whose first (unpadded) byte begins at offset and ends at offset plus num_bytes, inclusive. Note that the entire sector is unsealed each time this function is called.
merge_window_post_partition_proofs
partition_count
partition_vanilla_proofs
remove_encoded_data
Removes encoded data and outputs the sector key.
sdr
seal_commit_phase1
seal_commit_phase2
seal_commit_phase1_inner
seal_commit_phase2_circuit_proofs
This new API is added and made public specifically for generating NonInteractive PoRep proofs that will later be aggregated using the existing aggregate_seal_commit_proofs method. It is also used internally outside of the NonInteractivePoRep use-case to avoid code duplication.
seal_pre_commit_phase1
seal_pre_commit_phase2
single_partition_vanilla_proofs
unseal_range
Unseals the sector read from sealed_sector and returns the bytes for a piece whose first (unpadded) byte begins at offset and ends at offset plus num_bytes, inclusive. Note that the entire sector is unsealed each time this function is called.
unseal_range_mapped
Unseals the sector read from sealed_sector and returns the bytes for a piece whose first (unpadded) byte begins at offset and ends at offset plus num_bytes, inclusive. Note that the entire sector is unsealed each time this function is called.
validate_cache_for_commit
validate_cache_for_precommit_phase2
verify_aggregate_seal_commit_proofs
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_aggregate_sector_update_proofs
verify_batch_seal
Verifies a batch of outputs of some previously-run seal operations.
verify_empty_sector_update_proof
verify_partition_proofs
Verify all vanilla partition proofs across all partitions.
verify_seal
Verifies the output of some previously-run seal operation.
verify_single_partition_proof
Verify a single vanilla partition proof for a specified partition.
verify_window_post
Verifies a window proof-of-spacetime.
verify_winning_post
Verifies a winning proof-of-spacetime.
write_and_preprocess
Writes bytes from source to target, adding bit-padding (“preprocessing”) as needed. Returns a tuple containing the number of bytes written to target and the commitment.

Type Aliases§

TreeRHasher