Serpent missing

Post Reply
Soleil
Posts: 32
Joined: Tue Apr 30, 2019 9:20 am
languages_spoken: english
Has thanked: 0
Been thanked: 2 times
Contact:

Serpent missing

Unread post by Soleil » Sat May 04, 2019 6:40 am

Hi Guys,

Does anyone know why is Serpent missing on N2 Ubuntu?
The problem is that I've HDDs encrypted with Serpent and trying to open Luks gets:

Code: Select all

Check that kernel supports serpent-xts-essiv:sha256 cipher (check syslog for more info).
Kernel also reported:

Code: Select all

device-mapper: table: 252:0: crypt: Error allocating crypto tfm
device-mapper: ioctl: error adding target to table
Checking benchmarks gets same results - NA (see below).

There is Serpent on other Ubuntu Odroid releases, hence am wondering is it due to some issues on Arm side?

Code: Select all

#     Algorithm | Key |  Encryption |  Decryption
        aes-cbc   128b   321.9 MiB/s   281.4 MiB/s
    serpent-cbc   128b           N/A           N/A
    twofish-cbc   128b    63.4 MiB/s    65.0 MiB/s
        aes-cbc   256b   283.4 MiB/s   279.5 MiB/s
    serpent-cbc   256b           N/A           N/A
    twofish-cbc   256b    63.4 MiB/s    65.0 MiB/s
        aes-xts   256b   328.6 MiB/s   300.2 MiB/s
    serpent-xts   256b           N/A           N/A
    twofish-xts   256b    66.5 MiB/s    66.1 MiB/s
        aes-xts   512b   323.2 MiB/s   281.5 MiB/s
    serpent-xts   512b           N/A           N/A
    twofish-xts   512b    65.5 MiB/s    65.9 MiB/s

User avatar
odroid
Site Admin
Posts: 30667
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 98 times
Contact:

Re: Serpent missing

Unread post by odroid » Tue May 07, 2019 11:13 am

When we ran a sha256 acceleration test with openssl speed sha256 command, it worked well.

Anyway, can you check this Kernel config in other ODROID board?
https://github.com/hardkernel/linux/blo ... nfig#L6092

Soleil
Posts: 32
Joined: Tue Apr 30, 2019 9:20 am
languages_spoken: english
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Serpent missing

Unread post by Soleil » Tue May 07, 2019 5:15 pm

I've just one unit and zcat /proc/config.gz shows below, which clearly explains why serpent is missing.

It is not about sha256, it is about cipher not included neither as module or directly in kernel (serpent):

Code: Select all

#
# Ciphers
#
CONFIG_CRYPTO_AES=y
# CONFIG_CRYPTO_ANUBIS is not set
CONFIG_CRYPTO_ARC4=y
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
CONFIG_CRYPTO_DES=y
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_CHACHA20 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_SPECK is not set
# CONFIG_CRYPTO_TEA is not set
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
Running openssl speed test works fine as sha256 routine does not depend on ciphers:

Code: Select all

# openssl speed sha256
Doing sha256 for 3s on 16 size blocks: 17731240 sha256's in 3.00s
Doing sha256 for 3s on 64 size blocks: 12572765 sha256's in 3.00s
Doing sha256 for 3s on 256 size blocks: 6830708 sha256's in 3.00s
Doing sha256 for 3s on 1024 size blocks: 2414014 sha256's in 3.00s
Doing sha256 for 3s on 8192 size blocks: 341124 sha256's in 3.00s
Doing sha256 for 3s on 16384 size blocks: 172860 sha256's in 3.00s
OpenSSL 1.1.0g  2 Nov 2017
built on: reproducible build, date unspecified
options:bn(64,64) rc4(char) des(int) aes(partial) blowfish(ptr) 
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/lib/ssl\"" -DENGINESDIR="\"/usr/lib/aarch64-linux-gnu/engines-1.1\"" 
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
sha256           94566.61k   268218.99k   582887.08k   823983.45k   931495.94k   944046.08k

User avatar
odroid
Site Admin
Posts: 30667
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 98 times
Contact:

Re: Serpent missing

Unread post by odroid » Tue May 07, 2019 5:20 pm

Should we enable all the Ciphers related drivers as modules or built-in?
Or, enabling CONFIG_CRYPTO_SERPENT module must be enough?

Soleil
Posts: 32
Joined: Tue Apr 30, 2019 9:20 am
languages_spoken: english
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Serpent missing

Unread post by Soleil » Wed May 08, 2019 1:28 am

I'd say that as modules are standard practice, that would be preferred solution. Otherwise others, who don't need it could complain about kernel size. With modern kernels there are no real advantages (performance wise) if something is compiled as module vs built in kernel - unless something has changed recently or is specific for ARM architecture.

User avatar
mad_ady
Posts: 5838
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 72 times
Been thanked: 41 times
Contact:

Re: Serpent missing

Unread post by mad_ady » Wed May 08, 2019 3:36 am

It might make a difference for those mounting encrypted rootfs on boot.

Soleil
Posts: 32
Joined: Tue Apr 30, 2019 9:20 am
languages_spoken: english
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Serpent missing

Unread post by Soleil » Sat May 11, 2019 9:15 am

True, I was still in the world of initrd beauty.
Didn't bother to try yet: viewtopic.php?t=7965
Would that work?
Equally everyone could go and build their own kernel, if the process could be made simple = scripted.
Have simple and single file with:
# config option override setting
with automated compilation.

Just another thought.

User avatar
odroid
Site Admin
Posts: 30667
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 98 times
Contact:

Re: Serpent missing

Unread post by odroid » Mon May 13, 2019 9:26 am

The next Kernel package will have the modules and it will available by end of this week.
https://github.com/hardkernel/linux/com ... 5808ddbe83

If you want to build your own kernel, refer this guide.
https://wiki.odroid.com/odroid-n2/softw ... d-n2ubuntu

User avatar
odroid
Site Admin
Posts: 30667
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 98 times
Contact:

Re: Serpent missing

Unread post by odroid » Fri May 17, 2019 5:02 pm

4.9.177 has been released.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: easybob95 and 0 guests