Hi,
We enabled the crypto driver on Orin NX after setting up disk encryption-
test@test:~# find /proc/device-tree/ -iname '*crypto*'
/proc/device-tree/bus@0/host1x@13e00000/crypto@15820000
/proc/device-tree/bus@0/host1x@13e00000/crypto@15840000
test@test:~#
test@test:~# cat /proc/device-tree/bus@0/host1x@13e00000/crypto@15820000/status
okay
test@test:~#
test@test:~# cat /proc/device-tree/bus@0/host1x@13e00000/crypto@15840000/status
okay
But we noticed that the encryption/ decryption speeds with and without the tegra-crypto
driver is noticeably different.
Without the tegra-crypto
driver enabled-
test@test:~# cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 842906 iterations per second for 256-bit key
PBKDF2-sha256 1524093 iterations per second for 256-bit key
PBKDF2-sha512 688041 iterations per second for 256-bit key
PBKDF2-ripemd160 411529 iterations per second for 256-bit key
PBKDF2-whirlpool 238312 iterations per second for 256-bit key
argon2i 4 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id 4 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 701.7 MiB/s 1682.6 MiB/s
serpent-cbc 128b N/A N/A
twofish-cbc 128b N/A N/A
aes-cbc 256b 561.4 MiB/s 1452.1 MiB/s
serpent-cbc 256b N/A N/A
twofish-cbc 256b N/A N/A
aes-xts 256b 1152.9 MiB/s 1161.6 MiB/s
serpent-xts 256b N/A N/A
twofish-xts 256b N/A N/A
aes-xts 512b 1016.7 MiB/s 1016.3 MiB/s
serpent-xts 512b N/A N/A
twofish-xts 512b N/A N/A
With the tegra-crypto
driver enabled-
test@test:~# cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 841553 iterations per second for 256-bit key
PBKDF2-sha256 1524093 iterations per second for 256-bit key
PBKDF2-sha512 688946 iterations per second for 256-bit key
PBKDF2-ripemd160 411529 iterations per second for 256-bit key
PBKDF2-whirlpool 238746 iterations per second for 256-bit key
argon2i 4 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id 4 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 92.8 MiB/s 211.6 MiB/s
serpent-cbc 128b N/A N/A
twofish-cbc 128b N/A N/A
aes-cbc 256b 71.7 MiB/s 172.0 MiB/s
serpent-cbc 256b N/A N/A
twofish-cbc 256b N/A N/A
aes-xts 256b 210.4 MiB/s 210.9 MiB/s
serpent-xts 256b N/A N/A
twofish-xts 256b N/A N/A
aes-xts 512b 171.4 MiB/s 170.0 MiB/s
serpent-xts 512b N/A N/A
twofish-xts 512b N/A N/A
Is there something I’ve missed? Is there a better way to check why the speed is slower?
Thanks,
K