1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 2652ccae5SArd Biesheuvel 3*4a329fecSRobert Elliottmenu "Accelerated Cryptographic Algorithms for CPU (arm)" 4652ccae5SArd Biesheuvel 5652ccae5SArd Biesheuvelconfig CRYPTO_SHA1_ARM 6652ccae5SArd Biesheuvel tristate "SHA1 digest algorithm (ARM-asm)" 7652ccae5SArd Biesheuvel select CRYPTO_SHA1 8652ccae5SArd Biesheuvel select CRYPTO_HASH 9652ccae5SArd Biesheuvel help 10652ccae5SArd Biesheuvel SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented 11652ccae5SArd Biesheuvel using optimized ARM assembler. 12652ccae5SArd Biesheuvel 13652ccae5SArd Biesheuvelconfig CRYPTO_SHA1_ARM_NEON 14652ccae5SArd Biesheuvel tristate "SHA1 digest algorithm (ARM NEON)" 15652ccae5SArd Biesheuvel depends on KERNEL_MODE_NEON 16652ccae5SArd Biesheuvel select CRYPTO_SHA1_ARM 17652ccae5SArd Biesheuvel select CRYPTO_SHA1 18652ccae5SArd Biesheuvel select CRYPTO_HASH 19652ccae5SArd Biesheuvel help 20652ccae5SArd Biesheuvel SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented 21652ccae5SArd Biesheuvel using optimized ARM NEON assembly, when NEON instructions are 22652ccae5SArd Biesheuvel available. 23652ccae5SArd Biesheuvel 24864cbeedSArd Biesheuvelconfig CRYPTO_SHA1_ARM_CE 25864cbeedSArd Biesheuvel tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)" 265429ef62SWill Deacon depends on KERNEL_MODE_NEON 27864cbeedSArd Biesheuvel select CRYPTO_SHA1_ARM 28864cbeedSArd Biesheuvel select CRYPTO_HASH 29864cbeedSArd Biesheuvel help 30864cbeedSArd Biesheuvel SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented 31864cbeedSArd Biesheuvel using special ARMv8 Crypto Extensions. 32864cbeedSArd Biesheuvel 33006d0624SArd Biesheuvelconfig CRYPTO_SHA2_ARM_CE 34006d0624SArd Biesheuvel tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)" 355429ef62SWill Deacon depends on KERNEL_MODE_NEON 369205b949SArd Biesheuvel select CRYPTO_SHA256_ARM 37006d0624SArd Biesheuvel select CRYPTO_HASH 38006d0624SArd Biesheuvel help 39006d0624SArd Biesheuvel SHA-256 secure hash standard (DFIPS 180-2) implemented 40006d0624SArd Biesheuvel using special ARMv8 Crypto Extensions. 41006d0624SArd Biesheuvel 42f2f770d7SSami Tolvanenconfig CRYPTO_SHA256_ARM 43f2f770d7SSami Tolvanen tristate "SHA-224/256 digest algorithm (ARM-asm and NEON)" 44f2f770d7SSami Tolvanen select CRYPTO_HASH 45b48321deSArnd Bergmann depends on !CPU_V7M 46f2f770d7SSami Tolvanen help 47f2f770d7SSami Tolvanen SHA-256 secure hash standard (DFIPS 180-2) implemented 48f2f770d7SSami Tolvanen using optimized ARM assembler and NEON, when available. 49f2f770d7SSami Tolvanen 50c80ae7caSArd Biesheuvelconfig CRYPTO_SHA512_ARM 51c80ae7caSArd Biesheuvel tristate "SHA-384/512 digest algorithm (ARM-asm and NEON)" 52652ccae5SArd Biesheuvel select CRYPTO_HASH 53c80ae7caSArd Biesheuvel depends on !CPU_V7M 54652ccae5SArd Biesheuvel help 55652ccae5SArd Biesheuvel SHA-512 secure hash standard (DFIPS 180-2) implemented 56c80ae7caSArd Biesheuvel using optimized ARM assembler and NEON, when available. 57652ccae5SArd Biesheuvel 585172d322SEric Biggersconfig CRYPTO_BLAKE2S_ARM 592d16803cSJason A. Donenfeld bool "BLAKE2s digest algorithm (ARM)" 605172d322SEric Biggers select CRYPTO_ARCH_HAVE_LIB_BLAKE2S 615172d322SEric Biggers help 625172d322SEric Biggers BLAKE2s digest algorithm optimized with ARM scalar instructions. This 635172d322SEric Biggers is faster than the generic implementations of BLAKE2s and BLAKE2b, but 645172d322SEric Biggers slower than the NEON implementation of BLAKE2b. (There is no NEON 655172d322SEric Biggers implementation of BLAKE2s, since NEON doesn't really help with it.) 665172d322SEric Biggers 671862eb00SEric Biggersconfig CRYPTO_BLAKE2B_NEON 681862eb00SEric Biggers tristate "BLAKE2b digest algorithm (ARM NEON)" 691862eb00SEric Biggers depends on KERNEL_MODE_NEON 701862eb00SEric Biggers select CRYPTO_BLAKE2B 711862eb00SEric Biggers help 721862eb00SEric Biggers BLAKE2b digest algorithm optimized with ARM NEON instructions. 731862eb00SEric Biggers On ARM processors that have NEON support but not the ARMv8 741862eb00SEric Biggers Crypto Extensions, typically this BLAKE2b implementation is 751862eb00SEric Biggers much faster than SHA-2 and slightly faster than SHA-1. 761862eb00SEric Biggers 77652ccae5SArd Biesheuvelconfig CRYPTO_AES_ARM 7881edb426SArd Biesheuvel tristate "Scalar AES cipher for ARM" 79652ccae5SArd Biesheuvel select CRYPTO_ALGAPI 80652ccae5SArd Biesheuvel select CRYPTO_AES 81652ccae5SArd Biesheuvel help 82652ccae5SArd Biesheuvel Use optimized AES assembler routines for ARM platforms. 83652ccae5SArd Biesheuvel 84913a3aa0SEric Biggers On ARM processors without the Crypto Extensions, this is the 85913a3aa0SEric Biggers fastest AES implementation for single blocks. For multiple 86913a3aa0SEric Biggers blocks, the NEON bit-sliced implementation is usually faster. 87913a3aa0SEric Biggers 88913a3aa0SEric Biggers This implementation may be vulnerable to cache timing attacks, 89913a3aa0SEric Biggers since it uses lookup tables. However, as countermeasures it 90913a3aa0SEric Biggers disables IRQs and preloads the tables; it is hoped this makes 91913a3aa0SEric Biggers such attacks very difficult. 92913a3aa0SEric Biggers 93652ccae5SArd Biesheuvelconfig CRYPTO_AES_ARM_BS 94652ccae5SArd Biesheuvel tristate "Bit sliced AES using NEON instructions" 95652ccae5SArd Biesheuvel depends on KERNEL_MODE_NEON 96b95bba5dSEric Biggers select CRYPTO_SKCIPHER 97aa6e2d2bSArd Biesheuvel select CRYPTO_LIB_AES 98c8bd296cSHerbert Xu select CRYPTO_AES 99c8bd296cSHerbert Xu select CRYPTO_CBC 1006fdf436fSHerbert Xu select CRYPTO_SIMD 101652ccae5SArd Biesheuvel help 102652ccae5SArd Biesheuvel Use a faster and more secure NEON based implementation of AES in CBC, 103652ccae5SArd Biesheuvel CTR and XTS modes 104652ccae5SArd Biesheuvel 105652ccae5SArd Biesheuvel Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode 106652ccae5SArd Biesheuvel and for XTS mode encryption, CBC and XTS mode decryption speedup is 107652ccae5SArd Biesheuvel around 25%. (CBC encryption speed is not affected by this driver.) 108652ccae5SArd Biesheuvel This implementation does not rely on any lookup tables so it is 109652ccae5SArd Biesheuvel believed to be invulnerable to cache timing attacks. 110652ccae5SArd Biesheuvel 11186464859SArd Biesheuvelconfig CRYPTO_AES_ARM_CE 11286464859SArd Biesheuvel tristate "Accelerated AES using ARMv8 Crypto Extensions" 1135429ef62SWill Deacon depends on KERNEL_MODE_NEON 114b95bba5dSEric Biggers select CRYPTO_SKCIPHER 115f703964fSArd Biesheuvel select CRYPTO_LIB_AES 116585b5fa6SHerbert Xu select CRYPTO_SIMD 11786464859SArd Biesheuvel help 11886464859SArd Biesheuvel Use an implementation of AES in CBC, CTR and XTS modes that uses 11986464859SArd Biesheuvel ARMv8 Crypto Extensions 12086464859SArd Biesheuvel 121f1e866b1SArd Biesheuvelconfig CRYPTO_GHASH_ARM_CE 1223759ee05SArd Biesheuvel tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions" 1235429ef62SWill Deacon depends on KERNEL_MODE_NEON 124f1e866b1SArd Biesheuvel select CRYPTO_HASH 125f1e866b1SArd Biesheuvel select CRYPTO_CRYPTD 12600227e3aSArd Biesheuvel select CRYPTO_GF128MUL 127f1e866b1SArd Biesheuvel help 128f1e866b1SArd Biesheuvel Use an implementation of GHASH (used by the GCM AEAD chaining mode) 129f1e866b1SArd Biesheuvel that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64) 1303759ee05SArd Biesheuvel that is part of the ARMv8 Crypto Extensions, or a slower variant that 1313759ee05SArd Biesheuvel uses the vmull.p8 instruction that is part of the basic NEON ISA. 132f1e866b1SArd Biesheuvel 1331d481f1cSArd Biesheuvelconfig CRYPTO_CRCT10DIF_ARM_CE 1341d481f1cSArd Biesheuvel tristate "CRCT10DIF digest algorithm using PMULL instructions" 1355429ef62SWill Deacon depends on KERNEL_MODE_NEON 136b4d0c0aaSArd Biesheuvel depends on CRC_T10DIF 1371d481f1cSArd Biesheuvel select CRYPTO_HASH 1381d481f1cSArd Biesheuvel 139d0a3431aSArd Biesheuvelconfig CRYPTO_CRC32_ARM_CE 140d0a3431aSArd Biesheuvel tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions" 1415429ef62SWill Deacon depends on KERNEL_MODE_NEON 142b4d0c0aaSArd Biesheuvel depends on CRC32 143d0a3431aSArd Biesheuvel select CRYPTO_HASH 144d0a3431aSArd Biesheuvel 145afaf712eSArd Biesheuvelconfig CRYPTO_CHACHA20_NEON 146b36d8c09SArd Biesheuvel tristate "NEON and scalar accelerated ChaCha stream cipher algorithms" 147b95bba5dSEric Biggers select CRYPTO_SKCIPHER 148a44a3430SArd Biesheuvel select CRYPTO_ARCH_HAVE_LIB_CHACHA 149afaf712eSArd Biesheuvel 150a6b803b3SArd Biesheuvelconfig CRYPTO_POLY1305_ARM 151a6b803b3SArd Biesheuvel tristate "Accelerated scalar and SIMD Poly1305 hash implementations" 152a6b803b3SArd Biesheuvel select CRYPTO_HASH 153a6b803b3SArd Biesheuvel select CRYPTO_ARCH_HAVE_LIB_POLY1305 154652ccae5SArd Biesheuvel 15516aae359SEric Biggersconfig CRYPTO_NHPOLY1305_NEON 15616aae359SEric Biggers tristate "NEON accelerated NHPoly1305 hash function (for Adiantum)" 15716aae359SEric Biggers depends on KERNEL_MODE_NEON 15816aae359SEric Biggers select CRYPTO_NHPOLY1305 15916aae359SEric Biggers 160d8f1308aSJason A. Donenfeldconfig CRYPTO_CURVE25519_NEON 161d8f1308aSJason A. Donenfeld tristate "NEON accelerated Curve25519 scalar multiplication library" 162d8f1308aSJason A. Donenfeld depends on KERNEL_MODE_NEON 163d8f1308aSJason A. Donenfeld select CRYPTO_LIB_CURVE25519_GENERIC 164d8f1308aSJason A. Donenfeld select CRYPTO_ARCH_HAVE_LIB_CURVE25519 165d8f1308aSJason A. Donenfeld 166*4a329fecSRobert Elliottendmenu 167