Messages in this thread | | | Date | Tue, 22 Mar 2005 19:28:17 +0000 (GMT) | From | "Artem B. Bityuckiy" <> | Subject | [QUESTION] omit adler32 in zlib |
| |
Hello,
zlib deflate generates an adler32 checksum for the input uncompressed data. In order to gain some drop of performance we would like not to generate/check adler32 because we anyway protect our data by much stronger CRC32.
How to correctly do that?
My quick investigation has shown that it is possible if I pass the a negative windowBits parameter to the deflateInit2() function to achieve the goal. But this feature isn't noted in the deflate API description (include/linux/zlib.h) and is called "undocumented feature" in lib/zlib_deflate/deflate.c.
So the question is: is it OK to use this undocumented feature? What are alternatives?
I also noted that if I use deflate via crypto API, I'll get what I want since it does:
#define DEFLATE_DEF_WINBITS 11 ret = zlib_deflateInit2(stream, DEFLATE_DEF_LEVEL, Z_DEFLATED, -DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL, Z_DEFAULT_STRATEGY);
(note the "minus" character before DEFLATE_DEF_WINBITS)
I'm curious why crypto API omits adler32 by default?
Thanks.
-- Best Regards, Artem B. Bityuckiy, St.-Petersburg, Russia. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |