Function filecoin_proofs::unseal_range
source · pub fn unseal_range<P, R, W, Tree>(
porep_config: &PoRepConfig,
cache_path: P,
sealed_sector: R,
unsealed_output: W,
prover_id: ProverId,
sector_id: SectorId,
comm_d: Commitment,
ticket: Ticket,
offset: UnpaddedByteIndex,
num_bytes: UnpaddedBytesAmount,
) -> Result<UnpaddedBytesAmount>
Expand description
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.
§Arguments
porep_config
- porep configuration containing the sector size.cache_path
- path to the directory in which the sector data’s Merkle Tree is written.sealed_sector
- a byte source from which we read sealed sector data.unsealed_output
- a byte sink to which we write unsealed, un-bit-padded sector bytes.prover_id
- the prover-id that sealed the sector.sector_id
- the sector-id of the sealed sector.comm_d
- the commitment to the sector’s data.ticket
- the ticket that was used to generate the sector’s replica-id.offset
- the byte index in the unsealed sector of the first byte that we want to read.num_bytes
- the number of bytes that we want to read.