therealromster / cryptsetup

Automatically exported from code.google.com/p/cryptsetup
GNU General Public License v2.0
0 stars 0 forks source link

REQUIRED CIPHERS TEST takes very long and gives too high numbers for aes-based ciphers. #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello cryptsetup hackers!

Here is how to reproduce the issue on my computer with a i5-4670K.

1. # wget http://cryptsetup.googlecode.com/files/cryptsetup-1.6.2.tar.bz2
   # bunzip2 -c cryptsetup-1.6.2.tar.bz2 | tar xpf -
   # cd cryptsetup-1.6.2

2. cryptsetup-1.6.2 # ./configure
For output see file configure.

3. cryptsetup-1.6.2 # make
For output see file make.

4. cryptsetup-1.6.2 # cd tests
   tests # make api-test differ
For output see file api-test.

5. tests # make check-TESTS
   (text omitted)
   REQUIRED CIPHERS TEST
   #  Algorithm | Key |  Encryption |  Decryption
        aes-cbc   256b   919.0 MiB/s  2392638.0 MiB/s
        aes-lrw   384b  1531.5 MiB/s  1525.0 MiB/s
        aes-xts   512b  2086464.0 MiB/s  2087554.0 MiB/s
   (text omitted)
For full output see file check-TESTS

The numbers bigger than 1TiB/s seem too big.

The command "make check-TESTS" took over one hour while spending nearly
all of its time exactly before outputting the suspicious numbers.

I removed the distribution supplied cryptsetup from the system and
installed the compiled version with "make install".

As requested in the mailing list I provide the output of
 - "cryptsetup benchmark --debug" in the file cryptsetupbench,
 - "lsmod" in the file lsmod,
 - "cat /proc/crypto" in the file proccrypto and
 - "uname -a" in the file uname-a.

Thanks for looking into this!

Best regards,
Christian Weinz

Original issue reported on code.google.com by christia...@gmail.com on 28 Nov 2013 at 11:27

Attachments:

GoogleCodeExporter commented 9 years ago
> I removed the distribution supplied cryptsetup from the system and
> installed the compiled version with "make install".

Are you sure you removed even old libcrypsetup library?
This message says that that it tries to load _old_ library...

cryptsetup: relocation error: cryptsetup: symbol crypt_benchmark_kdf, version 
CRYPTSETUP_1.0 not defined in file libcryptsetup.so.4 with link time reference

(my mistake I did no increase version here to prevent load on sw level)

Original comment by gmazyl...@gmail.com on 29 Nov 2013 at 10:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
No, I didn't remove the old libraries. Now I did and you can
see the output of "cryptsetup benchmark --debug" in the file
cryptsetupbench2 in the attachment.

Original comment by christia...@gmail.com on 29 Nov 2013 at 11:38

Attachments:

GoogleCodeExporter commented 9 years ago
This issue also occurs with version 1.6.1 and 1.6.0.

Original comment by christia...@gmail.com on 29 Nov 2013 at 2:48

GoogleCodeExporter commented 9 years ago
Ok, seems the measurement loop need to scale with CPU speed better (encryption 
is too fast, resulting in measurement of zero time so required sum of 1000ms of 
encryption time takes really long and speed result is of course nonsense :)

(KDF test uses such scaling, no idea why i did not used it here as well...)

I will fix this once I have access to some fast machine for testing, will 
update this issue then.

Thanks for report!

Original comment by gmazyl...@gmail.com on 29 Nov 2013 at 3:39

GoogleCodeExporter commented 9 years ago
I believe I fixed it with commit
http://code.google.com/p/cryptsetup/source/detail?r=f3e398afc54948fd95a811e0270b
bdd5d5689efd

Please can you try to run version from git if it helps on your system?

Thanks.

Original comment by gmazyl...@gmail.com on 1 Dec 2013 at 10:03

GoogleCodeExporter commented 9 years ago
I can't configure/compile the git version.
Here is what I did:

1) Get the git version:
git clone https://code.google.com/p/cryptsetup/
cd cryptsetup
2) Install packages I know that are needed:
apt-get install autoconf autpoint libtool uuid-dev libdevmapper-dev libpopt-dev
3) Run ./autogen.sh. See output in file autogen.
4) Run ./configure. See output in file configure2.

Original comment by christia...@gmail.com on 3 Dec 2013 at 4:57

Attachments:

GoogleCodeExporter commented 9 years ago
Seems like gcrypt devel-autoconf files are missing. What distro is this? I see 
only libgcrypt11-dev version 1.5.3-2 on Debian and this works...

Original comment by gmazyl...@gmail.com on 3 Dec 2013 at 6:40

GoogleCodeExporter commented 9 years ago
ok, seems it is new Ubuntu :) This fixed it for me:
apt-get install libgcrypt11-dev
(or libgcrypt20-dev in your case)

Original comment by gmazyl...@gmail.com on 3 Dec 2013 at 8:32

GoogleCodeExporter commented 9 years ago
Yes, I was running Ubuntu 13.10.

This issue is fixed for me in the git version.

Thank you!

Original comment by christia...@gmail.com on 3 Dec 2013 at 9:53

GoogleCodeExporter commented 9 years ago
Btw, I installed libgcrypt11-dev (not libgcrypt20-dev).

Original comment by christia...@gmail.com on 3 Dec 2013 at 10:00

GoogleCodeExporter commented 9 years ago
Ok, thanks.

Original comment by gmazyl...@gmail.com on 4 Dec 2013 at 5:17