Return-Path: Received: from localhost (localhost [127.0.0.1]) by mail.saout.de (Postfix) with ESMTP id 2C09D943B for ; Sat, 8 Aug 2009 05:09:05 +0200 (CEST) Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P-D3+KWCsPLo for ; Sat, 8 Aug 2009 05:08:59 +0200 (CEST) Received: from arnor.apana.org.au (rhun.apana.org.au [64.62.148.172]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Sat, 8 Aug 2009 05:08:58 +0200 (CEST) Date: Sat, 8 Aug 2009 13:08:32 +1000 From: Herbert Xu Message-ID: <20090808030831.GA14172@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090805203017.GA5875@Chamillionaire.breakpoint.cc> Subject: Re: [dm-crypt] cryptsetup with arc4 cipher List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sebastian Andrzej Siewior Cc: dm-crypt@saout.de, Tan Swee Heng , sb-lst@enotty.net, linux-crypto@vger.kernel.org, mbroz@redhat.com Sebastian Andrzej Siewior wrote: > > The long story: > ARC4 is a stream cipher and not a block cipher. Its internal state is > reseted in setkey() and every crypto request (encrypt/decrypt don't > matter) update the internal state of the stream cipher. That's why you > get a different result every time you read the same block. Actually I think that's a bug. These ciphers really should not modify their tfm state between operations. Requiring a setkey before each new operation precludes parallel processing. I noticed that salsa seems to be broken in the same way, but at least it should be easy to fix. arc4 on the other hand needs to be converted to a blkcipher. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt