Re: [RFC] CryptoAPI & Compression

Artem B. Bityuckiy
2005-04-01T15:42:55Z

> I thought stored blocks (incompressible blocks) were limited to 64K
> in size, no?
Blocks are limited in size by 64K, true. But why it matters for us?

Suppose we compress 1 GiB of input, and have a 70K output buffer. We
reserve 5 bytes at the end and start calling zlib_deflate(stream,
Z_SYNCK_FLUSH) recurrently. It puts one 64K block, puts its end marker,
then puts a part of a second block. Then we call zlib_deflate(strem,
Z_FINISH) and it puts the end marker of the second block and the adler32
checksum of the entire stream. So I don't see any problem albeit I didn't
try yet :-) But I'll do.

> Please double check zlib_deflate/deflate.c and
> zlib_deflate/deftree.c.
Surely I'll check. I'll even test the new implementation (which I didn't
actually do) with a large input before sending it next time.