From: Stephan Mueller Subject: Re: [PATCH] fscrypt: add support for ChaCha20 contents encryption Date: Fri, 08 Dec 2017 11:14:54 +0100 Message-ID: <6974144.ZTrPlmK77A@tauon.chronox.de> References: <20171208013838.105034-1-ebiggers3@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Eric Biggers , linux-fscrypt@vger.kernel.org, Theodore Ts'o , linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, "linux-crypto@vger.kernel.org" , Jaegeuk Kim , Michael Halcrow , Paul Crowley , Martin Willi , David Gstir , "Jason A . Donenfeld" , Eric Biggers To: Ard Biesheuvel Return-path: In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org List-Id: linux-ext4.vger.kernel.org Am Freitag, 8. Dezember 2017, 11:06:31 CET schrieb Ard Biesheuvel: Hi Ard, > > Given how it is not uncommon for counters to be used as IV, this is a > fundamental flaw that could rear its head in other places as well, so > I propose we fix this one way (fix the current code) or the other > (deprecate the current code and create a new chacha20-rfc7539 > blockcipher that uses a 96-bit IV and sets the counter to 0) Instead of having a complete new implementation of the ChaCha20 cipher, what about using a specific IV generator for which the kernel crypto API has already support (see crypto/seqiv.c for example)? I.e. we have the current ChaCha20 cipher, but use some "rfc7539iv(chacha20)" cipher mode where that rfc7539iv is the mentioned IV generator that turns the given IV (sector number?) into the proper IV for ChaCha20. Ciao Stephan