From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753736AbbFDRXL (ORCPT ); Thu, 4 Jun 2015 13:23:11 -0400 Received: from mga01.intel.com ([192.55.52.88]:30311 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348AbbFDRXH (ORCPT ); Thu, 4 Jun 2015 13:23:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,553,1427785200"; d="scan'208";a="502817857" Message-ID: <55708986.5030506@intel.com> Date: Thu, 04 Jun 2015 10:23:18 -0700 From: Tadeusz Struk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Herbert Xu CC: linux-kernel@vger.kernel.org, keescook@chromium.org, jwboyer@redhat.com, richard@nod.at, steved@redhat.com, qat-linux@intel.com, dhowells@redhat.com, linux-crypto@vger.kernel.org, james.l.morris@oracle.com, jkosina@suse.cz, zohar@linux.vnet.ibm.com, davem@davemloft.net, vgoyal@redhat.com Subject: Re: [PATCH RFC v3 1/3] crypto: add PKE API References: <20150603224403.22310.79731.stgit@tstruk-mobl1> <20150603224408.22310.45114.stgit@tstruk-mobl1> <20150604064929.GA22158@gondor.apana.org.au> In-Reply-To: <20150604064929.GA22158@gondor.apana.org.au> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Herbert, On 06/03/2015 11:49 PM, Herbert Xu wrote: > Because the caller is going to be allocating memory for the output, > we need to provide a way for them to know how much memory to > allocate. > > This presumably will depend on the key size. > > So something like > > int (*maxsize)(struct crypto_akcipher *tfm); > > is needed. > > You should also provide setkey here. You can't just save a pointer > to the key. The transform must hold the key physically as the > original may go away. It should also ensure that the key is > actually valid for the transform. > > base already has ctx so you should get rid of ctx and move base > to the end of the struct. right, will do that. Thanks for quick response.