pub fn encode_verified_range(
root: [u8; 32],
aligned: &AlignedRange,
range_data: &[u8],
outboard: Bytes,
) -> Result<Bytes, RangeVerifyError>Expand description
Verify range_data (covering aligned.fetch_start..aligned.fetch_end) and
the supplied pre-order outboard against the wanted root root, returning
the bao interleaved encoding for aligned.chunk_ranges — ready for
Blobs::import_bao_bytes(root, aligned.chunk_ranges, _).
The outboard is untrusted: verification anchors every chunk group to root,
so a tampered range, a foreign/tampered outboard, or a wrong root all fail
with RangeVerifyError::Verification — there is no trusted-origin path.
§Errors
RangeVerifyError::RangeDataSizeifrange_datais not exactlyaligned.fetch_len()bytes (a corrupt/extra or truncated origin 206 body).RangeVerifyError::OutboardSizeifoutboardis the wrong length for the aligned range’s blob size (aligned.blob_size()).RangeVerifyError::Verificationif the range/outboard do not verify againstroot.