crypto/arc4: now arc needs blockcipher support
PATCH 1/1 crypto/arc4: now arc needs blockcipher support
Since commit ce6dd368 ("crypto: arc4 - improve performance by adding ecb(arc4)) we need to pull in a blkcipher.
|ERROR: "crypto_blkcipher_type" [crypto/arc4.ko] undefined! |ERROR: "blkcipher_walk_done" [crypto/arc4.ko] undefined! |ERROR: "blkcipher_walk_virt" [crypto/arc4.ko] undefined!
---
On a side note: do we pull in the blkcipher block mode for each cipher now to gain some extra performance like the openssl project? I was under the impression that is in general not worth it.
crypto/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/Kconfig +1 -1
@@ -593,7 +593,7 @@ config CRYPTO_ANUBIS config CRYPTO_ARC4 tristate "ARC4 cipher algorithm" - select CRYPTO_ALGAPI + select CRYPTO_BLKCIPHER help ARC4 cipher algorithm.
Signature · 1 line
1.7.10
Quoted 7 lines · Sebastian Andrzej Siewior
Since commit
ce6dd368("crypto: arc4 - improve performance by adding ecb(arc4)) we need to pull in a blkcipher.|ERROR: "crypto_blkcipher_type" [crypto/arc4.ko] undefined! |ERROR: "blkcipher_walk_done" [crypto/arc4.ko] undefined! |ERROR: "blkcipher_walk_virt" [crypto/arc4.ko] undefined!
Quoted 6 lines
Signed-off-by Sebastian Andrzej Siewior <[email protected]>---
On a side note: do we pull in the blkcipher block mode for each cipher now to gain some extra performance like the openssl project? I was under the impression that is in general not worth it.
Arc4 is a stream cipher, NOT a block cipher. They are completely different things, and the requirements for using them securely are different. In particular, modes like ECB apply to block ciphers not to stream ciphers.
Unless these changes have been thoroughly analyzed by several people who actually know crypto, they should be immediately reverted.
Quoting Sandy Harris <[email protected]>:
Quoted 16 lines
Quoted 7 lines · Sebastian Andrzej Siewior
Since commit
ce6dd368("crypto: arc4 - improve performance by adding ecb(arc4)) we need to pull in a blkcipher.|ERROR: "crypto_blkcipher_type" [crypto/arc4.ko] undefined! |ERROR: "blkcipher_walk_done" [crypto/arc4.ko] undefined! |ERROR: "blkcipher_walk_virt" [crypto/arc4.ko] undefined!Quoted 6 lines
Signed-off-by Sebastian Andrzej Siewior <[email protected]>---
On a side note: do we pull in the blkcipher block mode for each cipher now to gain some extra performance like the openssl project? I was under the impression that is in general not worth it.
Quoted 6 lines
Arc4 is a stream cipher, NOT a block cipher. They are completely different things, and the requirements for using them securely are different. In particular, modes like ECB apply to block ciphers not to stream ciphers.
Unless these changes have been thoroughly analyzed by several people who actually know crypto, they should be immediately reverted.
The 'arc4' is defined as one-byte cipher (that modifies its context to remember current stream state) and ecb module is just used to make arc4 iterate throught variable length buffers. 'ecb(arc4)' is then the actual stream cipher, with confusing and wrong name. I guess now that 'ecb(arc4)' is moved to arc4 module completely, it could be renamed to 'arc4stream' and in-kernel arc4 users which to use that.
-Jussi
Herbert Xu
maintainerQuoted 8 lines · Sebastian Andrzej Siewior
Since commit
ce6dd368("crypto: arc4 - improve performance by adding ecb(arc4)) we need to pull in a blkcipher.|ERROR: "crypto_blkcipher_type" [crypto/arc4.ko] undefined! |ERROR: "blkcipher_walk_done" [crypto/arc4.ko] undefined! |ERROR: "blkcipher_walk_virt" [crypto/arc4.ko] undefined!Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Patch applied. Thanks!
Quoted 3 lines
On a side note: do we pull in the blkcipher block mode for each cipher now to gain some extra performance like the openssl project? I was under the impression that is in general not worth it.
You mean normal block ciphers? Does it really make that much of a difference?
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 6 lines · Herbert Xu
Quoted 3 lines
On a side note: do we pull in the blkcipher block mode for each cipher now to gain some extra performance like the openssl project? I was under the impression that is in general not worth it.
You mean normal block ciphers? Does it really make that much of a difference?
Yes. Jussi added block mode for RC4 instead that auto block-mode that is prefered over the "automatic" one that is generated otherwise. I don't know how much performance it brings but I would be supprised if it is a lot on an average CPU. With this patch in I think it is a matter of time until we get the AES-CBC & and friends block mode optimized code (which should be a little faster since comparing to calling a function call for the XOR…) you get the idea.
Sebastian
Quoting Sebastian Andrzej Siewior <[email protected]>:
Quoted 17 lines · Herbert Xu
Quoted 7 lines
Quoted 1 line
On a side note: do we pull in the blkcipher block mode for each
cipher now to
Quoted 2 lines
gain some extra performance like the openssl project? I was under the impression that is in general not worth it.
You mean normal block ciphers? Does it really make that much of a difference?
Yes. Jussi added block mode for RC4 instead that auto block-mode that is prefered over the "automatic" one that is generated otherwise. I don't know how much performance it brings but I would be supprised if it is a lot on an average CPU. With this patch in I think it is a matter of time until we get the AES-CBC & and friends block mode optimized code (which should be a little faster since comparing to calling a function call for the XOR…) you get the idea.
Quoted 2 lines
Sebastian
I made quick tests with aes_generic, added block iterating loop into aes_encrypt() and aes_decrypt() and registered ecb(aes). Encryption 0.97x vs auto block-mode, decryption 1.03x. So I'd think, for real block ciphers, it makes no difference if looping is in ecb-module or in cipher module. ARC4 performance difference can be found in d366db605c8c4a9878589bc4a87e55f6063184ac commit log.
-Jussi