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 655172d322SEric Biggersconfig CRYPTO_BLAKE2S_ARM 66*2d16803cSJason A. Donenfeld bool "BLAKE2s digest algorithm (ARM)" 675172d322SEric Biggers select CRYPTO_ARCH_HAVE_LIB_BLAKE2S 685172d322SEric Biggers help 695172d322SEric Biggers BLAKE2s digest algorithm optimized with ARM scalar instructions. This 705172d322SEric Biggers is faster than the generic implementations of BLAKE2s and BLAKE2b, but 715172d322SEric Biggers slower than the NEON implementation of BLAKE2b. (There is no NEON 725172d322SEric Biggers implementation of BLAKE2s, since NEON doesn't really help with it.) 735172d322SEric Biggers 741862eb00SEric Biggersconfig CRYPTO_BLAKE2B_NEON 751862eb00SEric Biggers tristate "BLAKE2b digest algorithm (ARM NEON)" 761862eb00SEric Biggers depends on KERNEL_MODE_NEON 771862eb00SEric Biggers select CRYPTO_BLAKE2B 781862eb00SEric Biggers help 791862eb00SEric Biggers BLAKE2b digest algorithm optimized with ARM NEON instructions. 801862eb00SEric Biggers On ARM processors that have NEON support but not the ARMv8 811862eb00SEric Biggers Crypto Extensions, typically this BLAKE2b implementation is 821862eb00SEric Biggers much faster than SHA-2 and slightly faster than SHA-1. 831862eb00SEric Biggers 84652ccae5SArd Biesheuvelconfig CRYPTO_AES_ARM 8581edb426SArd Biesheuvel tristate "Scalar AES cipher for ARM" 86652ccae5SArd Biesheuvel select CRYPTO_ALGAPI 87652ccae5SArd Biesheuvel select CRYPTO_AES 88652ccae5SArd Biesheuvel help 89652ccae5SArd Biesheuvel Use optimized AES assembler routines for ARM platforms. 90652ccae5SArd Biesheuvel 91913a3aa0SEric Biggers On ARM processors without the Crypto Extensions, this is the 92913a3aa0SEric Biggers fastest AES implementation for single blocks. For multiple 93913a3aa0SEric Biggers blocks, the NEON bit-sliced implementation is usually faster. 94913a3aa0SEric Biggers 95913a3aa0SEric Biggers This implementation may be vulnerable to cache timing attacks, 96913a3aa0SEric Biggers since it uses lookup tables. However, as countermeasures it 97913a3aa0SEric Biggers disables IRQs and preloads the tables; it is hoped this makes 98913a3aa0SEric Biggers such attacks very difficult. 99913a3aa0SEric Biggers 100652ccae5SArd Biesheuvelconfig CRYPTO_AES_ARM_BS 101652ccae5SArd Biesheuvel tristate "Bit sliced AES using NEON instructions" 102652ccae5SArd Biesheuvel depends on KERNEL_MODE_NEON 103b95bba5dSEric Biggers select CRYPTO_SKCIPHER 104aa6e2d2bSArd Biesheuvel select CRYPTO_LIB_AES 105c8bd296cSHerbert Xu select CRYPTO_AES 106c8bd296cSHerbert Xu select CRYPTO_CBC 1076fdf436fSHerbert Xu select CRYPTO_SIMD 108652ccae5SArd Biesheuvel help 109652ccae5SArd Biesheuvel Use a faster and more secure NEON based implementation of AES in CBC, 110652ccae5SArd Biesheuvel CTR and XTS modes 111652ccae5SArd Biesheuvel 112652ccae5SArd Biesheuvel Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode 113652ccae5SArd Biesheuvel and for XTS mode encryption, CBC and XTS mode decryption speedup is 114652ccae5SArd Biesheuvel around 25%. (CBC encryption speed is not affected by this driver.) 115652ccae5SArd Biesheuvel This implementation does not rely on any lookup tables so it is 116652ccae5SArd Biesheuvel believed to be invulnerable to cache timing attacks. 117652ccae5SArd Biesheuvel 11886464859SArd Biesheuvelconfig CRYPTO_AES_ARM_CE 11986464859SArd Biesheuvel tristate "Accelerated AES using ARMv8 Crypto Extensions" 1205429ef62SWill Deacon depends on KERNEL_MODE_NEON 121b95bba5dSEric Biggers select CRYPTO_SKCIPHER 122f703964fSArd Biesheuvel select CRYPTO_LIB_AES 123585b5fa6SHerbert Xu select CRYPTO_SIMD 12486464859SArd Biesheuvel help 12586464859SArd Biesheuvel Use an implementation of AES in CBC, CTR and XTS modes that uses 12686464859SArd Biesheuvel ARMv8 Crypto Extensions 12786464859SArd Biesheuvel 128f1e866b1SArd Biesheuvelconfig CRYPTO_GHASH_ARM_CE 1293759ee05SArd Biesheuvel tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions" 1305429ef62SWill Deacon depends on KERNEL_MODE_NEON 131f1e866b1SArd Biesheuvel select CRYPTO_HASH 132f1e866b1SArd Biesheuvel select CRYPTO_CRYPTD 13300227e3aSArd Biesheuvel select CRYPTO_GF128MUL 134f1e866b1SArd Biesheuvel help 135f1e866b1SArd Biesheuvel Use an implementation of GHASH (used by the GCM AEAD chaining mode) 136f1e866b1SArd Biesheuvel that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64) 1373759ee05SArd Biesheuvel that is part of the ARMv8 Crypto Extensions, or a slower variant that 1383759ee05SArd Biesheuvel uses the vmull.p8 instruction that is part of the basic NEON ISA. 139f1e866b1SArd Biesheuvel 1401d481f1cSArd Biesheuvelconfig CRYPTO_CRCT10DIF_ARM_CE 1411d481f1cSArd Biesheuvel tristate "CRCT10DIF digest algorithm using PMULL instructions" 1425429ef62SWill Deacon depends on KERNEL_MODE_NEON 143b4d0c0aaSArd Biesheuvel depends on CRC_T10DIF 1441d481f1cSArd Biesheuvel select CRYPTO_HASH 1451d481f1cSArd Biesheuvel 146d0a3431aSArd Biesheuvelconfig CRYPTO_CRC32_ARM_CE 147d0a3431aSArd Biesheuvel tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions" 1485429ef62SWill Deacon depends on KERNEL_MODE_NEON 149b4d0c0aaSArd Biesheuvel depends on CRC32 150d0a3431aSArd Biesheuvel select CRYPTO_HASH 151d0a3431aSArd Biesheuvel 152afaf712eSArd Biesheuvelconfig CRYPTO_CHACHA20_NEON 153b36d8c09SArd Biesheuvel tristate "NEON and scalar accelerated ChaCha stream cipher algorithms" 154b95bba5dSEric Biggers select CRYPTO_SKCIPHER 155a44a3430SArd Biesheuvel select CRYPTO_ARCH_HAVE_LIB_CHACHA 156afaf712eSArd Biesheuvel 157a6b803b3SArd Biesheuvelconfig CRYPTO_POLY1305_ARM 158a6b803b3SArd Biesheuvel tristate "Accelerated scalar and SIMD Poly1305 hash implementations" 159a6b803b3SArd Biesheuvel select CRYPTO_HASH 160a6b803b3SArd Biesheuvel select CRYPTO_ARCH_HAVE_LIB_POLY1305 161652ccae5SArd Biesheuvel 16216aae359SEric Biggersconfig CRYPTO_NHPOLY1305_NEON 16316aae359SEric Biggers tristate "NEON accelerated NHPoly1305 hash function (for Adiantum)" 16416aae359SEric Biggers depends on KERNEL_MODE_NEON 16516aae359SEric Biggers select CRYPTO_NHPOLY1305 16616aae359SEric Biggers 167d8f1308aSJason A. Donenfeldconfig CRYPTO_CURVE25519_NEON 168d8f1308aSJason A. Donenfeld tristate "NEON accelerated Curve25519 scalar multiplication library" 169d8f1308aSJason A. Donenfeld depends on KERNEL_MODE_NEON 170d8f1308aSJason A. Donenfeld select CRYPTO_LIB_CURVE25519_GENERIC 171d8f1308aSJason A. Donenfeld select CRYPTO_ARCH_HAVE_LIB_CURVE25519 172d8f1308aSJason A. Donenfeld 173652ccae5SArd Biesheuvelendif 174