Return-Path: Date: Thu, 23 Jun 2016 11:37:59 +0800 From: Herbert Xu To: Andy Lutomirski Cc: Andy Lutomirski , linux-bluetooth@vger.kernel.org, Johan Hedberg , Gustavo Padovan , Marcel Holtmann , linux-crypto@vger.kernel.org, "David S. Miller" , "linux-kernel@vger.kernel.org" , Linus Torvalds Subject: Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc) Message-ID: <20160623033758.GA7819@gondor.apana.org.au> References: <20160622004214.GA27134@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-ID: On Wed, Jun 22, 2016 at 02:48:24PM -0700, Andy Lutomirski wrote: > > Before I do this, can you explain what the difference is between > crypto_cipher and crypto_skcipher? net/bluetooth/smp.c currently uses > crypto_alloc_skcipher, which you added in: crypto_cipher operates on a single block. crypto_skcipher uses modes of operations and works on multiple blocks. > > commit 71af2f6bb22a4bf42663e10f1d8913d4967ed07f > Author: Herbert Xu > Date: Sun Jan 24 21:18:30 2016 +0800 > > Bluetooth: Use skcipher and hash > > Am I just supposed to replace "skcipher" with "cipher" everywhere? If you're operating on one block only then you should use cipher, otherwise skcipher would be the appropriate choice. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt