1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 2652ccae5SArd Biesheuvel 3652ccae5SArd Biesheuvelmenuconfig ARM_CRYPTO 4652ccae5SArd Biesheuvel bool "ARM Accelerated Cryptographic Algorithms" 5652ccae5SArd Biesheuvel depends on ARM 6652ccae5SArd Biesheuvel help 7652ccae5SArd Biesheuvel Say Y here to choose from a selection of cryptographic algorithms 8652ccae5SArd Biesheuvel implemented using ARM specific CPU features or instructions. 9652ccae5SArd Biesheuvel 10652ccae5SArd Biesheuvelif ARM_CRYPTO 11652ccae5SArd Biesheuvel 12652ccae5SArd Biesheuvelconfig CRYPTO_SHA1_ARM 13652ccae5SArd Biesheuvel tristate "SHA1 digest algorithm (ARM-asm)" 14652ccae5SArd Biesheuvel select CRYPTO_SHA1 15652ccae5SArd Biesheuvel select CRYPTO_HASH 16652ccae5SArd Biesheuvel help 17652ccae5SArd Biesheuvel SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented 18652ccae5SArd Biesheuvel using optimized ARM assembler. 19652ccae5SArd Biesheuvel 20652ccae5SArd Biesheuvelconfig CRYPTO_SHA1_ARM_NEON 21652ccae5SArd Biesheuvel tristate "SHA1 digest algorithm (ARM NEON)" 22652ccae5SArd Biesheuvel depends on KERNEL_MODE_NEON 23652ccae5SArd Biesheuvel select CRYPTO_SHA1_ARM 24652ccae5SArd Biesheuvel select CRYPTO_SHA1 25652ccae5SArd Biesheuvel select CRYPTO_HASH 26652ccae5SArd Biesheuvel help 27652ccae5SArd Biesheuvel SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented 28652ccae5SArd Biesheuvel using optimized ARM NEON assembly, when NEON instructions are 29652ccae5SArd Biesheuvel available. 30652ccae5SArd Biesheuvel 31864cbeedSArd Biesheuvelconfig CRYPTO_SHA1_ARM_CE 32864cbeedSArd Biesheuvel tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)" 335429ef62SWill Deacon depends on KERNEL_MODE_NEON 34864cbeedSArd Biesheuvel select CRYPTO_SHA1_ARM 35864cbeedSArd Biesheuvel select CRYPTO_HASH 36864cbeedSArd Biesheuvel help 37864cbeedSArd Biesheuvel SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented 38864cbeedSArd Biesheuvel using special ARMv8 Crypto Extensions. 39864cbeedSArd Biesheuvel 40006d0624SArd Biesheuvelconfig CRYPTO_SHA2_ARM_CE 41006d0624SArd Biesheuvel tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)" 425429ef62SWill Deacon depends on KERNEL_MODE_NEON 439205b949SArd Biesheuvel select CRYPTO_SHA256_ARM 44006d0624SArd Biesheuvel select CRYPTO_HASH 45006d0624SArd Biesheuvel help 46006d0624SArd Biesheuvel SHA-256 secure hash standard (DFIPS 180-2) implemented 47006d0624SArd Biesheuvel using special ARMv8 Crypto Extensions. 48006d0624SArd Biesheuvel 49f2f770d7SSami Tolvanenconfig CRYPTO_SHA256_ARM 50f2f770d7SSami Tolvanen tristate "SHA-224/256 digest algorithm (ARM-asm and NEON)" 51f2f770d7SSami Tolvanen select CRYPTO_HASH 52b48321deSArnd Bergmann depends on !CPU_V7M 53f2f770d7SSami Tolvanen help 54f2f770d7SSami Tolvanen SHA-256 secure hash standard (DFIPS 180-2) implemented 55f2f770d7SSami Tolvanen using optimized ARM assembler and NEON, when available. 56f2f770d7SSami Tolvanen 57c80ae7caSArd Biesheuvelconfig CRYPTO_SHA512_ARM 58c80ae7caSArd Biesheuvel tristate "SHA-384/512 digest algorithm (ARM-asm and NEON)" 59652ccae5SArd Biesheuvel select CRYPTO_HASH 60c80ae7caSArd Biesheuvel depends on !CPU_V7M 61652ccae5SArd Biesheuvel help 62652ccae5SArd Biesheuvel SHA-512 secure hash standard (DFIPS 180-2) implemented 63c80ae7caSArd Biesheuvel using optimized ARM assembler and NEON, when available. 64652ccae5SArd Biesheuvel 65*5172d322SEric Biggersconfig CRYPTO_BLAKE2S_ARM 66*5172d322SEric Biggers tristate "BLAKE2s digest algorithm (ARM)" 67*5172d322SEric Biggers select CRYPTO_ARCH_HAVE_LIB_BLAKE2S 68*5172d322SEric Biggers help 69*5172d322SEric Biggers BLAKE2s digest algorithm optimized with ARM scalar instructions. This 70*5172d322SEric Biggers is faster than the generic implementations of BLAKE2s and BLAKE2b, but 71*5172d322SEric Biggers slower than the NEON implementation of BLAKE2b. (There is no NEON 72*5172d322SEric Biggers implementation of BLAKE2s, since NEON doesn't really help with it.) 73*5172d322SEric Biggers 74652ccae5SArd Biesheuvelconfig CRYPTO_AES_ARM 7581edb426SArd Biesheuvel tristate "Scalar AES cipher for ARM" 76652ccae5SArd Biesheuvel select CRYPTO_ALGAPI 77652ccae5SArd Biesheuvel select CRYPTO_AES 78652ccae5SArd Biesheuvel help 79652ccae5SArd Biesheuvel Use optimized AES assembler routines for ARM platforms. 80652ccae5SArd Biesheuvel 81913a3aa0SEric Biggers On ARM processors without the Crypto Extensions, this is the 82913a3aa0SEric Biggers fastest AES implementation for single blocks. For multiple 83913a3aa0SEric Biggers blocks, the NEON bit-sliced implementation is usually faster. 84913a3aa0SEric Biggers 85913a3aa0SEric Biggers This implementation may be vulnerable to cache timing attacks, 86913a3aa0SEric Biggers since it uses lookup tables. However, as countermeasures it 87913a3aa0SEric Biggers disables IRQs and preloads the tables; it is hoped this makes 88913a3aa0SEric Biggers such attacks very difficult. 89913a3aa0SEric Biggers 90652ccae5SArd Biesheuvelconfig CRYPTO_AES_ARM_BS 91652ccae5SArd Biesheuvel tristate "Bit sliced AES using NEON instructions" 92652ccae5SArd Biesheuvel depends on KERNEL_MODE_NEON 93b95bba5dSEric Biggers select CRYPTO_SKCIPHER 94aa6e2d2bSArd Biesheuvel select CRYPTO_LIB_AES 956fdf436fSHerbert Xu select CRYPTO_SIMD 96652ccae5SArd Biesheuvel help 97652ccae5SArd Biesheuvel Use a faster and more secure NEON based implementation of AES in CBC, 98652ccae5SArd Biesheuvel CTR and XTS modes 99652ccae5SArd Biesheuvel 100652ccae5SArd Biesheuvel Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode 101652ccae5SArd Biesheuvel and for XTS mode encryption, CBC and XTS mode decryption speedup is 102652ccae5SArd Biesheuvel around 25%. (CBC encryption speed is not affected by this driver.) 103652ccae5SArd Biesheuvel This implementation does not rely on any lookup tables so it is 104652ccae5SArd Biesheuvel believed to be invulnerable to cache timing attacks. 105652ccae5SArd Biesheuvel 10686464859SArd Biesheuvelconfig CRYPTO_AES_ARM_CE 10786464859SArd Biesheuvel tristate "Accelerated AES using ARMv8 Crypto Extensions" 1085429ef62SWill Deacon depends on KERNEL_MODE_NEON 109b95bba5dSEric Biggers select CRYPTO_SKCIPHER 110f703964fSArd Biesheuvel select CRYPTO_LIB_AES 111585b5fa6SHerbert Xu select CRYPTO_SIMD 11286464859SArd Biesheuvel help 11386464859SArd Biesheuvel Use an implementation of AES in CBC, CTR and XTS modes that uses 11486464859SArd Biesheuvel ARMv8 Crypto Extensions 11586464859SArd Biesheuvel 116f1e866b1SArd Biesheuvelconfig CRYPTO_GHASH_ARM_CE 1173759ee05SArd Biesheuvel tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions" 1185429ef62SWill Deacon depends on KERNEL_MODE_NEON 119f1e866b1SArd Biesheuvel select CRYPTO_HASH 120f1e866b1SArd Biesheuvel select CRYPTO_CRYPTD 12100227e3aSArd Biesheuvel select CRYPTO_GF128MUL 122f1e866b1SArd Biesheuvel help 123f1e866b1SArd Biesheuvel Use an implementation of GHASH (used by the GCM AEAD chaining mode) 124f1e866b1SArd Biesheuvel that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64) 1253759ee05SArd Biesheuvel that is part of the ARMv8 Crypto Extensions, or a slower variant that 1263759ee05SArd Biesheuvel uses the vmull.p8 instruction that is part of the basic NEON ISA. 127f1e866b1SArd Biesheuvel 1281d481f1cSArd Biesheuvelconfig CRYPTO_CRCT10DIF_ARM_CE 1291d481f1cSArd Biesheuvel tristate "CRCT10DIF digest algorithm using PMULL instructions" 1305429ef62SWill Deacon depends on KERNEL_MODE_NEON 131b4d0c0aaSArd Biesheuvel depends on CRC_T10DIF 1321d481f1cSArd Biesheuvel select CRYPTO_HASH 1331d481f1cSArd Biesheuvel 134d0a3431aSArd Biesheuvelconfig CRYPTO_CRC32_ARM_CE 135d0a3431aSArd Biesheuvel tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions" 1365429ef62SWill Deacon depends on KERNEL_MODE_NEON 137b4d0c0aaSArd Biesheuvel depends on CRC32 138d0a3431aSArd Biesheuvel select CRYPTO_HASH 139d0a3431aSArd Biesheuvel 140afaf712eSArd Biesheuvelconfig CRYPTO_CHACHA20_NEON 141b36d8c09SArd Biesheuvel tristate "NEON and scalar accelerated ChaCha stream cipher algorithms" 142b95bba5dSEric Biggers select CRYPTO_SKCIPHER 143a44a3430SArd Biesheuvel select CRYPTO_ARCH_HAVE_LIB_CHACHA 144afaf712eSArd Biesheuvel 145a6b803b3SArd Biesheuvelconfig CRYPTO_POLY1305_ARM 146a6b803b3SArd Biesheuvel tristate "Accelerated scalar and SIMD Poly1305 hash implementations" 147a6b803b3SArd Biesheuvel select CRYPTO_HASH 148a6b803b3SArd Biesheuvel select CRYPTO_ARCH_HAVE_LIB_POLY1305 149652ccae5SArd Biesheuvel 15016aae359SEric Biggersconfig CRYPTO_NHPOLY1305_NEON 15116aae359SEric Biggers tristate "NEON accelerated NHPoly1305 hash function (for Adiantum)" 15216aae359SEric Biggers depends on KERNEL_MODE_NEON 15316aae359SEric Biggers select CRYPTO_NHPOLY1305 15416aae359SEric Biggers 155d8f1308aSJason A. Donenfeldconfig CRYPTO_CURVE25519_NEON 156d8f1308aSJason A. Donenfeld tristate "NEON accelerated Curve25519 scalar multiplication library" 157d8f1308aSJason A. Donenfeld depends on KERNEL_MODE_NEON 158d8f1308aSJason A. Donenfeld select CRYPTO_LIB_CURVE25519_GENERIC 159d8f1308aSJason A. Donenfeld select CRYPTO_ARCH_HAVE_LIB_CURVE25519 160d8f1308aSJason A. Donenfeld 161652ccae5SArd Biesheuvelendif 162