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 0B676C433EF for ; Fri, 15 Apr 2022 20:07:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350972AbiDOUJ6 (ORCPT ); Fri, 15 Apr 2022 16:09:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351017AbiDOUJq (ORCPT ); Fri, 15 Apr 2022 16:09:46 -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 E7124D8F7F for ; Fri, 15 Apr 2022 13:07:17 -0700 (PDT) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1nfSDg-0005eL-9y; Fri, 15 Apr 2022 22:07:04 +0200 Message-ID: <7c9c093a-cfb8-c997-87f8-db769eaa2c62@pengutronix.de> Date: Fri, 15 Apr 2022 22:07:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 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: Sumit Garg , David Gstir , Matthias Schiffer , "kernel@pengutronix.de" , Franck Lenormand , Richard Weinberger , Jan Luebbe , James Morris , Mimi Zohar , "linux-kernel@vger.kernel.org" , Eric Biggers , "linux-security-module@vger.kernel.org" , "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , David Howells , Jarkko Sakkinen , "linux-integrity@vger.kernel.org" , James Bottomley , "tharvey@gateworks.com" , "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: 2a0a:edc0:0:900:1d::77 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 28.03.22 11:29, Pankaj Gupta wrote: >>> 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. >> > > Please do. Thanks. I went with your other suggestion instead: void *input and void *output. This keeps the code simple and avoids having to do: if (encap) { in = info->key; in_len = info->key_len; out = info->blob_len; out_len = info->key_len + CAAM_BLOB_OVERHEAD; } else { in = info->blob; in_len = info->blob_len; out = info->key_len; out_len = info->blob_len - CAAM_BLOB_OVERHEAD; } > Patch 4/4, needs to be re-worked to. > >> Whats your opinion on the desc size computation? Comment the macro or >> add the static inline helper? >> > > Comment the macro is fine. > >> Cheers, >> Ahmad >> >> -- >> Pengutronix e.K. | | >> Steuerwalder Str. 21 | >> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww. >> pengutronix.de%2F&data=04%7C01%7Cpankaj.gupta%40nxp.com%7C4 >> d60f0d524a04b7cbd7b08da0d7e7d21%7C686ea1d3bc2b4c6fa92cd99c5c30163 >> 5%7C0%7C0%7C637837134158793951%7CUnknown%7CTWFpbGZsb3d8eyJWI >> joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3 >> 000&sdata=PetvZm8teusBwQ4BeZ1VLEOvBlCrZ2k2bNG3SJBEXPw%3D& >> amp;reserved=0 | >> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | >> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > > -- 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 |