Skip to main content

hash_ciphertext_from

Function hash_ciphertext_from 

Source
pub fn hash_ciphertext_from<R: Read>(
    ciphertext: R,
) -> Result<(Hash32, u64), LifecycleError>
Expand description

The SHA-256 and length of the original ciphertext ciphertext yields, read one STREAM chunk at a time: the RemoteHead::original_ciphertext_hash for an original that is on disk rather than in memory, computed in memory bounded by one chunk whatever the original’s size.

The digest is of exactly the bytes read, so a head built from it vouches for those bytes: Workspace::apply_remote_head then checks it against the manifest’s content address as Workspace::apply_remote_entry checks the bytes themselves.

§Errors

LifecycleError::Io when ciphertext cannot be read.