Hide Forgot
Description of problem: This is a feature request, not a bug. When setting up a new Fedora installation, Anaconda (both "Custom" and "Advanced Custom (Blivet-GUI)") always uses aes-xts-plain64 for disk encryption, even if the hardware does not support AES-NI. If there is no AES-NI in the hardware, it makes sense to use xchacha12,aes-adiantum-plain64 or xchacha20,aes-adiantum-plain64 (xchacha12,aes-adiantum-plain64 is in my opinion sufficiently, especially for weak or battery-operated hardware). Anaconda needs a function that determines the existence of an AES-NI in the CPU when setting up encrypted storage in order to choose aes-xts if AES-NI is available, and xchacha/adiantum if AES-NI is not available. For an average kernel-operated block-based disk encryption use case, the security advantages of xchacha-adiantum compared to software-based aes-xts can be neglected: both aes-xts and chacha-adiantum are sufficiently secure for that. But there are big performance disadvantages of AES when there is no AES-NI (this was the major reason for merging Adiantum into the kernel). Besides the use of system resources, netbooks/laptops may have strongly decreased battery life times with aes-xts due to the high power consumption (the issue is primarily aes, not xts). I tested with Fedora 35, KDE spin; but as the issue is Anaconda-centric, I expect that other Workstation installations tend to the same behavior, including different architectures. Adjustments seem to be limited to Anaconda. Might be interesting for upstream distributions as well. Version-Release number of selected component (if applicable): KDE spin of Fedora 35; 36 not yet tested for this issue. How reproducible: Use anaconda to install Fedora with storage configuration "Custom" or "Advanced Custom (Blivet-GUI)" (both behave equal in this respect) and enable disk encryption. Actual results: aes-xts encryption on hardware without aes-ni Expected results: xchacha-adiantum encryption on hardware without aes-ni Additional info: It is possible to create the xchacha-adiantum storage in advance using "cryptsetup --type luks2 --sector-size 4096 --cipher=xchacha12,aes-adiantum-plain64 --offset=0 --pbkdf argon2id --iter-time 2000 luksFormat /dev/sdx"; cryptsetup luksOpen /dev/sdx x1; mkfs.ext4 /dev/mapper/x1; cryptsetup luksClose x1;" Anaconda storage configuration "custom" (Blivet not yet tested with this) is properly able to decrypt and open the xchacha12-adiantum later to use it in the installation. Installation works properly since. At first glance, no errors in this process.
It looks like it could be automatically detected by our storage library. Reassigning to Blivet for further investigation.
Casper added a related benchmark with a comparison of 256bit AES (XTS-512) against 256bit XChaCha20, which illustrates the impact on machines without AES-NI: ``` blackbird:~ # cryptsetup benchmark -c xchacha20,aes-adiantum # Tests approximatifs en utilisant uniquement la mémoire (pas de stockage E/S). # Algorithme | Clé | Chiffrement | Déchiffrement xchacha20,aes-adiantum 256b 327,8 MiB/s 345,0 MiB/s ``` ``` blackbird:~ # cryptsetup benchmark -c aes-xts-plain64 --key-size 512 # Tests approximatifs en utilisant uniquement la mémoire (pas de stockage E/S). # Algorithme | Clé | Chiffrement | Déchiffrement aes-xts 512b 84,3 MiB/s 83,5 MiB/s ``` His note that Raspberry Pi models up to and including the current 4(B) have no AES-NI might be relevant, too. See devel mailing list topic "Hardware without AES-NI: use xchacha12/Adiantum instead of AES-XTS".