On Sun, Apr 6, 2014 at 2:34 AM, Andreas Schildbach < [email protected]> wrote:
> For our application, we chose a protobuf format without delimiting. We > thought the EOF that would occur when reading the file would suffice. (For > those interested: It's the Bitcoin wallet format for bitcoinj-based apps) > > Now I'd like to wrap it in an encryption layer. Unfortunately, the > encryption I want to use is a padding block cipher. That means after the > encrypt/decrypt roundtrip you'll end up with zero bytes appended to the > serialized protobuf. > > I know I could switch my serialization code to the readDelimitedFrom() and > writeDelimitedTo() pair, but that would make the format incompatible due to > the prepended varint length field. > > *Question:* Is it possible, either programmatically or by declaring it in > the .proto file, that a zero tag ends the deserialization just like an EOF > would do? > No. A zero tag means invalid protobuf wire format and the parsing code should throw an exception when it's met. > > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
