Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp984096pxb; Fri, 15 Apr 2022 17:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY60itbLrAkSbwRvPfIP2aBL0qz78MKBEneyGMqGB1dPI3V+1ZXYP+0eQPHyANDXGyO3q9 X-Received: by 2002:a05:6a00:174f:b0:4fd:aed5:b5e4 with SMTP id j15-20020a056a00174f00b004fdaed5b5e4mr1290834pfc.39.1650068662719; Fri, 15 Apr 2022 17:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650068662; cv=none; d=google.com; s=arc-20160816; b=gkMc9j5jbomUhq7A9Sj1QypPLK7KAV4oi9KIYcVkn0xiuCyKhBPGtmvF0ZQrJl+uCi n53DeDttJKirJW95Q1c7ZXJZPa1FcaX4Ciyb+xup1bJ2qzmff7FZh+/ga25lBdEAaSRI /nTb9Oq/26vzaAVlzYkA/XJVzoMDgOJvVNNyM1uka9diircpvCHXHck2s4Kg09TaT9vC ZJuwgOn60fHf+48N9Uw/qrDX1QMY8Zcz74uDo9ftYlleWrzyPB+O84j64VQRGy21zIYX y1th8wPtKj9MRoTQrUOzZqvRMwQqfrdXuM0w76B2EmBEw2wPVsPKFdcm5gXh3Yusgxja Anog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=GuT34hYCIXqjSnMyzV8NrG+Pz0TdCKrNTLmFj4X30Po=; b=QY0REm5S5cBx/qFWl5Ssy1sUP3j/bmfso+cq3YCrWGARGMZF08iOH3XxNp/FEfs3jw BKV2rx+kDsuNIh8muK4cv5aGXDSm4YVrcdMqvEgKUplonqKM0Z+0ortwvAMKAAGoQKMz jJR0CnhLhVls8O3PKc8du2pTqO16p0yRx8aXaBtiyri3VzrvXSPWp0r8Hp6NjLpMtcug F4DwxpHtADoOHkDJnGSkzBuFFCgjseStdjS28fM0bSAmqxnDW3wiYPjKdv30FqiVpSWn PFCGfm4pRMzNOakYtZgDk1mZOKs54JwhE2rchYMO8STEClQd5v9qqJQhqwdHlAXWiqzO 90Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 7-20020a631547000000b00398cb3ff9f6si2956437pgv.266.2022.04.15.17.24.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:24:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C178755BE7; Fri, 15 Apr 2022 17:23:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350972AbiDOUJ6 (ORCPT + 99 others); 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 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 |