Skip to content

Commit 8522104

Browse files
committed
crypto: crct10dif - remove from crypto API
Remove the "crct10dif" shash algorithm from the crypto API. It has no known user now that the lib is no longer built on top of it. It has no remaining references in kernel code. The only other potential users would be the usual components that allow specifying arbitrary hash algorithms by name, namely AF_ALG and dm-integrity. However there are no indications that "crct10dif" is being used with these components. Debian Code Search and web searches don't find anything relevant, and explicitly grepping the source code of the usual suspects (cryptsetup, libell, iwd) finds no matches either. "crc32" and "crc32c" are used in a few more places, but that doesn't seem to be the case for "crct10dif". crc_t10dif_update() is also tested by crc_kunit now, so the test coverage provided via the crypto self-tests is no longer needed. Also note that the "crct10dif" shash algorithm was inconsistent with the rest of the shash API in that it wrote the digest in CPU endianness, making the resulting byte array differ on little endian vs. big endian platforms. This means it was effectively just built for use by the lib functions, and it was not actually correct to treat it as "just another hash function" that could be dropped in via the shash API. Reviewed-by: Ard Biesheuvel <[email protected]> Reviewed-by: "Martin K. Petersen" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 68ea3c2 commit 8522104

File tree

11 files changed

+0
-489
lines changed

11 files changed

+0
-489
lines changed

arch/mips/configs/decstation_64_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ CONFIG_CRYPTO_XTS=m
180180
CONFIG_CRYPTO_CMAC=m
181181
CONFIG_CRYPTO_XCBC=m
182182
CONFIG_CRYPTO_CRC32=m
183-
CONFIG_CRYPTO_CRCT10DIF=m
184183
CONFIG_CRYPTO_MD4=m
185184
CONFIG_CRYPTO_MICHAEL_MIC=m
186185
CONFIG_CRYPTO_RMD160=m

arch/mips/configs/decstation_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ CONFIG_CRYPTO_XTS=m
175175
CONFIG_CRYPTO_CMAC=m
176176
CONFIG_CRYPTO_XCBC=m
177177
CONFIG_CRYPTO_CRC32=m
178-
CONFIG_CRYPTO_CRCT10DIF=m
179178
CONFIG_CRYPTO_MD4=m
180179
CONFIG_CRYPTO_MICHAEL_MIC=m
181180
CONFIG_CRYPTO_RMD160=m

arch/mips/configs/decstation_r4k_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ CONFIG_CRYPTO_XTS=m
175175
CONFIG_CRYPTO_CMAC=m
176176
CONFIG_CRYPTO_XCBC=m
177177
CONFIG_CRYPTO_CRC32=m
178-
CONFIG_CRYPTO_CRCT10DIF=m
179178
CONFIG_CRYPTO_MD4=m
180179
CONFIG_CRYPTO_MICHAEL_MIC=m
181180
CONFIG_CRYPTO_RMD160=m

crypto/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,15 +1081,6 @@ config CRYPTO_CRC32
10811081

10821082
Used by RoCEv2 and f2fs.
10831083

1084-
config CRYPTO_CRCT10DIF
1085-
tristate "CRCT10DIF"
1086-
select CRYPTO_HASH
1087-
select CRC_T10DIF
1088-
help
1089-
CRC16 CRC algorithm used for the T10 (SCSI) Data Integrity Field (DIF)
1090-
1091-
CRC algorithm used by the SCSI Block Commands standard.
1092-
10931084
endmenu
10941085

10951086
menu "Compression"

crypto/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ obj-$(CONFIG_CRYPTO_CRC32C) += crc32c_generic.o
155155
obj-$(CONFIG_CRYPTO_CRC32) += crc32_generic.o
156156
CFLAGS_crc32c_generic.o += -DARCH=$(ARCH)
157157
CFLAGS_crc32_generic.o += -DARCH=$(ARCH)
158-
obj-$(CONFIG_CRYPTO_CRCT10DIF) += crct10dif_generic.o
159-
CFLAGS_crct10dif_generic.o += -DARCH=$(ARCH)
160158
obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o
161159
obj-$(CONFIG_CRYPTO_LZO) += lzo.o lzo-rle.o
162160
obj-$(CONFIG_CRYPTO_LZ4) += lz4.o

crypto/crct10dif_generic.c

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

crypto/tcrypt.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,10 +1654,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
16541654
ret = min(ret, tcrypt_test("ghash"));
16551655
break;
16561656

1657-
case 47:
1658-
ret = min(ret, tcrypt_test("crct10dif"));
1659-
break;
1660-
16611657
case 48:
16621658
ret = min(ret, tcrypt_test("sha3-224"));
16631659
break;
@@ -2272,10 +2268,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
22722268
test_hash_speed("crc32c", sec, generic_hash_speed_template);
22732269
if (mode > 300 && mode < 400) break;
22742270
fallthrough;
2275-
case 320:
2276-
test_hash_speed("crct10dif", sec, generic_hash_speed_template);
2277-
if (mode > 300 && mode < 400) break;
2278-
fallthrough;
22792271
case 321:
22802272
test_hash_speed("poly1305", sec, poly1305_speed_template);
22812273
if (mode > 300 && mode < 400) break;

crypto/testmgr.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4759,13 +4759,6 @@ static const struct alg_test_desc alg_test_descs[] = {
47594759
.suite = {
47604760
.hash = __VECS(crc32c_tv_template)
47614761
}
4762-
}, {
4763-
.alg = "crct10dif",
4764-
.test = alg_test_hash,
4765-
.fips_allowed = 1,
4766-
.suite = {
4767-
.hash = __VECS(crct10dif_tv_template)
4768-
}
47694762
}, {
47704763
.alg = "ctr(aes)",
47714764
.test = alg_test_skcipher,

0 commit comments

Comments
 (0)