From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6369C433EF for ; Thu, 24 Mar 2022 10:10:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349324AbiCXKMJ (ORCPT ); Thu, 24 Mar 2022 06:12:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236564AbiCXKMG (ORCPT ); Thu, 24 Mar 2022 06:12:06 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 020969F6FB for ; Thu, 24 Mar 2022 03:10:34 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1nXKQ1-0008Dj-FI; Thu, 24 Mar 2022 11:10:13 +0100 Message-ID: Date: Thu, 24 Mar 2022 11:10:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [EXT] [PATCH v6 3/4] crypto: caam - add in-kernel interface for blob generator Content-Language: en-US To: Pankaj Gupta , Horia Geanta , Herbert Xu , "David S. Miller" Cc: "linux-security-module@vger.kernel.org" , Eric Biggers , David Gstir , Matthias Schiffer , Sumit Garg , Jan Luebbe , Richard Weinberger , "tharvey@gateworks.com" , Franck Lenormand , James Morris , Mimi Zohar , "linux-kernel@vger.kernel.org" , David Howells , Jarkko Sakkinen , "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "kernel@pengutronix.de" , "linux-integrity@vger.kernel.org" , James Bottomley , "Serge E. Hallyn" References: <20220316164335.1720255-1-a.fatoum@pengutronix.de> <20220316164335.1720255-4-a.fatoum@pengutronix.de> From: Ahmad Fatoum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Pankaj, On 24.03.22 10:55, Pankaj Gupta wrote: > Hi Ahmad, > > Please find the comments in-line. Thanks for you review. > Suggest to continue to use two separate descriptor-creation-function for 'encap' and 'decap'. > This will help these API(s) to be maintained easily going forward. We can still split them up in future once there is a real need. But currently they are exactly the same, except for input/output length, so I think it's correct to not introduce duplication unless needed. >> - use append_seq_(in|out)_ptr_intlen for both encap/decap as a result Case in point. The intlen omission was because the two functions are largely identical and I only fixed up one of them. This is prone to repeat when we go back to have identical code with minor differences. > In continuation to the previous comment, there is another suggestion: > > Either: > struct keyblob_info { > void *key; > size_t key_len; > > void *blob; > size_t blob_len; > > size_t key_mod_len; > const void *key_mod; > }; I can do that. Whats your opinion on the desc size computation? Comment the macro or add the static inline helper? Cheers, Ahmad -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |