Helios4 - Cryptographic Engines And Security Accelerator (CESA) Benchmarking


Recommended Posts

@jsr my bad for the filename. Will check on my box as soon as I can.
Can you also do cryptsetup benchmark? I wonder if the names in crypto and the ones used by cryptsetup might have changed somehow.
Can you also share syslog of your box? The Marvell crypto drivers are also announced there, something might be off.
(Note I'm not an expert in this crypto business so I might be barking up the verkeerde boom.)
Groetjes,

Sent from my SM-T500 using Tapatalk

Link to post
Share on other sites
Donate and support the project!

Hi @djurny, here you go:


cryptsetup benchmark:

# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1       258524 iterations per second for 256-bit key
PBKDF2-sha256     364595 iterations per second for 256-bit key
PBKDF2-sha512     179550 iterations per second for 256-bit key
PBKDF2-ripemd160  191345 iterations per second for 256-bit key
PBKDF2-whirlpool   28370 iterations per second for 256-bit key
argon2i       4 iterations, 71599 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id      4 iterations, 73566 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
#     Algorithm |       Key |      Encryption |      Decryption
        aes-cbc        128b        95.1 MiB/s        98.1 MiB/s
    serpent-cbc        128b        27.6 MiB/s        30.7 MiB/s
    twofish-cbc        128b        40.3 MiB/s        45.4 MiB/s
        aes-cbc        256b        90.7 MiB/s        93.1 MiB/s
    serpent-cbc        256b        28.0 MiB/s        31.3 MiB/s
    twofish-cbc        256b        41.2 MiB/s        46.2 MiB/s
        aes-xts        256b        62.7 MiB/s        54.9 MiB/s
    serpent-xts        256b        29.7 MiB/s        31.1 MiB/s
    twofish-xts        256b        44.0 MiB/s        45.7 MiB/s
        aes-xts        512b        47.7 MiB/s        41.5 MiB/s
    serpent-xts        512b        29.8 MiB/s        31.1 MiB/s
    twofish-xts        512b        44.0 MiB/s        45.7 MiB/s

 

interesting, I do see CESA interrupts count up from the cryptsetup benchmark:

 48:      24618          0     GIC-0  51 Level     f1090000.crypto
 49:          0          0     GIC-0  52 Level     f1090000.crypto

 

syslog: https://pastebin.com/AacFP5R8

 

Thanks!

Link to post
Share on other sites

I observe the same behavior. It  seems to be linked to the introduction of the ESSIV kernel module in Linux Kernel 5.4

 

When creating and opening a new LUKS2 device, I can still see the interrupt of the crypto engine increasing. However when exercising the mounted encrypted device I don't see anymore increase of interrupt. What I realized is that there is this module essiv that get loaded and it seems to suggest it bypass the CESA crypto engine.

 

We need to find a way to force dm-crypt to use marvell_cesa

 

root@helios4:~# cat /proc/crypto 
name         : essiv(cbc(aes),sha256)
driver       : essiv(cbc(aes-generic),sha256-generic)
module       : essiv
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16

[...]

name         : cbc(aes)
driver       : mv-cbc-aes
module       : marvell_cesa
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : yes
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16

 

 

Link to post
Share on other sites
On 4/6/2021 at 12:10 PM, gprovost said:

I observe the same behavior. It  seems to be linked to the introduction of the ESSIV kernel module in Linux Kernel 5.4

 

When creating and opening a new LUKS2 device, I can still see the interrupt of the crypto engine increasing. However when exercising the mounted encrypted device I don't see anymore increase of interrupt. What I realized is that there is this module essiv that get loaded and it seems to suggest it bypass the CESA crypto engine.

 

We need to find a way to force dm-crypt to use marvell_cesa

[..]

 

I also see the same. Tried simple things, like blacklisting essiv kernel module, but that prevents cryptsetup from working at all. There seems to be a dependency of the authenc kernel module to essiv. Not sure what it was before, as I don't have any box running on older kernel at the moment:

filename:       /lib/modules/5.10.21-mvebu/kernel/crypto/essiv.ko
[..]
depends:        authenc
intree:         Y
name:           essiv
[..]

 

Without authenc, crytpsetup starts complaining:

Apr  7 22:52:04 localhost kernel: [  126.468108] device-mapper: ioctl: error adding target to table
Apr  7 22:53:36 localhost kernel: [  218.613317] essiv: Unknown symbol crypto_authenc_extractkeys (err -2)

 

Groetjes,

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...