Crate filecoin_proofs[][src]

Re-exports

pub use constants::*;
pub use types::*;

Modules

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.

as_safe_commitment
clear_cache
clear_caches
commitment_from_fr
compute_comm_d

Computes a sectors’s comm_d given its pieces.

fauxrep
fauxrep2
fauxrep_aux
generate_fallback_sector_challenges

Generates the challenges per SectorId required for either a Window proof-of-spacetime or a Winning proof-of-spacetime.

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_vanilla_proof

Generates a single vanilla proof required for either Window proof-of-spacetime or Winning proof-of-spacetime.

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_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.

partition_vanilla_proofs
seal_commit_phase1
seal_commit_phase2
seal_pre_commit_phase1
seal_pre_commit_phase2
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_batch_seal

Verifies a batch of outputs of some previously-run seal operations.

verify_seal

Verifies the output of some previously-run seal operation.

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.