On Sun, May 06, 2001 at 02:19:48AM -0400, Tavin Cole wrote: > > DOCUMENT STRUCTURE: > > The document is encrypted and interleaved with the progressive hash > control bytes. Its length must be a power of 2 _prior_ to the addition > of the control bytes. > > The Document-header Storable is a hex-encoding of an encrypted byte > array, ZERO padded to power of 2 length, composed of: > > <2 bytes: crypto key length> > <crypto key> > <2 bytes: length of metadata-length field> > <metadata-length> > > The idea is that in the future we can add additional fields with a > 2-byte length marker for each.
Doh! Since we're padding the document out to a power of 2 (presumably with zeroes ??), we need a way for the client to know the real length of the data. So the Document-header should actually be: <2 bytes: crypto key length> <crypto key> <2 bytes: length of real-data-length field> <real-data-length (including metadata)> <2 bytes: length of metadata-length field> <metadata-length> -- # tavin cole # # "The process of scientific discovery is, in effect, # a continual flight from wonder." # - Albert Einstein _______________________________________________ Devl mailing list Devl at freenetproject.org http://lists.freenetproject.org/mailman/listinfo/devl
