From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964834AbbJ0PUM (ORCPT ); Tue, 27 Oct 2015 11:20:12 -0400 Received: from mga02.intel.com ([134.134.136.20]:19918 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932372AbbJ0PUK (ORCPT ); Tue, 27 Oct 2015 11:20:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,205,1444719600"; d="scan'208";a="836654355" Subject: Re: [PATCH v2 0/5] crypto: add algif_akcipher user space API To: Marcel Holtmann , Stephan Mueller References: <1831785.BBs8Hj3CxY@myon.chronox.de> Cc: Herbert Xu , linux-crypto@vger.kernel.org, linux-kernel , linux-api@vger.kernel.org, David Howells , David Woodhouse From: Tadeusz Struk Message-ID: <562F9565.3090005@intel.com> Date: Tue, 27 Oct 2015 08:16:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: 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 Hi Marcel, On 10/26/2015 09:54 PM, Marcel Holtmann wrote: > after having discussions with David Howells and David Woodhouse, I don't think we should expose akcipher via AF_ALG at all. I think the akcipher operations for sign/verify/encrypt/decrypt should operate on asymmetric keys in the first place. With akcipher you are pretty much bound to public and private keys and the key is the important part and not the akcipher itself. Especially since we want to support private keys in hardware (like TPM for example). > > It seems more appropriate to use keyctl to derive the symmetric session key from your asymmetric key. And then use the symmetric session key id with skcipher via AF_ALG. Especially once symmetric key type has been introduced this seems to be trivial then. > > I am not really in favor of having two userspace facing APIs for asymmetric cipher usage. And we need to have an API that is capable to work with hardware keys. The main use case for algif_akcipher will be to allow a web server, which needs to handle tens of thousand TLS handshakes per second, to offload the RSA operation to a HW accelerator. Do you think we can use keyctl for this? Thanks, T