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 3// found in the LICENSE file. 4 5syntax = "proto2"; 6 7option optimize_for = LITE_RUNTIME; 8 9package safe_browsing; 10 11// Everything below this comment was copied from the page 12// <https://developers.google.com/safe-browsing/developers_guide_v3>, 13// section "HTTP Response for Data" under "Response Body". 14 15// Chunk data encoding format for the shavar-proto list format. 16message ChunkData { 17 required int32 chunk_number = 1; 18 19 // The chunk type is either an add or sub chunk. 20 enum ChunkType { 21 ADD = 0; 22 SUB = 1; 23 } 24 optional ChunkType chunk_type = 2 [default = ADD]; 25 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 28 // chunks. 29 enum PrefixType { 30 PREFIX_4B = 0; 31 FULL_32B = 1; 32 } 33 optional PrefixType prefix_type = 3 [default = PREFIX_4B]; 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 36 // prefix type above. 37 optional bytes hashes = 4; 38 39 // Sub chunks also encode one add chunk number for every hash stored above. 40 repeated int32 add_numbers = 5 [packed = true]; 41} 42