Skip to contentSkip to conversation

Twofish 3-way

dm-crypt Heinz Diehl 3 participants 5 messages Jan 12, 2012 – Jan 15, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

since kernel 3.2 there is a new parallelized variant of twofish available via

CONFIG_CRYPTO_TWOFISH_X86_64_3WAY

How can I use it with LUKS/dmcrypt? My current config contains the following:

# CONFIG_CRYPTO_TWOFISH is not set
CONFIG_CRYPTO_TWOFISH_COMMON=y
CONFIG_CRYPTO_TWOFISH_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=y

How should these options be set up properly?

Thanks,
Heinz.

#1 lore raw
Quoted 10 lines · Heinz Diehl

Hi,

since kernel 3.2 there is a new parallelized variant of twofish available via

CONFIG_CRYPTO_TWOFISH_X86_64_3WAY

How can I use it with LUKS/dmcrypt? My current config contains the following:

Quoted 6 lines

# CONFIG_CRYPTO_TWOFISH is not set
CONFIG_CRYPTO_TWOFISH_COMMON=y
CONFIG_CRYPTO_TWOFISH_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=y

How should these options be set up properly?

You cannot set directly which version is used through dmcrypt interface, (without patching kernel source) but cryptoAPI should detect the fastest algorithm automatically.

For separate modules, force load just that module and unload all other should perhaps work as well (before crypto device activation).

(see /proc/crypto and lsmod modules reference count to check which one is really used)

Milan

#2 lore raw

Do I understand this right that this can only work if you have independent disk accesses? For a single sector, the mode would prevent any paralellization (unless you set ECB, which is definitely not a good idea).

Arno

Quoted 34 lines · Milan Broz
Quoted 10 lines · Heinz Diehl

Hi,

since kernel 3.2 there is a new parallelized variant of twofish available via

CONFIG_CRYPTO_TWOFISH_X86_64_3WAY

How can I use it with LUKS/dmcrypt? My current config contains the following:

Quoted 6 lines

# CONFIG_CRYPTO_TWOFISH is not set
CONFIG_CRYPTO_TWOFISH_COMMON=y
CONFIG_CRYPTO_TWOFISH_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=y

How should these options be set up properly?

You cannot set directly which version is used through dmcrypt interface, (without patching kernel source) but cryptoAPI should detect the fastest algorithm automatically.

For separate modules, force load just that module and unload all other should perhaps work as well (before crypto device activation).

(see /proc/crypto and lsmod modules reference count to check which one is really used)

Milan
_______________________________________________
dm-crypt mailing list
[email protected]
http://www.saout.de/mailman/listinfo/dm-crypt

Signature · 6 lines
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: [email protected] 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
One of the painful things about our time is that those who feel certainty 
are stupid, and those with any imagination and understanding are filled 
with doubt and indecision. -- Bertrand Russell 
#3 lore raw
Quoted 4 lines · Arno Wagner

Do I understand this right that this can only work if you have independent disk accesses? For a single sector, the mode would prevent any paralellization (unless you set ECB, which is definitely not a good idea).

Hm, right. But I think XTS can process blocks in one sector in parallel as well, but I just saw generic tcrypt tests
(http://www.spinics.net/lists/linux-crypto/msg06351.html),
not dmcrypt based numbers...

Milan

#4 lore raw
Quoted 4 lines · Milan Broz

Hm, right. But I think XTS can process blocks in one sector in parallel as well, but I just saw generic tcrypt tests
(http://www.spinics.net/lists/linux-crypto/msg06351.html),
not dmcrypt based numbers...

This raises an important question: is there any improvement in using 3-way twofish with LUKS/dmcrypt at all?