blob: f1a3a36e55c740ecdedcad0118e6a5fd221cecb7 [file] [log] [blame]
Kelvin Zhang98001b22021-12-08 14:10:11 -08001//
2// Copyright (C) 2021 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17syntax = "proto3";
18
19package chromeos_update_engine;
20option optimize_for = LITE_RUNTIME;
21
22message CompressionAlgorithm {
23 enum Type {
24 UNCOMPRESSED = 0;
25 LZ4 = 1;
26 LZ4HC = 2;
27 }
28 Type type = 1;
29 int32 level = 2;
30}
31
32message CompressedBlockInfo {
33 // Require fields
34 uint64 uncompressed_offset = 1;
35 uint64 uncompressed_length = 2;
36 uint64 compressed_length = 3;
37
38 // optional SHA256 hash of re-compressed blob
39 bytes sha256_hash = 4;
40 // Patch to apply to re-compressed blob
41 bytes postfix_bspatch = 5;
42}
43
44enum InnerPatchType {
45 BSDIFF = 0;
46 PUFFDIFF = 1;
47}
48
49message CompressionInfo {
50 CompressionAlgorithm algo = 1;
51 repeated CompressedBlockInfo block_info = 2;
52 bool zero_padding_enabled = 3;
53}
54
55message Lz4diffHeader {
56 CompressionInfo src_info = 1;
57 CompressionInfo dst_info = 2;
58 InnerPatchType inner_type = 3;
59}