Skip to content

Commit 652ccae

Browse files
Ard Biesheuvelherbertx
Ard Biesheuvel
authored andcommitted
crypto: arm - move ARM specific Kconfig definitions to a dedicated file
This moves all Kconfig symbols defined in crypto/Kconfig that depend on CONFIG_ARM to a dedicated Kconfig file in arch/arm/crypto, which is where the code that implements those features resides as well. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 1eb8a1b commit 652ccae

File tree

3 files changed

+88
-75
lines changed

3 files changed

+88
-75
lines changed

arch/arm/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,9 @@ source "arch/arm/Kconfig.debug"
21672167
source "security/Kconfig"
21682168

21692169
source "crypto/Kconfig"
2170+
if CRYPTO
2171+
source "arch/arm/crypto/Kconfig"
2172+
endif
21702173

21712174
source "lib/Kconfig"
21722175

arch/arm/crypto/Kconfig

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
2+
menuconfig ARM_CRYPTO
3+
bool "ARM Accelerated Cryptographic Algorithms"
4+
depends on ARM
5+
help
6+
Say Y here to choose from a selection of cryptographic algorithms
7+
implemented using ARM specific CPU features or instructions.
8+
9+
if ARM_CRYPTO
10+
11+
config CRYPTO_SHA1_ARM
12+
tristate "SHA1 digest algorithm (ARM-asm)"
13+
select CRYPTO_SHA1
14+
select CRYPTO_HASH
15+
help
16+
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
17+
using optimized ARM assembler.
18+
19+
config CRYPTO_SHA1_ARM_NEON
20+
tristate "SHA1 digest algorithm (ARM NEON)"
21+
depends on KERNEL_MODE_NEON
22+
select CRYPTO_SHA1_ARM
23+
select CRYPTO_SHA1
24+
select CRYPTO_HASH
25+
help
26+
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
27+
using optimized ARM NEON assembly, when NEON instructions are
28+
available.
29+
30+
config CRYPTO_SHA512_ARM_NEON
31+
tristate "SHA384 and SHA512 digest algorithm (ARM NEON)"
32+
depends on KERNEL_MODE_NEON
33+
select CRYPTO_SHA512
34+
select CRYPTO_HASH
35+
help
36+
SHA-512 secure hash standard (DFIPS 180-2) implemented
37+
using ARM NEON instructions, when available.
38+
39+
This version of SHA implements a 512 bit hash with 256 bits of
40+
security against collision attacks.
41+
42+
This code also includes SHA-384, a 384 bit hash with 192 bits
43+
of security against collision attacks.
44+
45+
config CRYPTO_AES_ARM
46+
tristate "AES cipher algorithms (ARM-asm)"
47+
depends on ARM
48+
select CRYPTO_ALGAPI
49+
select CRYPTO_AES
50+
help
51+
Use optimized AES assembler routines for ARM platforms.
52+
53+
AES cipher algorithms (FIPS-197). AES uses the Rijndael
54+
algorithm.
55+
56+
Rijndael appears to be consistently a very good performer in
57+
both hardware and software across a wide range of computing
58+
environments regardless of its use in feedback or non-feedback
59+
modes. Its key setup time is excellent, and its key agility is
60+
good. Rijndael's very low memory requirements make it very well
61+
suited for restricted-space environments, in which it also
62+
demonstrates excellent performance. Rijndael's operations are
63+
among the easiest to defend against power and timing attacks.
64+
65+
The AES specifies three key sizes: 128, 192 and 256 bits
66+
67+
See <http://csrc.nist.gov/encryption/aes/> for more information.
68+
69+
config CRYPTO_AES_ARM_BS
70+
tristate "Bit sliced AES using NEON instructions"
71+
depends on KERNEL_MODE_NEON
72+
select CRYPTO_ALGAPI
73+
select CRYPTO_AES_ARM
74+
select CRYPTO_ABLK_HELPER
75+
help
76+
Use a faster and more secure NEON based implementation of AES in CBC,
77+
CTR and XTS modes
78+
79+
Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode
80+
and for XTS mode encryption, CBC and XTS mode decryption speedup is
81+
around 25%. (CBC encryption speed is not affected by this driver.)
82+
This implementation does not rely on any lookup tables so it is
83+
believed to be invulnerable to cache timing attacks.
84+
85+
endif

crypto/Kconfig

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -572,26 +572,6 @@ config CRYPTO_SHA1_SPARC64
572572
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
573573
using sparc64 crypto instructions, when available.
574574

575-
config CRYPTO_SHA1_ARM
576-
tristate "SHA1 digest algorithm (ARM-asm)"
577-
depends on ARM
578-
select CRYPTO_SHA1
579-
select CRYPTO_HASH
580-
help
581-
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
582-
using optimized ARM assembler.
583-
584-
config CRYPTO_SHA1_ARM_NEON
585-
tristate "SHA1 digest algorithm (ARM NEON)"
586-
depends on ARM && KERNEL_MODE_NEON
587-
select CRYPTO_SHA1_ARM
588-
select CRYPTO_SHA1
589-
select CRYPTO_HASH
590-
help
591-
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
592-
using optimized ARM NEON assembly, when NEON instructions are
593-
available.
594-
595575
config CRYPTO_SHA1_PPC
596576
tristate "SHA1 digest algorithm (powerpc)"
597577
depends on PPC
@@ -691,21 +671,6 @@ config CRYPTO_SHA512_SPARC64
691671
SHA-512 secure hash standard (DFIPS 180-2) implemented
692672
using sparc64 crypto instructions, when available.
693673

694-
config CRYPTO_SHA512_ARM_NEON
695-
tristate "SHA384 and SHA512 digest algorithm (ARM NEON)"
696-
depends on ARM && KERNEL_MODE_NEON
697-
select CRYPTO_SHA512
698-
select CRYPTO_HASH
699-
help
700-
SHA-512 secure hash standard (DFIPS 180-2) implemented
701-
using ARM NEON instructions, when available.
702-
703-
This version of SHA implements a 512 bit hash with 256 bits of
704-
security against collision attacks.
705-
706-
This code also includes SHA-384, a 384 bit hash with 192 bits
707-
of security against collision attacks.
708-
709674
config CRYPTO_TGR192
710675
tristate "Tiger digest algorithms"
711676
select CRYPTO_HASH
@@ -868,46 +833,6 @@ config CRYPTO_AES_SPARC64
868833
for some popular block cipher mode is supported too, including
869834
ECB and CBC.
870835

871-
config CRYPTO_AES_ARM
872-
tristate "AES cipher algorithms (ARM-asm)"
873-
depends on ARM
874-
select CRYPTO_ALGAPI
875-
select CRYPTO_AES
876-
help
877-
Use optimized AES assembler routines for ARM platforms.
878-
879-
AES cipher algorithms (FIPS-197). AES uses the Rijndael
880-
algorithm.
881-
882-
Rijndael appears to be consistently a very good performer in
883-
both hardware and software across a wide range of computing
884-
environments regardless of its use in feedback or non-feedback
885-
modes. Its key setup time is excellent, and its key agility is
886-
good. Rijndael's very low memory requirements make it very well
887-
suited for restricted-space environments, in which it also
888-
demonstrates excellent performance. Rijndael's operations are
889-
among the easiest to defend against power and timing attacks.
890-
891-
The AES specifies three key sizes: 128, 192 and 256 bits
892-
893-
See <http://csrc.nist.gov/encryption/aes/> for more information.
894-
895-
config CRYPTO_AES_ARM_BS
896-
tristate "Bit sliced AES using NEON instructions"
897-
depends on ARM && KERNEL_MODE_NEON
898-
select CRYPTO_ALGAPI
899-
select CRYPTO_AES_ARM
900-
select CRYPTO_ABLK_HELPER
901-
help
902-
Use a faster and more secure NEON based implementation of AES in CBC,
903-
CTR and XTS modes
904-
905-
Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode
906-
and for XTS mode encryption, CBC and XTS mode decryption speedup is
907-
around 25%. (CBC encryption speed is not affected by this driver.)
908-
This implementation does not rely on any lookup tables so it is
909-
believed to be invulnerable to cache timing attacks.
910-
911836
config CRYPTO_AES_PPC_SPE
912837
tristate "AES cipher algorithms (PPC SPE)"
913838
depends on PPC && SPE

0 commit comments

Comments
 (0)