]> git.baikalelectronics.ru Git - kernel.git/commit
fscrypt: log the crypto algorithm implementations
authorEric Biggers <ebiggers@google.com>
Fri, 18 May 2018 17:58:14 +0000 (10:58 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 20 May 2018 20:36:00 +0000 (16:36 -0400)
commite40d4023e182a103220df3dd01c1c5b8d755b9ee
tree117f161d09722a1d412173ffae057177bb32a377
parent779b1698afa8966a3879c736c7c1c1c285a1992e
fscrypt: log the crypto algorithm implementations

Log the crypto algorithm driver name for each fscrypt encryption mode on
its first use, also showing a friendly name for the mode.

This will help people determine whether the expected implementations are
being used.  In some cases we've seen people do benchmarks and reject
using encryption for performance reasons, when in fact they used a much
slower implementation of AES-XTS than was possible on the hardware.  It
can make an enormous difference; e.g., AES-XTS on ARM is about 10x
faster with the crypto extensions (AES instructions) than without.

This also makes it more obvious which modes are being used, now that
fscrypt supports multiple combinations of modes.

Example messages (with default modes, on x86_64):

[   35.492057] fscrypt: AES-256-CTS-CBC using implementation "cts(cbc-aes-aesni)"
[   35.492171] fscrypt: AES-256-XTS using implementation "xts-aes-aesni"

Note: algorithms can be dynamically added to the crypto API, which can
result in different implementations being used at different times.  But
this is rare; for most users, showing the first will be good enough.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/crypto/keyinfo.c