Enable aes-adiantum for linux-rpi4-mainline

Hello,

would it be possible to enable CONFIG_CRYPTO_ADIANTUM in linux-rpi4-mainline ?

I was looking forward to finally play around with cryptsetup and the adiantum cipher on the Raspberry Pi 4 now that kernel v5 is available . It should give much better performance for encrypted block devices on arm cpus without aes coprocessor/chip.

Also I was wondering where the PKGBUILD for linux-rpi4-mainline could be found ?

Thank you!

Best Regards,
Philipp Richter

Nice, the PKGBUILD and files are available here : https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-rpi4-mainline

I enabled

CONFIG_CRYPTO_ADIANTUM=m
CONFIG_CRYPTO_NHPOLY1305_NEON=m

benchmarks :

$ cryptsetup benchmark -c xchacha12,aes-adiantum
# Tests are approximate using memory only (no storage IO).
#            Algorithm |       Key |      Encryption |      Decryption
xchacha12,aes-adiantum        256b       187.9 MiB/s       208.0 MiB/s
$ cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1       390095 iterations per second for 256-bit key
PBKDF2-sha256     635500 iterations per second for 256-bit key
PBKDF2-sha512     505094 iterations per second for 256-bit key
PBKDF2-ripemd160  322044 iterations per second for 256-bit key
PBKDF2-whirlpool  109226 iterations per second for 256-bit key
argon2i       4 iterations, 337206 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id      4 iterations, 336996 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
#     Algorithm |       Key |      Encryption |      Decryption
        aes-cbc        128b        23.4 MiB/s        78.2 MiB/s
    serpent-cbc        128b               N/A               N/A
    twofish-cbc        128b        56.1 MiB/s        58.6 MiB/s
        aes-cbc        256b        17.4 MiB/s        59.0 MiB/s
    serpent-cbc        256b               N/A               N/A
    twofish-cbc        256b        58.2 MiB/s        58.9 MiB/s
        aes-xts        256b        85.7 MiB/s        75.7 MiB/s
    serpent-xts        256b               N/A               N/A
    twofish-xts        256b        60.3 MiB/s        61.6 MiB/s
        aes-xts        512b        66.0 MiB/s        57.7 MiB/s
    serpent-xts        512b               N/A               N/A
    twofish-xts        512b        62.4 MiB/s        61.6 MiB/s

adiantum gives a nice 3x performance improvement over the usual aes-xts

Looks like a good idea to go with adiantum for encrypted storage on the raspberry pi 4 :slight_smile:
Or any device lacking aes coprocessor

Forum kindly sponsored by