^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) menuconfig ARM_CRYPTO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) bool "ARM Accelerated Cryptographic Algorithms"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) depends on ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) Say Y here to choose from a selection of cryptographic algorithms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) implemented using ARM specific CPU features or instructions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) if ARM_CRYPTO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) config CRYPTO_SHA1_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) tristate "SHA1 digest algorithm (ARM-asm)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) select CRYPTO_SHA1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) using optimized ARM assembler.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) config CRYPTO_SHA1_ARM_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) tristate "SHA1 digest algorithm (ARM NEON)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) select CRYPTO_SHA1_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) select CRYPTO_SHA1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) using optimized ARM NEON assembly, when NEON instructions are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) config CRYPTO_SHA1_ARM_CE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) select CRYPTO_SHA1_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) using special ARMv8 Crypto Extensions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) config CRYPTO_SHA2_ARM_CE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) select CRYPTO_SHA256_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) SHA-256 secure hash standard (DFIPS 180-2) implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) using special ARMv8 Crypto Extensions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) config CRYPTO_SHA256_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) tristate "SHA-224/256 digest algorithm (ARM-asm and NEON)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) depends on !CPU_V7M
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) SHA-256 secure hash standard (DFIPS 180-2) implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) using optimized ARM assembler and NEON, when available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) config CRYPTO_SHA512_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) tristate "SHA-384/512 digest algorithm (ARM-asm and NEON)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) depends on !CPU_V7M
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) SHA-512 secure hash standard (DFIPS 180-2) implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) using optimized ARM assembler and NEON, when available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) config CRYPTO_BLAKE2S_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) tristate "BLAKE2s digest algorithm (ARM)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) select CRYPTO_ARCH_HAVE_LIB_BLAKE2S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) BLAKE2s digest algorithm optimized with ARM scalar instructions. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) is faster than the generic implementations of BLAKE2s and BLAKE2b, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) slower than the NEON implementation of BLAKE2b. (There is no NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) implementation of BLAKE2s, since NEON doesn't really help with it.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) config CRYPTO_BLAKE2B_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) tristate "BLAKE2b digest algorithm (ARM NEON)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) select CRYPTO_BLAKE2B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) BLAKE2b digest algorithm optimized with ARM NEON instructions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) On ARM processors that have NEON support but not the ARMv8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) Crypto Extensions, typically this BLAKE2b implementation is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) much faster than SHA-2 and slightly faster than SHA-1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) config CRYPTO_AES_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) tristate "Scalar AES cipher for ARM"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) select CRYPTO_ALGAPI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) select CRYPTO_AES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) Use optimized AES assembler routines for ARM platforms.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) On ARM processors without the Crypto Extensions, this is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) fastest AES implementation for single blocks. For multiple
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) blocks, the NEON bit-sliced implementation is usually faster.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) This implementation may be vulnerable to cache timing attacks,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) since it uses lookup tables. However, as countermeasures it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) disables IRQs and preloads the tables; it is hoped this makes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) such attacks very difficult.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) config CRYPTO_AES_ARM_BS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) tristate "Bit sliced AES using NEON instructions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) select CRYPTO_SKCIPHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) select CRYPTO_LIB_AES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) select CRYPTO_AES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) select CRYPTO_CBC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) select CRYPTO_SIMD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) Use a faster and more secure NEON based implementation of AES in CBC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) CTR and XTS modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) and for XTS mode encryption, CBC and XTS mode decryption speedup is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) around 25%. (CBC encryption speed is not affected by this driver.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) This implementation does not rely on any lookup tables so it is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) believed to be invulnerable to cache timing attacks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) config CRYPTO_AES_ARM_CE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) tristate "Accelerated AES using ARMv8 Crypto Extensions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) select CRYPTO_SKCIPHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) select CRYPTO_LIB_AES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) select CRYPTO_SIMD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) Use an implementation of AES in CBC, CTR and XTS modes that uses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) ARMv8 Crypto Extensions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) config CRYPTO_GHASH_ARM_CE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) select CRYPTO_CRYPTD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) select CRYPTO_GF128MUL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) Use an implementation of GHASH (used by the GCM AEAD chaining mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) that is part of the ARMv8 Crypto Extensions, or a slower variant that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) uses the vmull.p8 instruction that is part of the basic NEON ISA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) config CRYPTO_CRCT10DIF_ARM_CE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) tristate "CRCT10DIF digest algorithm using PMULL instructions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) depends on CRC_T10DIF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) config CRYPTO_CRC32_ARM_CE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) depends on CRC32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) config CRYPTO_CHACHA20_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) tristate "NEON and scalar accelerated ChaCha stream cipher algorithms"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) select CRYPTO_SKCIPHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) select CRYPTO_ARCH_HAVE_LIB_CHACHA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) config CRYPTO_POLY1305_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) tristate "Accelerated scalar and SIMD Poly1305 hash implementations"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) select CRYPTO_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) select CRYPTO_ARCH_HAVE_LIB_POLY1305
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) config CRYPTO_NHPOLY1305_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) tristate "NEON accelerated NHPoly1305 hash function (for Adiantum)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) select CRYPTO_NHPOLY1305
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) config CRYPTO_CURVE25519_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) tristate "NEON accelerated Curve25519 scalar multiplication library"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) depends on KERNEL_MODE_NEON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) select CRYPTO_LIB_CURVE25519_GENERIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) select CRYPTO_ARCH_HAVE_LIB_CURVE25519
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) endif