[QUESTION] omit adler32 in zlib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux