mirror of
https://github.com/torvalds/linux.git
synced 2026-09-26 01:52:03 +02:00
Add support for AES-XTS to the crypto library. This will be used to provide a streamlined implementation of the "xts(aes)" crypto_skcipher algorithm. I'm also planning to use this directly in fscrypt and blk-crypto-fallback. As usual, the architecture-optimized AES-XTS code will be migrated into the library as well (using the hooks provided in this commit), eliminating lots of repetitive boilerplate code. Compared to direct implementation of "xts(aes)", I've also eliminated the requirement for architectures to implement ciphertext stealing, as the library just handles it portably instead. That will simplify things considerably. Initial test coverage is provided by the crypto_skcipher support added in a later commit. I'm planning a KUnit test suite as well. Link: https://patch.msgid.link/20260715221153.246410-6-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
50 lines
1.3 KiB
ReStructuredText
50 lines
1.3 KiB
ReStructuredText
.. SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
Unauthenticated encryption
|
|
==========================
|
|
|
|
These APIs provide support for unauthenticated encryption and decryption,
|
|
including bare stream ciphers and other length-preserving algorithms such as
|
|
block ciphers in XTS mode. The legitimate use cases for these algorithms are:
|
|
|
|
- Support for legacy protocols that really should have chosen an authenticated
|
|
mode (or even another primitive entirely) but didn't.
|
|
|
|
- Internal components of authenticated modes. For example, AES-CTR is used by
|
|
AES-GCM and AES-CCM internally.
|
|
|
|
- Storage encryption that cannot accommodate ciphertext expansion. Usually
|
|
AES-XTS is used for this.
|
|
|
|
- Stream ciphers for key derivation and random number generation.
|
|
|
|
Besides the above, these shouldn't be used.
|
|
|
|
AES-CBC and AES-CBC-CTS
|
|
-----------------------
|
|
|
|
This API provides support for AES in the CBC and CBC-CTS modes of operation.
|
|
|
|
.. kernel-doc:: include/crypto/aes-cbc.h
|
|
|
|
AES-CTR and AES-XCTR
|
|
--------------------
|
|
|
|
This API provides support for AES in the CTR and XCTR modes of operation.
|
|
|
|
.. kernel-doc:: include/crypto/aes-ctr.h
|
|
|
|
AES-ECB
|
|
-------
|
|
|
|
This API provides support for AES in the ECB mode of operation.
|
|
|
|
.. kernel-doc:: include/crypto/aes-ecb.h
|
|
|
|
AES-XTS
|
|
-------
|
|
|
|
This API provides support for AES in the XTS mode of operation.
|
|
|
|
.. kernel-doc:: include/crypto/aes-xts.h
|