Skip to content

Commit 55d1ecc

Browse files
committed
x86/crc32: expose CRC32 functions through lib
Move the x86 CRC32 assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all the arch-specific "shash" code becomes unnecessary and is removed. Reviewed-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 1e6b72e commit 55d1ecc

File tree

10 files changed

+129
-481
lines changed

10 files changed

+129
-481
lines changed

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ config X86
7676
select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
7777
select ARCH_HAS_CPU_FINALIZE_INIT
7878
select ARCH_HAS_CPU_PASID if IOMMU_SVA
79+
select ARCH_HAS_CRC32
7980
select ARCH_HAS_CURRENT_STACK_POINTER
8081
select ARCH_HAS_DEBUG_VIRTUAL
8182
select ARCH_HAS_DEBUG_VM_PGTABLE if !X86_PAE

arch/x86/crypto/Kconfig

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -492,28 +492,6 @@ config CRYPTO_GHASH_CLMUL_NI_INTEL
492492
Architecture: x86_64 using:
493493
- CLMUL-NI (carry-less multiplication new instructions)
494494

495-
config CRYPTO_CRC32C_INTEL
496-
tristate "CRC32c (SSE4.2/PCLMULQDQ)"
497-
depends on X86
498-
select CRYPTO_HASH
499-
help
500-
CRC32c CRC algorithm with the iSCSI polynomial (RFC 3385 and RFC 3720)
501-
502-
Architecture: x86 (32-bit and 64-bit) using:
503-
- SSE4.2 (Streaming SIMD Extensions 4.2) CRC32 instruction
504-
- PCLMULQDQ (carry-less multiplication)
505-
506-
config CRYPTO_CRC32_PCLMUL
507-
tristate "CRC32 (PCLMULQDQ)"
508-
depends on X86
509-
select CRYPTO_HASH
510-
select CRC32
511-
help
512-
CRC32 CRC algorithm (IEEE 802.3)
513-
514-
Architecture: x86 (32-bit and 64-bit) using:
515-
- PCLMULQDQ (carry-less multiplication)
516-
517495
config CRYPTO_CRCT10DIF_PCLMUL
518496
tristate "CRCT10DIF (PCLMULQDQ)"
519497
depends on X86 && 64BIT && CRC_T10DIF

arch/x86/crypto/Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
7575
obj-$(CONFIG_CRYPTO_POLYVAL_CLMUL_NI) += polyval-clmulni.o
7676
polyval-clmulni-y := polyval-clmulni_asm.o polyval-clmulni_glue.o
7777

78-
obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o
79-
crc32c-intel-y := crc32c-intel_glue.o
80-
crc32c-intel-$(CONFIG_64BIT) += crc32c-pcl-intel-asm_64.o
81-
82-
obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o
83-
crc32-pclmul-y := crc32-pclmul_asm.o crc32-pclmul_glue.o
84-
8578
obj-$(CONFIG_CRYPTO_CRCT10DIF_PCLMUL) += crct10dif-pclmul.o
8679
crct10dif-pclmul-y := crct10dif-pcl-asm_64.o crct10dif-pclmul_glue.o
8780

arch/x86/crypto/crc32-pclmul_glue.c

Lines changed: 0 additions & 202 deletions
This file was deleted.

0 commit comments

Comments
 (0)