18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_cimenuconfig ARM_CRYPTO
48c2ecf20Sopenharmony_ci	bool "ARM Accelerated Cryptographic Algorithms"
58c2ecf20Sopenharmony_ci	depends on ARM
68c2ecf20Sopenharmony_ci	help
78c2ecf20Sopenharmony_ci	  Say Y here to choose from a selection of cryptographic algorithms
88c2ecf20Sopenharmony_ci	  implemented using ARM specific CPU features or instructions.
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciif ARM_CRYPTO
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciconfig CRYPTO_SHA1_ARM
138c2ecf20Sopenharmony_ci	tristate "SHA1 digest algorithm (ARM-asm)"
148c2ecf20Sopenharmony_ci	select CRYPTO_SHA1
158c2ecf20Sopenharmony_ci	select CRYPTO_HASH
168c2ecf20Sopenharmony_ci	help
178c2ecf20Sopenharmony_ci	  SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
188c2ecf20Sopenharmony_ci	  using optimized ARM assembler.
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciconfig CRYPTO_SHA1_ARM_NEON
218c2ecf20Sopenharmony_ci	tristate "SHA1 digest algorithm (ARM NEON)"
228c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
238c2ecf20Sopenharmony_ci	select CRYPTO_SHA1_ARM
248c2ecf20Sopenharmony_ci	select CRYPTO_SHA1
258c2ecf20Sopenharmony_ci	select CRYPTO_HASH
268c2ecf20Sopenharmony_ci	help
278c2ecf20Sopenharmony_ci	  SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
288c2ecf20Sopenharmony_ci	  using optimized ARM NEON assembly, when NEON instructions are
298c2ecf20Sopenharmony_ci	  available.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciconfig CRYPTO_SHA1_ARM_CE
328c2ecf20Sopenharmony_ci	tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)"
338c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
348c2ecf20Sopenharmony_ci	select CRYPTO_SHA1_ARM
358c2ecf20Sopenharmony_ci	select CRYPTO_HASH
368c2ecf20Sopenharmony_ci	help
378c2ecf20Sopenharmony_ci	  SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
388c2ecf20Sopenharmony_ci	  using special ARMv8 Crypto Extensions.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciconfig CRYPTO_SHA2_ARM_CE
418c2ecf20Sopenharmony_ci	tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)"
428c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
438c2ecf20Sopenharmony_ci	select CRYPTO_SHA256_ARM
448c2ecf20Sopenharmony_ci	select CRYPTO_HASH
458c2ecf20Sopenharmony_ci	help
468c2ecf20Sopenharmony_ci	  SHA-256 secure hash standard (DFIPS 180-2) implemented
478c2ecf20Sopenharmony_ci	  using special ARMv8 Crypto Extensions.
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciconfig CRYPTO_SHA256_ARM
508c2ecf20Sopenharmony_ci	tristate "SHA-224/256 digest algorithm (ARM-asm and NEON)"
518c2ecf20Sopenharmony_ci	select CRYPTO_HASH
528c2ecf20Sopenharmony_ci	depends on !CPU_V7M
538c2ecf20Sopenharmony_ci	help
548c2ecf20Sopenharmony_ci	  SHA-256 secure hash standard (DFIPS 180-2) implemented
558c2ecf20Sopenharmony_ci	  using optimized ARM assembler and NEON, when available.
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ciconfig CRYPTO_SHA512_ARM
588c2ecf20Sopenharmony_ci	tristate "SHA-384/512 digest algorithm (ARM-asm and NEON)"
598c2ecf20Sopenharmony_ci	select CRYPTO_HASH
608c2ecf20Sopenharmony_ci	depends on !CPU_V7M
618c2ecf20Sopenharmony_ci	help
628c2ecf20Sopenharmony_ci	  SHA-512 secure hash standard (DFIPS 180-2) implemented
638c2ecf20Sopenharmony_ci	  using optimized ARM assembler and NEON, when available.
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ciconfig CRYPTO_AES_ARM
668c2ecf20Sopenharmony_ci	tristate "Scalar AES cipher for ARM"
678c2ecf20Sopenharmony_ci	select CRYPTO_ALGAPI
688c2ecf20Sopenharmony_ci	select CRYPTO_AES
698c2ecf20Sopenharmony_ci	help
708c2ecf20Sopenharmony_ci	  Use optimized AES assembler routines for ARM platforms.
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci	  On ARM processors without the Crypto Extensions, this is the
738c2ecf20Sopenharmony_ci	  fastest AES implementation for single blocks.  For multiple
748c2ecf20Sopenharmony_ci	  blocks, the NEON bit-sliced implementation is usually faster.
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	  This implementation may be vulnerable to cache timing attacks,
778c2ecf20Sopenharmony_ci	  since it uses lookup tables.  However, as countermeasures it
788c2ecf20Sopenharmony_ci	  disables IRQs and preloads the tables; it is hoped this makes
798c2ecf20Sopenharmony_ci	  such attacks very difficult.
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ciconfig CRYPTO_AES_ARM_BS
828c2ecf20Sopenharmony_ci	tristate "Bit sliced AES using NEON instructions"
838c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
848c2ecf20Sopenharmony_ci	select CRYPTO_SKCIPHER
858c2ecf20Sopenharmony_ci	select CRYPTO_LIB_AES
868c2ecf20Sopenharmony_ci	select CRYPTO_AES
878c2ecf20Sopenharmony_ci	select CRYPTO_CBC
888c2ecf20Sopenharmony_ci	select CRYPTO_SIMD
898c2ecf20Sopenharmony_ci	help
908c2ecf20Sopenharmony_ci	  Use a faster and more secure NEON based implementation of AES in CBC,
918c2ecf20Sopenharmony_ci	  CTR and XTS modes
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci	  Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode
948c2ecf20Sopenharmony_ci	  and for XTS mode encryption, CBC and XTS mode decryption speedup is
958c2ecf20Sopenharmony_ci	  around 25%. (CBC encryption speed is not affected by this driver.)
968c2ecf20Sopenharmony_ci	  This implementation does not rely on any lookup tables so it is
978c2ecf20Sopenharmony_ci	  believed to be invulnerable to cache timing attacks.
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ciconfig CRYPTO_AES_ARM_CE
1008c2ecf20Sopenharmony_ci	tristate "Accelerated AES using ARMv8 Crypto Extensions"
1018c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
1028c2ecf20Sopenharmony_ci	select CRYPTO_SKCIPHER
1038c2ecf20Sopenharmony_ci	select CRYPTO_LIB_AES
1048c2ecf20Sopenharmony_ci	select CRYPTO_SIMD
1058c2ecf20Sopenharmony_ci	help
1068c2ecf20Sopenharmony_ci	  Use an implementation of AES in CBC, CTR and XTS modes that uses
1078c2ecf20Sopenharmony_ci	  ARMv8 Crypto Extensions
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ciconfig CRYPTO_GHASH_ARM_CE
1108c2ecf20Sopenharmony_ci	tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions"
1118c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
1128c2ecf20Sopenharmony_ci	select CRYPTO_HASH
1138c2ecf20Sopenharmony_ci	select CRYPTO_CRYPTD
1148c2ecf20Sopenharmony_ci	select CRYPTO_GF128MUL
1158c2ecf20Sopenharmony_ci	help
1168c2ecf20Sopenharmony_ci	  Use an implementation of GHASH (used by the GCM AEAD chaining mode)
1178c2ecf20Sopenharmony_ci	  that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64)
1188c2ecf20Sopenharmony_ci	  that is part of the ARMv8 Crypto Extensions, or a slower variant that
1198c2ecf20Sopenharmony_ci	  uses the vmull.p8 instruction that is part of the basic NEON ISA.
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ciconfig CRYPTO_CRCT10DIF_ARM_CE
1228c2ecf20Sopenharmony_ci	tristate "CRCT10DIF digest algorithm using PMULL instructions"
1238c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
1248c2ecf20Sopenharmony_ci	depends on CRC_T10DIF
1258c2ecf20Sopenharmony_ci	select CRYPTO_HASH
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ciconfig CRYPTO_CRC32_ARM_CE
1288c2ecf20Sopenharmony_ci	tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions"
1298c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
1308c2ecf20Sopenharmony_ci	depends on CRC32
1318c2ecf20Sopenharmony_ci	select CRYPTO_HASH
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ciconfig CRYPTO_CHACHA20_NEON
1348c2ecf20Sopenharmony_ci	tristate "NEON and scalar accelerated ChaCha stream cipher algorithms"
1358c2ecf20Sopenharmony_ci	select CRYPTO_SKCIPHER
1368c2ecf20Sopenharmony_ci	select CRYPTO_ARCH_HAVE_LIB_CHACHA
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ciconfig CRYPTO_POLY1305_ARM
1398c2ecf20Sopenharmony_ci	tristate "Accelerated scalar and SIMD Poly1305 hash implementations"
1408c2ecf20Sopenharmony_ci	select CRYPTO_HASH
1418c2ecf20Sopenharmony_ci	select CRYPTO_ARCH_HAVE_LIB_POLY1305
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ciconfig CRYPTO_NHPOLY1305_NEON
1448c2ecf20Sopenharmony_ci	tristate "NEON accelerated NHPoly1305 hash function (for Adiantum)"
1458c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
1468c2ecf20Sopenharmony_ci	select CRYPTO_NHPOLY1305
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ciconfig CRYPTO_CURVE25519_NEON
1498c2ecf20Sopenharmony_ci	tristate "NEON accelerated Curve25519 scalar multiplication library"
1508c2ecf20Sopenharmony_ci	depends on KERNEL_MODE_NEON
1518c2ecf20Sopenharmony_ci	select CRYPTO_LIB_CURVE25519_GENERIC
1528c2ecf20Sopenharmony_ci	select CRYPTO_ARCH_HAVE_LIB_CURVE25519
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ciendif
155