summaryrefslogtreecommitdiff
path: root/crc32.c
Commit message (Collapse)AuthorAgeFilesLines
* Provide missing function prototypes in CRC-32 code. [fredgan]Mark Adler2022-10-061-3/+12
|
* Fix some typos.Mark Adler2022-08-231-2/+2
| | | | No code changes.
* Fix odd error in Visual C compiler preventing automatic promotion.Mark Adler2022-06-041-2/+2
|
* Fix missing ZEXPORT for crc32_combine_op().Mark Adler2022-06-041-1/+1
|
* Correct incorrect inputs provided to the CRC functions.Mark Adler2022-03-301-4/+4
| | | | | | | The previous releases of zlib were not sensitive to incorrect CRC inputs with bits set above the low 32. This commit restores that behavior, so that applications with such bugs will continue to operate as before.
* zlib 1.2.12v1.2.12Mark Adler2022-03-271-1/+1
|
* Fix crc32.c to compile local functions only if used.Mark Adler2022-03-271-62/+64
|
* Fix error in comment on the polynomial representation of a byte.Mark Adler2019-07-091-1/+1
|
* Use ARM crc32 instructions if the ARM architecture has them.Mark Adler2019-02-171-3/+7
| | | | | | | The ARM crc32 instructions will be used only if an architecture is explicitly specified at compile time that has those instructions. For example, -march=armv8.1-a or -march=armv8-a+crc, or if the machine being compiled on has the instructions, -march=native.
* Add use of the ARMv8 crc32 instructions when requested.Mark Adler2019-02-171-0/+114
| | | | | | | | | | Define the macro Z_ARM_CRC32 at compile time to use the ARMv8 (aarch64) crc32x and crc32b instructions. This code does not check for the presence of the crc32 instructions. Those instructions are optional for ARMv8.0, though mandatory for ARMv8.1 and later. The use of the crc32 instructions is about ten times as fast as the software braided calculation of the CRC-32. This can noticeably speed up the decompression of gzip streams.
* Correct comment in crc32.c.Mark Adler2019-02-031-1/+2
|
* Use atomic test and set, if available, for dynamic CRC tables.Mark Adler2018-12-261-42/+112
|
* Speed up software CRC-32 computation by a factor of 1.5 to 3.Mark Adler2018-12-261-337/+733
| | | | | | | | Use the interleaved method of Kadatch and Jenkins in order to make use of pipelined instructions through multiple ALUs in a single core. This also speeds up and simplifies the combination of CRCs, and updates the functions to pre-calculate and use an operator for CRC combination.
* Add crc32_combine_gen() and crc32_combine_op() for fast combines.Mark Adler2018-11-041-0/+75
| | | | | | 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().
* Add tables for crc32_combine(), to speed it up by a factor of 200.Mark Adler2018-11-031-91/+103
|
* Avoid the use of ptrdiff_t.Mark Adler2017-06-031-3/+3
| | | | | | | | | | | | | | | | | This isn't the right type anyway to assure that it contains a pointer. That type would be intptr_t or uintptr_t. However the C99 standard says that those types are optional, so their use would not be portable. This commit simply uses size_t or whatever configure decided to use for size_t. That would be the same length as ptrdiff_t, and so will work just as well. The code checks to see if the length of the type used is the same as the length of a void pointer, so there is already protection against the use of the wrong type. The use of size_t (or ptrdiff_t) will almost always work, as all modern architectures have an array size that is the same as the pointer size. Only old segmented architectures would have to fall back to the slower CRC-32 calculation, where the amount of memory that can be accessed is larger than the maximum array size.
* zlib 1.2.9v1.2.9Mark Adler2016-12-311-1/+1
|
* Add crc32_z() and adler32_z() functions with size_t lengths.Mark Adler2016-12-311-6/+15
|
* Clean up and comment the use of local for static.Mark Adler2016-10-261-2/+0
|
* Note the violation of the strict aliasing rule in crc32.c.Mark Adler2016-10-031-0/+12
| | | | | | 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.
* Avoid pre-decrement of pointer in big-endian CRC calculation.Mark Adler2016-09-281-3/+1
| | | | | | | | | | | | | | 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.
* Fix type mismatch between get_crc_table() and crc_table.Mark Adler2012-04-291-45/+22
| | | | | | | | | | | | | crc_table is made using a four-byte integer (when that can be determined). However get_crc_table() returned a pointer to an unsigned long, which could be eight bytes. This fixes that by creating a new z_crc_t type for the crc_table. This type is also used for the BYFOUR crc calculations that depend on a four-byte type. The four-byte type can now be determined by ./configure, which also solves a problem where ./configure --solo would never use BYFOUR. No the Z_U4 #define indicates that four- byte integer was found either by ./configure or by zconf.h.
* zlib 1.2.6.1v1.2.6.1Mark Adler2012-02-121-1/+1
|
* Use optimized byte swap operations for Microsoft and GNU [Snyder].Mark Adler2012-02-111-6/+4
|
* Avoid library header include in crc32.c for Z_SOLO.Mark Adler2012-02-011-0/+3
| | | | | | | | | | | crc32.c was #including limits.h in order to find a four-byte integer type. It was doing this even if Z_SOLO were defined, violating the intent of Z_SOLO, which is to include no library headers and require no library functions. Now crc32.c obeys the intent of Z_SOLO, but with the downside that crc32() will be slower than when not compiled with Z_SOLO. This can be remedied manually by typedefing u4 to a known four-byte unsigned integer type, and #defining BYFOUR in crc32.c.
* zlib 1.2.5.1v1.2.5.1Mark Adler2011-09-111-13/+18
|
* zlib 1.2.5v1.2.5Mark Adler2011-09-091-1/+1
|
* zlib 1.2.4.1v1.2.4.1Mark Adler2011-09-091-1/+1
|
* zlib 1.2.3.4v1.2.3.4Mark Adler2011-09-091-25/+7
|
* zlib 1.2.3.3v1.2.3.3Mark Adler2011-09-091-2/+39
|
* zlib 1.2.2.4v1.2.2.4Mark Adler2011-09-091-4/+5
|
* zlib 1.2.2.3v1.2.2.3Mark Adler2011-09-091-3/+3
|
* zlib 1.2.2.2v1.2.2.2Mark Adler2011-09-091-1/+1
|
* zlib 1.2.2.1v1.2.2.1Mark Adler2011-09-091-3/+92
|
* zlib 1.2.2v1.2.2Mark Adler2011-09-091-46/+46
|
* zlib 1.2.1.2v1.2.1.2Mark Adler2011-09-091-28/+50
|
* zlib 1.2.0.5v1.2.0.5Mark Adler2011-09-091-8/+7
|
* zlib 1.2.0.4v1.2.0.4Mark Adler2011-09-091-1/+1
|
* zlib 1.2.0.2v1.2.0.2Mark Adler2011-09-091-12/+16
|
* zlib 1.2.0v1.2.0Mark Adler2011-09-091-102/+248
|
* zlib 1.1.4v1.1.4Mark Adler2011-09-091-1/+1
|
* zlib 1.0.9v1.0.9Mark Adler2011-09-091-2/+2
|
* zlib 1.0.8v1.0.8Mark Adler2011-09-091-4/+4
|
* zlib 1.0.7v1.0.7Mark Adler2011-09-091-4/+4
|
* zlib 1.0.1v1.0.1Mark Adler2011-09-091-10/+52
|
* zlib 1.0-prev1.0-preMark Adler2011-09-091-51/+9
|
* zlib 0.99v0.99Mark Adler2011-09-091-9/+51
|
* zlib 0.94v0.94Mark Adler2011-09-091-2/+2
|
* zlib 0.93v0.93Mark Adler2011-09-091-31/+38
|
* zlib 0.9v0.9Mark Adler2011-09-091-3/+13
|