From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311AbbFPCrF (ORCPT ); Mon, 15 Jun 2015 22:47:05 -0400 Received: from mga03.intel.com ([134.134.136.65]:19101 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750921AbbFPCqy (ORCPT ); Mon, 15 Jun 2015 22:46:54 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,622,1427785200"; d="scan'208";a="747326787" Message-ID: <557F8E04.7000209@intel.com> Date: Mon, 15 Jun 2015 19:46:28 -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, smueller@chronox.de, 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 v5 2/4] crypto: add PKE API References: <20150615201831.15697.57738.stgit@tstruk-mobl1> <20150615201842.15697.59701.stgit@tstruk-mobl1> <20150615235954.GC16562@gondor.apana.org.au> <557F883C.5040207@intel.com> <20150616022947.GB19040@gondor.apana.org.au> In-Reply-To: <20150616022947.GB19040@gondor.apana.org.au> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/15/2015 07:29 PM, Herbert Xu wrote: >> I thought that the ctx needs to be available for implementations to store private data. >> > This way we can allocate and store any type of key in the _parse_key() helper and still have the cxt >> > available for implementations to use for their stuff (e.g. HW context). > No for symmetric key algorithms we always store the key in the > context and never in the tfm proper. > > Think about it, the generic tfm doesn't have any idea on what > the key contains so how can it store it? Only the implementation > knows the key format and can store it in a useful way. Ok I wanted to handle everything in the parse_key helper without any help from the implementation. I can change the helper to return the key and implementation will store it in the ctx. Is this what you are suggesting?