OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 syntax = "proto2"; | 5 syntax = "proto2"; |
6 | 6 |
7 option optimize_for = LITE_RUNTIME; | 7 option optimize_for = LITE_RUNTIME; |
8 | 8 |
9 package safe_browsing; | 9 package safe_browsing; |
10 | 10 |
11 // Everything below this comment was copied from the page | 11 // Everything below this comment was copied from the page |
12 // <https://devsite.googleplex.com/safe-browsing/developers_guide_v3> , | 12 // <https://developers.google.com/safe-browsing/developers_guide_v3>, |
13 // section "HTTP Response for Data" under "Response Body". | 13 // section "HTTP Response for Data" under "Response Body". |
14 | 14 |
15 // Chunk data encoding format for the shavar-proto list format. | 15 // Chunk data encoding format for the shavar-proto list format. |
16 message ChunkData { | 16 message ChunkData { |
17 required int32 chunk_number = 1; | 17 required int32 chunk_number = 1; |
18 | 18 |
19 // The chunk type is either an add or sub chunk. | 19 // The chunk type is either an add or sub chunk. |
20 enum ChunkType { | 20 enum ChunkType { |
21 ADD = 0; | 21 ADD = 0; |
22 SUB = 1; | 22 SUB = 1; |
23 } | 23 } |
24 optional ChunkType chunk_type = 2 [default = ADD]; | 24 optional ChunkType chunk_type = 2 [default = ADD]; |
25 | 25 |
26 // Prefix type which currently is either 4B or 32B. The default is set | 26 // Prefix type which currently is either 4B or 32B. The default is set |
27 // to the prefix length, so it doesn't have to be set at all for most | 27 // to the prefix length, so it doesn't have to be set at all for most |
28 // chunks. | 28 // chunks. |
29 enum PrefixType { | 29 enum PrefixType { |
30 PREFIX_4B = 0; | 30 PREFIX_4B = 0; |
31 FULL_32B = 1; | 31 FULL_32B = 1; |
32 } | 32 } |
33 optional PrefixType prefix_type = 3 [default = PREFIX_4B]; | 33 optional PrefixType prefix_type = 3 [default = PREFIX_4B]; |
34 // Stores all SHA256 add or sub prefixes or full-length hashes. The number | 34 // Stores all SHA256 add or sub prefixes or full-length hashes. The number |
35 // of hashes can be inferred from the length of the hashes string and the | 35 // of hashes can be inferred from the length of the hashes string and the |
36 // prefix type above. | 36 // prefix type above. |
37 optional bytes hashes = 4; | 37 optional bytes hashes = 4; |
38 | 38 |
39 // Sub chunks also encode one add chunk number for every hash stored above. | 39 // Sub chunks also encode one add chunk number for every hash stored above. |
40 repeated int32 add_numbers = 5 [packed = true]; | 40 repeated int32 add_numbers = 5 [packed = true]; |
41 } | 41 } |
OLD | NEW |