summaryrefslogtreecommitdiff
path: root/payload_consumer/file_descriptor_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'payload_consumer/file_descriptor_utils.h')
-rw-r--r--payload_consumer/file_descriptor_utils.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/payload_consumer/file_descriptor_utils.h b/payload_consumer/file_descriptor_utils.h
index d1289d6c..397c35e5 100644
--- a/payload_consumer/file_descriptor_utils.h
+++ b/payload_consumer/file_descriptor_utils.h
@@ -39,7 +39,17 @@ bool CopyAndHashExtents(
const google::protobuf::RepeatedPtrField<Extent>& src_extents,
FileDescriptorPtr target,
const google::protobuf::RepeatedPtrField<Extent>& tgt_extents,
- uint32_t block_size,
+ uint64_t block_size,
+ brillo::Blob* hash_out);
+
+// Reads blocks from |source| and caculates the hash. The blocks to read are
+// specified by |extents|. Stores the hash in |hash_out| if it is not null. The
+// block sizes are passed as |block_size|. In case of error reading, it returns
+// false and the value pointed by |hash_out| is undefined.
+bool ReadAndHashExtents(
+ FileDescriptorPtr source,
+ const google::protobuf::RepeatedPtrField<Extent>& extents,
+ uint64_t block_size,
brillo::Blob* hash_out);
} // namespace fd_utils