From: Herbert Xu Subject: Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc) Date: Thu, 23 Jun 2016 11:37:59 +0800 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 Cc: Andy Lutomirski , linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Johan Hedberg , Gustavo Padovan , Marcel Holtmann , linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "David S. Miller" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Linus Torvalds To: Andy Lutomirski Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-crypto.vger.kernel.org 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