Skip to content

Commit b713375

Browse files
zx2c4kuba-moo
authored andcommitted
crypto: s390 - do not depend on CRYPTO_HW for SIMD implementations
Various accelerated software implementation Kconfig values for S390 were mistakenly placed into drivers/crypto/Kconfig, even though they're mainly just SIMD code and live in arch/s390/crypto/ like usual. This gives them the very unusual dependency on CRYPTO_HW, which leads to problems elsewhere. This patch fixes the issue by moving the Kconfig values for non-hardware drivers into the usual place in crypto/Kconfig. Acked-by: Herbert Xu <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b83fdcd commit b713375

File tree

2 files changed

+114
-115
lines changed

2 files changed

+114
-115
lines changed

crypto/Kconfig

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,18 @@ config CRYPTO_CRC32_MIPS
666666
CRC32c and CRC32 CRC algorithms implemented using mips crypto
667667
instructions, when available.
668668

669+
config CRYPTO_CRC32_S390
670+
tristate "CRC-32 algorithms"
671+
depends on S390
672+
select CRYPTO_HASH
673+
select CRC32
674+
help
675+
Select this option if you want to use hardware accelerated
676+
implementations of CRC algorithms. With this option, you
677+
can optimize the computation of CRC-32 (IEEE 802.3 Ethernet)
678+
and CRC-32C (Castagnoli).
679+
680+
It is available with IBM z13 or later.
669681

670682
config CRYPTO_XXHASH
671683
tristate "xxHash hash algorithm"
@@ -898,6 +910,16 @@ config CRYPTO_SHA512_SSSE3
898910
Extensions version 1 (AVX1), or Advanced Vector Extensions
899911
version 2 (AVX2) instructions, when available.
900912

913+
config CRYPTO_SHA512_S390
914+
tristate "SHA384 and SHA512 digest algorithm"
915+
depends on S390
916+
select CRYPTO_HASH
917+
help
918+
This is the s390 hardware accelerated implementation of the
919+
SHA512 secure hash standard.
920+
921+
It is available as of z10.
922+
901923
config CRYPTO_SHA1_OCTEON
902924
tristate "SHA1 digest algorithm (OCTEON)"
903925
depends on CPU_CAVIUM_OCTEON
@@ -930,6 +952,16 @@ config CRYPTO_SHA1_PPC_SPE
930952
SHA-1 secure hash standard (DFIPS 180-4) implemented
931953
using powerpc SPE SIMD instruction set.
932954

955+
config CRYPTO_SHA1_S390
956+
tristate "SHA1 digest algorithm"
957+
depends on S390
958+
select CRYPTO_HASH
959+
help
960+
This is the s390 hardware accelerated implementation of the
961+
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
962+
963+
It is available as of z990.
964+
933965
config CRYPTO_SHA256
934966
tristate "SHA224 and SHA256 digest algorithm"
935967
select CRYPTO_HASH
@@ -970,6 +1002,16 @@ config CRYPTO_SHA256_SPARC64
9701002
SHA-256 secure hash standard (DFIPS 180-2) implemented
9711003
using sparc64 crypto instructions, when available.
9721004

1005+
config CRYPTO_SHA256_S390
1006+
tristate "SHA256 digest algorithm"
1007+
depends on S390
1008+
select CRYPTO_HASH
1009+
help
1010+
This is the s390 hardware accelerated implementation of the
1011+
SHA256 secure hash standard (DFIPS 180-2).
1012+
1013+
It is available as of z9.
1014+
9731015
config CRYPTO_SHA512
9741016
tristate "SHA384 and SHA512 digest algorithms"
9751017
select CRYPTO_HASH
@@ -1010,6 +1052,26 @@ config CRYPTO_SHA3
10101052
References:
10111053
http://keccak.noekeon.org/
10121054

1055+
config CRYPTO_SHA3_256_S390
1056+
tristate "SHA3_224 and SHA3_256 digest algorithm"
1057+
depends on S390
1058+
select CRYPTO_HASH
1059+
help
1060+
This is the s390 hardware accelerated implementation of the
1061+
SHA3_256 secure hash standard.
1062+
1063+
It is available as of z14.
1064+
1065+
config CRYPTO_SHA3_512_S390
1066+
tristate "SHA3_384 and SHA3_512 digest algorithm"
1067+
depends on S390
1068+
select CRYPTO_HASH
1069+
help
1070+
This is the s390 hardware accelerated implementation of the
1071+
SHA3_512 secure hash standard.
1072+
1073+
It is available as of z14.
1074+
10131075
config CRYPTO_SM3
10141076
tristate
10151077

@@ -1070,6 +1132,16 @@ config CRYPTO_GHASH_CLMUL_NI_INTEL
10701132
This is the x86_64 CLMUL-NI accelerated implementation of
10711133
GHASH, the hash function used in GCM (Galois/Counter mode).
10721134

1135+
config CRYPTO_GHASH_S390
1136+
tristate "GHASH hash function"
1137+
depends on S390
1138+
select CRYPTO_HASH
1139+
help
1140+
This is the s390 hardware accelerated implementation of GHASH,
1141+
the hash function used in GCM (Galois/Counter mode).
1142+
1143+
It is available as of z196.
1144+
10731145
comment "Ciphers"
10741146

10751147
config CRYPTO_AES
@@ -1185,6 +1257,23 @@ config CRYPTO_AES_PPC_SPE
11851257
architecture specific assembler implementations that work on 1KB
11861258
tables or 256 bytes S-boxes.
11871259

1260+
config CRYPTO_AES_S390
1261+
tristate "AES cipher algorithms"
1262+
depends on S390
1263+
select CRYPTO_ALGAPI
1264+
select CRYPTO_SKCIPHER
1265+
help
1266+
This is the s390 hardware accelerated implementation of the
1267+
AES cipher algorithms (FIPS-197).
1268+
1269+
As of z9 the ECB and CBC modes are hardware accelerated
1270+
for 128 bit keys.
1271+
As of z10 the ECB and CBC modes are hardware accelerated
1272+
for all AES key sizes.
1273+
As of z196 the CTR mode is hardware accelerated for all AES
1274+
key sizes and XTS mode is hardware accelerated for 256 and
1275+
512 bit keys.
1276+
11881277
config CRYPTO_ANUBIS
11891278
tristate "Anubis cipher algorithm"
11901279
depends on CRYPTO_USER_API_ENABLE_OBSOLETE
@@ -1415,6 +1504,19 @@ config CRYPTO_DES3_EDE_X86_64
14151504
algorithm are provided; regular processing one input block and
14161505
one that processes three blocks parallel.
14171506

1507+
config CRYPTO_DES_S390
1508+
tristate "DES and Triple DES cipher algorithms"
1509+
depends on S390
1510+
select CRYPTO_ALGAPI
1511+
select CRYPTO_SKCIPHER
1512+
select CRYPTO_LIB_DES
1513+
help
1514+
This is the s390 hardware accelerated implementation of the
1515+
DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
1516+
1517+
As of z990 the ECB and CBC mode are hardware accelerated.
1518+
As of z196 the CTR mode is hardware accelerated.
1519+
14181520
config CRYPTO_FCRYPT
14191521
tristate "FCrypt cipher algorithm"
14201522
select CRYPTO_ALGAPI
@@ -1474,6 +1576,18 @@ config CRYPTO_CHACHA_MIPS
14741576
select CRYPTO_SKCIPHER
14751577
select CRYPTO_ARCH_HAVE_LIB_CHACHA
14761578

1579+
config CRYPTO_CHACHA_S390
1580+
tristate "ChaCha20 stream cipher"
1581+
depends on S390
1582+
select CRYPTO_SKCIPHER
1583+
select CRYPTO_LIB_CHACHA_GENERIC
1584+
select CRYPTO_ARCH_HAVE_LIB_CHACHA
1585+
help
1586+
This is the s390 SIMD implementation of the ChaCha20 stream
1587+
cipher (RFC 7539).
1588+
1589+
It is available as of z13.
1590+
14771591
config CRYPTO_SEED
14781592
tristate "SEED cipher algorithm"
14791593
depends on CRYPTO_USER_API_ENABLE_OBSOLETE

drivers/crypto/Kconfig

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -133,98 +133,6 @@ config CRYPTO_PAES_S390
133133
Select this option if you want to use the paes cipher
134134
for example to use protected key encrypted devices.
135135

136-
config CRYPTO_SHA1_S390
137-
tristate "SHA1 digest algorithm"
138-
depends on S390
139-
select CRYPTO_HASH
140-
help
141-
This is the s390 hardware accelerated implementation of the
142-
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
143-
144-
It is available as of z990.
145-
146-
config CRYPTO_SHA256_S390
147-
tristate "SHA256 digest algorithm"
148-
depends on S390
149-
select CRYPTO_HASH
150-
help
151-
This is the s390 hardware accelerated implementation of the
152-
SHA256 secure hash standard (DFIPS 180-2).
153-
154-
It is available as of z9.
155-
156-
config CRYPTO_SHA512_S390
157-
tristate "SHA384 and SHA512 digest algorithm"
158-
depends on S390
159-
select CRYPTO_HASH
160-
help
161-
This is the s390 hardware accelerated implementation of the
162-
SHA512 secure hash standard.
163-
164-
It is available as of z10.
165-
166-
config CRYPTO_SHA3_256_S390
167-
tristate "SHA3_224 and SHA3_256 digest algorithm"
168-
depends on S390
169-
select CRYPTO_HASH
170-
help
171-
This is the s390 hardware accelerated implementation of the
172-
SHA3_256 secure hash standard.
173-
174-
It is available as of z14.
175-
176-
config CRYPTO_SHA3_512_S390
177-
tristate "SHA3_384 and SHA3_512 digest algorithm"
178-
depends on S390
179-
select CRYPTO_HASH
180-
help
181-
This is the s390 hardware accelerated implementation of the
182-
SHA3_512 secure hash standard.
183-
184-
It is available as of z14.
185-
186-
config CRYPTO_DES_S390
187-
tristate "DES and Triple DES cipher algorithms"
188-
depends on S390
189-
select CRYPTO_ALGAPI
190-
select CRYPTO_SKCIPHER
191-
select CRYPTO_LIB_DES
192-
help
193-
This is the s390 hardware accelerated implementation of the
194-
DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
195-
196-
As of z990 the ECB and CBC mode are hardware accelerated.
197-
As of z196 the CTR mode is hardware accelerated.
198-
199-
config CRYPTO_AES_S390
200-
tristate "AES cipher algorithms"
201-
depends on S390
202-
select CRYPTO_ALGAPI
203-
select CRYPTO_SKCIPHER
204-
help
205-
This is the s390 hardware accelerated implementation of the
206-
AES cipher algorithms (FIPS-197).
207-
208-
As of z9 the ECB and CBC modes are hardware accelerated
209-
for 128 bit keys.
210-
As of z10 the ECB and CBC modes are hardware accelerated
211-
for all AES key sizes.
212-
As of z196 the CTR mode is hardware accelerated for all AES
213-
key sizes and XTS mode is hardware accelerated for 256 and
214-
512 bit keys.
215-
216-
config CRYPTO_CHACHA_S390
217-
tristate "ChaCha20 stream cipher"
218-
depends on S390
219-
select CRYPTO_SKCIPHER
220-
select CRYPTO_LIB_CHACHA_GENERIC
221-
select CRYPTO_ARCH_HAVE_LIB_CHACHA
222-
help
223-
This is the s390 SIMD implementation of the ChaCha20 stream
224-
cipher (RFC 7539).
225-
226-
It is available as of z13.
227-
228136
config S390_PRNG
229137
tristate "Pseudo random number generator device driver"
230138
depends on S390
@@ -238,29 +146,6 @@ config S390_PRNG
238146

239147
It is available as of z9.
240148

241-
config CRYPTO_GHASH_S390
242-
tristate "GHASH hash function"
243-
depends on S390
244-
select CRYPTO_HASH
245-
help
246-
This is the s390 hardware accelerated implementation of GHASH,
247-
the hash function used in GCM (Galois/Counter mode).
248-
249-
It is available as of z196.
250-
251-
config CRYPTO_CRC32_S390
252-
tristate "CRC-32 algorithms"
253-
depends on S390
254-
select CRYPTO_HASH
255-
select CRC32
256-
help
257-
Select this option if you want to use hardware accelerated
258-
implementations of CRC algorithms. With this option, you
259-
can optimize the computation of CRC-32 (IEEE 802.3 Ethernet)
260-
and CRC-32C (Castagnoli).
261-
262-
It is available with IBM z13 or later.
263-
264149
config CRYPTO_DEV_NIAGARA2
265150
tristate "Niagara2 Stream Processing Unit driver"
266151
select CRYPTO_LIB_DES

0 commit comments

Comments
 (0)