diff options
Diffstat (limited to 'adb/client/incremental_utils.h')
-rw-r--r-- | adb/client/incremental_utils.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/adb/client/incremental_utils.h b/adb/client/incremental_utils.h index 8bcf6c081..d969d9412 100644 --- a/adb/client/incremental_utils.h +++ b/adb/client/incremental_utils.h @@ -16,11 +16,31 @@ #pragma once -#include <stdint.h> +#include "adb_unique_fd.h" #include <string> +#include <string_view> +#include <utility> #include <vector> +#include <stdint.h> + namespace incremental { -std::vector<int32_t> PriorityBlocksForFile(const std::string& filepath, int fd, int64_t fileSize); -} // namespace incremental
\ No newline at end of file + +using Size = int64_t; +constexpr int kBlockSize = 4096; +constexpr int kSha256DigestSize = 32; +constexpr int kDigestSize = kSha256DigestSize; + +constexpr std::string_view IDSIG = ".idsig"; + +std::vector<int32_t> PriorityBlocksForFile(const std::string& filepath, borrowed_fd fd, + Size fileSize); + +Size verity_tree_blocks_for_file(Size fileSize); +Size verity_tree_size_for_file(Size fileSize); + +std::pair<std::vector<char>, int32_t> read_id_sig_headers(borrowed_fd fd); +std::pair<off64_t, ssize_t> skip_id_sig_headers(borrowed_fd fd); + +} // namespace incremental |