Re: What is the aes-xts key-size?
Michael Kjörling <[email protected]> Tue, 25 Jul 2023 21:04:22 +0000
| Newsgroups | dev.linux.lists.cryptsetup |
|---|---|
| Message-ID | <[email protected]> |
On 25 Jul 2023 19:48 +0000, from [email protected] (Ronan Pigott): > What should the argument of --key-size be, 256 or 512, to achieve this superior > performance? 256. You can conclude this based on the output from the fact that there are no -xts lines with a 128 bit key size, nor any non-XTS lines with a 512 bit key size. Therefore the key size specified in the benchmark output must be the doubled key size, since the underlying AES cipher is only defined for key sizes of 128, 192 and 256 bits. Also, (the underlying) AES with a 128 bit key uses 10 encryption/decryption rounds; with a 256 bit key, it uses 14 rounds. Therefore AES-256 will always be slower than AES-128; although by less than 40%, since the key expansion prior to the encryption or decryption rounds takes non-zero time. Still, _I_ would probably use --key-size 512 for the extra security margin and the negligible (~10% in your case) loss in throughput. Whether you're getting 5.5 GiB/s or 6 GiB/s through LUKS is unlikely to be the limiting factor in I/O performance. SATA, for example, tops out at 6 Gbit/s; about a tenth of the throughput you're seeing. Even M.2 NVMe is (per Wikipedia) equal to up to four lanes of PCI Express 3.0, which would get you just under 4 GB/s theoretical maximum throughput, still well below saturating a 5-6 GB/s encryption pipeline. -- Michael Kjörling 🔗 https://michael.kjorling.se “Remember when, on the Internet, nobody cared that you were a dog?”