1# SPDX-License-Identifier: GPL-2.0 2 3menu "Accelerated Cryptographic Algorithms for CPU (arm)" 4 5config CRYPTO_GHASH_ARM_CE 6 tristate "Hash functions: GHASH (PMULL/NEON/ARMv8 Crypto Extensions)" 7 depends on KERNEL_MODE_NEON 8 select CRYPTO_AEAD 9 select CRYPTO_HASH 10 select CRYPTO_CRYPTD 11 select CRYPTO_LIB_AES 12 select CRYPTO_LIB_GF128MUL 13 help 14 GCM GHASH function (NIST SP800-38D) 15 16 Architecture: arm using 17 - PMULL (Polynomial Multiply Long) instructions 18 - NEON (Advanced SIMD) extensions 19 - ARMv8 Crypto Extensions 20 21 Use an implementation of GHASH (used by the GCM AEAD chaining mode) 22 that uses the 64x64 to 128 bit polynomial multiplication (vmull.p64) 23 that is part of the ARMv8 Crypto Extensions, or a slower variant that 24 uses the vmull.p8 instruction that is part of the basic NEON ISA. 25 26config CRYPTO_AES_ARM 27 tristate "Ciphers: AES" 28 select CRYPTO_ALGAPI 29 select CRYPTO_AES 30 help 31 Block ciphers: AES cipher algorithms (FIPS-197) 32 33 Architecture: arm 34 35 On ARM processors without the Crypto Extensions, this is the 36 fastest AES implementation for single blocks. For multiple 37 blocks, the NEON bit-sliced implementation is usually faster. 38 39 This implementation may be vulnerable to cache timing attacks, 40 since it uses lookup tables. However, as countermeasures it 41 disables IRQs and preloads the tables; it is hoped this makes 42 such attacks very difficult. 43 44config CRYPTO_AES_ARM_BS 45 tristate "Ciphers: AES, modes: ECB/CBC/CTR/XTS (bit-sliced NEON)" 46 depends on KERNEL_MODE_NEON 47 select CRYPTO_SKCIPHER 48 select CRYPTO_LIB_AES 49 help 50 Length-preserving ciphers: AES cipher algorithms (FIPS-197) 51 with block cipher modes: 52 - ECB (Electronic Codebook) mode (NIST SP800-38A) 53 - CBC (Cipher Block Chaining) mode (NIST SP800-38A) 54 - CTR (Counter) mode (NIST SP800-38A) 55 - XTS (XOR Encrypt XOR with ciphertext stealing) mode (NIST SP800-38E 56 and IEEE 1619) 57 58 Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode 59 and for XTS mode encryption, CBC and XTS mode decryption speedup is 60 around 25%. (CBC encryption speed is not affected by this driver.) 61 62 The bit sliced AES code does not use lookup tables, so it is believed 63 to be invulnerable to cache timing attacks. However, since the bit 64 sliced AES code cannot process single blocks efficiently, in certain 65 cases table-based code with some countermeasures against cache timing 66 attacks will still be used as a fallback method; specifically CBC 67 encryption (not CBC decryption), the encryption of XTS tweaks, XTS 68 ciphertext stealing when the message isn't a multiple of 16 bytes, and 69 CTR when invoked in a context in which NEON instructions are unusable. 70 71config CRYPTO_AES_ARM_CE 72 tristate "Ciphers: AES, modes: ECB/CBC/CTS/CTR/XTS (ARMv8 Crypto Extensions)" 73 depends on KERNEL_MODE_NEON 74 select CRYPTO_SKCIPHER 75 select CRYPTO_LIB_AES 76 help 77 Length-preserving ciphers: AES cipher algorithms (FIPS-197) 78 with block cipher modes: 79 - ECB (Electronic Codebook) mode (NIST SP800-38A) 80 - CBC (Cipher Block Chaining) mode (NIST SP800-38A) 81 - CTR (Counter) mode (NIST SP800-38A) 82 - CTS (Cipher Text Stealing) mode (NIST SP800-38A) 83 - XTS (XOR Encrypt XOR with ciphertext stealing) mode (NIST SP800-38E 84 and IEEE 1619) 85 86 Architecture: arm using: 87 - ARMv8 Crypto Extensions 88 89endmenu 90 91