I think the FAQ point is trying to highlight that the GZIP format as-is was designed for single file compression (a "compress" replacement). So therefore the extra tiny header at the start of the GZIP data that you find in *.gz files is not necessary for zlib and streaming compressors. Also since a streaming compressor might not have an endpoint and in many application the use of checksum is not required and would increase the data length (defeating the point of a streaming compressor) they decided to remove that from each chunk sent.


You can observe the changes to the filename in the header by:

gzip somefile

compared to:

cat somefile | gzip > somefile.gz

Compare the two resulting files, the differences are in the filename encoded into this GZIP header, but this header actually has nothing to do with the compression algorithm. It is like a small piece of data tacked onto the front of the data, it has a magic number in it to aid format detection.


The important point to remember is the common ground is the compression algorithm. zlib is the reuse of the mathematical algorithm used in GZIP but adapted for streaming compression use.


I have to now ask, how are you using the raw/original/verbatim GZIP single file compression algorithm with SSL ? Who has somehow bolted that in without using zlib ? You might consider zlib to be the defacto standard for how to apply the gzip algorithm to a stream.


There are other matters that zlib addresses such as ensuring a way to force a symbol flush on any arbitrary bit boundary. That is a LZW like compressed stream usually ends up as a bunch of odd-sized symbols (5 bit, 6 bit, 7 bit, etc... upto maybe 15 bit) i.e. not the nice modulus 8 bits that computers need to send over the network. So any streaming compressor needs the ability to flush the data to the sender, often a special reserved symbol number is used followed by zero of more bits of padding (to make it into a nice modulus 8 bit length). This is the kind of thing zlib adds to the stream that is not catered for in the plain compression algorithm.

Since it is using a symbol to do it, it can actually be performed in a compatible way, you just reserve a symbol value for this purpose.


Darryl
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to