| Kelvin Zhang | 98001b2 | 2021-12-08 14:10:11 -0800 | [diff] [blame] | 1 | // | 
|  | 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 |  | 
|  | 17 | syntax = "proto3"; | 
|  | 18 |  | 
|  | 19 | package chromeos_update_engine; | 
|  | 20 | option optimize_for = LITE_RUNTIME; | 
|  | 21 |  | 
|  | 22 | message CompressionAlgorithm { | 
|  | 23 | enum Type { | 
|  | 24 | UNCOMPRESSED = 0; | 
|  | 25 | LZ4 = 1; | 
|  | 26 | LZ4HC = 2; | 
|  | 27 | } | 
|  | 28 | Type type = 1; | 
|  | 29 | int32 level = 2; | 
|  | 30 | } | 
|  | 31 |  | 
|  | 32 | message 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 |  | 
|  | 44 | enum InnerPatchType { | 
|  | 45 | BSDIFF = 0; | 
|  | 46 | PUFFDIFF = 1; | 
|  | 47 | } | 
|  | 48 |  | 
|  | 49 | message CompressionInfo { | 
|  | 50 | CompressionAlgorithm algo = 1; | 
|  | 51 | repeated CompressedBlockInfo block_info = 2; | 
|  | 52 | bool zero_padding_enabled = 3; | 
|  | 53 | } | 
|  | 54 |  | 
|  | 55 | message Lz4diffHeader { | 
|  | 56 | CompressionInfo src_info = 1; | 
|  | 57 | CompressionInfo dst_info = 2; | 
|  | 58 | InnerPatchType inner_type = 3; | 
|  | 59 | } |