Home GnuPG

More optimized CRC implementations
06e122baa332Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

More optimized CRC implementations

* cipher/crc.c (crc32_table, crc24_table): Replace with new table
contents.
(update_crc32, CRC24_INIT, CRC24_POLY): Remove.
(crc32_next, crc32_next4, crc24_init, crc24_next, crc24_next4)
(crc24_final): New.
(crc24rfc2440_init): Use crc24_init.
(crc32_write): Rewrite to use crc32_next & crc32_next4.
(crc24_write): Rewrite to use crc24_next & crc24_next4.
(crc32_final, crc32rfc1510_final): Use buf_put_be32.
(crc24rfc2440_final): Use crc24_final & buf_put_le32.
* tests/basic.c (check_digests): Add CRC "123456789" tests.

Patch adds more optimized CRC implementations generated with universal_crc
tool by Danjel McGougan: http://www.mcgougan.se/universal_crc/

Benchmark on Intel Haswell (no-turbo, 3200 Mhz):

Before:
CRC32 | 2.52 ns/B 378.3 MiB/s 8.07 c/B
CRC32RFC1510 | 2.52 ns/B 378.1 MiB/s 8.07 c/B
CRC24RFC2440 | 46.62 ns/B 20.46 MiB/s 149.2 c/B

After:
CRC32 | 0.918 ns/B 1039.3 MiB/s 2.94 c/B
CRC32RFC1510 | 0.918 ns/B 1039.0 MiB/s 2.94 c/B
CRC24RFC2440 | 0.918 ns/B 1039.4 MiB/s 2.94 c/B

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on May 2 2015, 11:34 PM
Parents
rC66129b3334a5: Enable AMD64 AES implementation for WIN64
Branches
Unknown
Tags
Unknown

Event Timeline

Jussi Kivilinna <jussi.kivilinna@iki.fi> committed rC06e122baa332: More optimized CRC implementations (authored by Jussi Kivilinna <jussi.kivilinna@iki.fi>).May 2 2015, 11:34 PM