summaryrefslogtreecommitdiff
path: root/crc32.c
AgeCommit message (Collapse)Author
2020-11-22Separate crc32 and crc32_combine tables so the crc32_combine tables are not ↵Nathan Moinvaziri
included when not used if statically linking. Reduces code size by 4k.
2020-08-31Rename ZEXPORT and ZEXTERN for consistency.Nathan Moinvaziri
2020-08-31Rename ZLIB_INTERNAL to Z_INTERNAL for consistency.Nathan Moinvaziri
2020-08-31Rename ZLIB_REGISTER to Z_REGISTER for consistency.Nathan Moinvaziri
2020-08-27Rename table headers with tbl suffix.Nathan Moinvaziri
2020-08-14Style cleanup.Mika Lindqvist
* Remove space between function name and opening parenthesis * Remove space closing parenthesis of cast and variable name
2020-08-14Fix signature of crc32_combine(), crc32_combine64() and crc32_z() in compat ↵Mika Lindqvist
mode.
2020-06-28Added ZLIB_REGISTER to disable register keyword for C++.Nathan Moinvaziri
Co-authored-by: pps83 <pps83@users.noreply.github.com>
2020-06-08For gzseek, gzoffset, gzopen, adler32_combine, crc32_combine and ↵Nathan Moinvaziri
crc32_combine_gen, export 32-bit and 64-bit versions for zlib-compatible api and only 64-bit version (without 64 suffix) for zlib-ng native api.
2020-05-01Standardize fill_window implementations and abstract out slide_hash_neon for ↵Nathan Moinvaziri
ARM.
2020-03-17Remove cvs keywordsPavel P
2020-02-07Fixed formatting, 4 spaces for code intent, 2 spaces for preprocessor ↵Nathan Moinvaziri
indent, initial function brace on the same line as definition, removed extraneous spaces and new lines.
2019-11-26Compatibility fix for crc32()Mika Lindqvist
* Use "unsigned long" externally instead of "uint32_t" for crc * Use "unsigned int" externally instead of "uint32_t" for len Fixes #483
2019-09-20Add makecrct test and clean up makecrct.c codeHans Kristian Rosbach
Update crc32.h tables to match makecrct output.
2019-09-20Split crc table generating code (MAKECRCH) out into separate tool makecrct.Hans Kristian Rosbach
2019-08-06Rename gzendian to zendian since it is included in more than just the gzip ↵Nathan Moinvaziri
library code.
2019-05-29Fix build when DYNAMIC_CRC_TABLE is defined.Mika T. Lindqvist
2019-01-31cleanup: move code from arch/x86/crc_pclmulqdq.c to crc32.cSebastian Pop
2019-01-21Replace the UNROLL_LESS define with UNROLL_MORE, making UNROLL_LESS the default.Hans Kristian Rosbach
Performance benchmarks have so far not shown that any platform benefits from UNROLL_MORE, although this might be beneficial on older compilers/cpus or for compiling without optimizations. The extra UNROLL_MORE code should be considered for removal since it is never enabled by us and will likely only serve to confuse and contribute to bitrot.
2018-12-08Add crc32_combine_gen() and crc32_combine_op() for fast combines.Mark Adler
When the same len2 is used repeatedly, it is faster to use crc32_combine_gen() to generate an operator, that is then used to combine CRCs with crc32_combine_op().
2018-12-08Add tables for crc32_combine(), to speed it up by a factor of 200.Mark Adler
2018-03-22Move private defines from zconf.h and zconf-ng.h to zbuild.hMika Lindqvist
* move definition of z_size_t to zbuild.h
2018-02-16wrap crc32 in functable (#145)Daniel Black
* wrap crc32 in functable * change internal crc32 api to use uint64_t rather than size_t for length
2018-01-31Adapt code to support PREFIX macros and update build scriptsMika Lindqvist
2018-01-31Add function prefix (zng_) to all exported functions to allow zlib-ngHans Kristian Rosbach
to co-exist in an application that has been linked to something that depends on stock zlib. Previously, that would cause random problems since there is no way to guarantee what zlib version is being used for each dynamically linked function. Add the corresponding zlib-ng.h. Tests, example and minigzip will not compile before they have been adapted to use the correct functions as well. Either duplicate them, so we have minigzip-ng.c for example, or add compile-time detection in the source code.
2017-03-24Add initial support for AARCH64.Mika Lindqvist
2017-03-24Add support for ARM ACLE instructions.Mika Lindqvist
2017-02-13Replace remaining Z_NULL instances with NULL.Mika Lindqvist
2017-02-13Move instruction set specific crc32 code to arch directories.Mika Lindqvist
2017-02-09zlib 1.2.9Mark Adler
2017-02-09Add crc32_z() and adler32_z() functions with size_t lengths.Mark Adler
2017-01-31Note the violation of the strict aliasing rule in crc32.c.Mark Adler
See the comment for more details. This is in response to an issue raised as a result of a security audit of the zlib code by Trail of Bits and TrustInSoft, in support of the Mozilla Foundation.
2017-01-31Avoid pre-decrement of pointer in big-endian CRC calculation.Mark Adler
There was a small optimization for PowerPCs to pre-increment a pointer when accessing a word, instead of post-incrementing. This required prefacing the loop with a decrement of the pointer, possibly pointing before the object passed. This is not compliant with the C standard, for which decrementing a pointer before its allocated memory is undefined. When tested on a modern PowerPC with a modern compiler, the optimization no longer has any effect. Due to all that, and per the recommendation of a security audit of the zlib code by Trail of Bits and TrustInSoft, in support of the Mozilla Foundation, this "optimization" was removed, in order to avoid the possibility of undefined behavior.
2017-01-31Replace Z_NULL with NULL. Fix incorrect uses of NULL/Z_NULL.Mika Lindqvist
2016-04-28Fix endianness-detection code on Solaris 11.Evan Nemerson
Solaris doesn't have sys/endian.h or endian.h, it has sys/byteorder.h, which doesn't define BYTE_ORDER, it defines either _LITTLE_ENDIAN or _BIG_ENDIAN.
2016-04-28Fix spelling of __DragonFly__ in crc32.c, found by @nemequHans Kristian Rosbach
2015-12-14Type cleanup.Mika Lindqvist
2015-11-25Fix compilation on BSDEvan Nemerson
The endianness functions are in <sys/endian.h>, not <endian.h> as they are in Linux.
2015-06-10Allow building on OS XRené J.V. Bertin
2015-05-25Style cleanup for adler/crc codeHans Kristian Rosbach
2015-05-23Update remaining function prototypes to ANSI C standardHans Kristian Rosbach
2015-05-17Kill Byte and BytefDaniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net> Conflicts: adler32.c compress.c deflate.c inflate.c match.c test/example.c uncompr.c zlib.h
2015-05-13Fix unnecessary type casts.Mika Lindqvist
2015-05-13Kill z_crc_tDaniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net> Conflicts: crc32.c
2015-05-13z_const -> constDaniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net> Conflicts: arch/x86/crc_folding.c crc32.c
2015-05-12Convert remaining K&R function declarations to ANSI-C declarations.Hans Kristian Rosbach
2015-05-12Minor cleanup of includefiles relating mostly to stdint.hHans Kristian Rosbach
2015-05-12Combine CRC32_UNROLL_LESS and ADLER32_UNROLL_LESS into UNROLL_LESSHans Kristian Rosbach
2015-05-11crc32: unsigned long -> uint32_tDaniel Axtens
Authored by Danial Axtens, plus merge fixups by Hans Kristian Rosbach. Conflicts: arch/x86/crc_folding.c crc32.c zlib.h zutil.h
2015-05-11crc32: local -> staticDaniel Axtens
Authored by Danial Axtens, with some minor merge fixups by Hans Kristian Rosbach. Conflicts: crc32.c