/src/zlib-ng/arch/x86/crc32_pclmulqdq.c
Line | Count | Source |
1 | | /* |
2 | | * Compute the CRC32 using a parallelized folding approach with the PCLMULQDQ |
3 | | * instruction. |
4 | | * |
5 | | * A white paper describing this algorithm can be found at: |
6 | | * doc/crc-pclmulqdq.pdf |
7 | | * |
8 | | * Copyright (C) 2013 Intel Corporation. All rights reserved. |
9 | | * Copyright (C) 2016 Marian Beermann (support for initial value) |
10 | | * Authors: |
11 | | * Wajdi Feghali <wajdi.k.feghali@intel.com> |
12 | | * Jim Guilford <james.guilford@intel.com> |
13 | | * Vinodh Gopal <vinodh.gopal@intel.com> |
14 | | * Erdinc Ozturk <erdinc.ozturk@intel.com> |
15 | | * Jim Kukunas <james.t.kukunas@linux.intel.com> |
16 | | * |
17 | | * For conditions of distribution and use, see copyright notice in zlib.h |
18 | | */ |
19 | | |
20 | | #ifdef X86_PCLMULQDQ_CRC |
21 | | |
22 | | #include "crc32_pclmulqdq_tpl.h" |
23 | | |
24 | 4.85M | Z_INTERNAL uint32_t crc32_pclmulqdq(uint32_t crc, const uint8_t *buf, size_t len) { |
25 | 4.85M | return crc32_copy_impl(crc, NULL, buf, len, 0); |
26 | 4.85M | } |
27 | | |
28 | 0 | Z_INTERNAL uint32_t crc32_copy_pclmulqdq(uint32_t crc, uint8_t *dst, const uint8_t *src, size_t len) { |
29 | 0 | return crc32_copy_impl(crc, dst, src, len, 1); |
30 | 0 | } |
31 | | #endif |