Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp421147imw; Wed, 13 Jul 2022 00:25:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sG3+yEfF00s02mFdOrt+gbxC5lX1PiYZB0KE6x8vC5rKpGqc8M35Q0MmS3rYtY6DTlKDd0 X-Received: by 2002:a05:6a00:1c5c:b0:505:7469:134a with SMTP id s28-20020a056a001c5c00b005057469134amr1854599pfw.16.1657697139201; Wed, 13 Jul 2022 00:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657697139; cv=none; d=google.com; s=arc-20160816; b=qaQZy5/VYd4y4vzPqLGsCFMB/RDTD8cDj9ZHEML+9Frlf7RFRBIus1bjccga17MnaP jEu0zoZ0PZo0/HqDRNHAlQiyqCaV6MjTYMZzq6vEkL+WOsJaXDPUDFxmZrt4IMjlRopY 0kBzAad17obEeOVjunbpDs3smqqXW6kZGBsWYXe2JQNSCBuEU8kfr1fsrB7A7jzGvA22 J4CGdH+UKzJQgWVAJLR959Bf832SRU8D2iJ+nryD678CaeddDh3hSXsUoIj/45RoEkvP ZKn5uwQ1YQcBJdgNLIv53sNO5rUbrc+B6DAL0/XrBCl77vEc/DInw5jm9GoppdjMHIva oizw== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-filter; bh=xyfcr3sQR84Ly/nvTJHG4HPfK1atahpyAidjxl2yWkE=; b=UF+CII8+GFC44bWnYPGNjb9N6wf4z/ZY5gItkFkkfuBoy/mY5f8VhIQFfrWgp75ud4 eADtGdlQI9rjvg6PShrLSmEOo6VeGTZlHZfvq2m/awf08P3pg5Vd70bwd1yQZjUplW6J Ah2FciSMS1YcGTF2njLjVYnLnz2/XtB7o7dzv6kWXcroCz/syZ545+lgrsru3/YGJfCk UQgYW83xOXRztKVZ0trLU/t4aKHGdmqNRIOBEC3AZo6QoiiT7Yaj8mO0yB/FGyAkU9BH +tevhl0049z3xlAJjOVh51RFuRMMGu9e4PCE8YJn2LaqDzPab5c5PsS0k38DR1Uk39lU KIEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=XcZ097Xe; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t63-20020a638142000000b0040d62e9fc93si13536775pgd.439.2022.07.13.00.25.16; Wed, 13 Jul 2022 00:25:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=XcZ097Xe; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232056AbiGMHYw (ORCPT + 99 others); Wed, 13 Jul 2022 03:24:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232249AbiGMHYr (ORCPT ); Wed, 13 Jul 2022 03:24:47 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C4A3AE2A14; Wed, 13 Jul 2022 00:24:46 -0700 (PDT) Received: from [192.168.87.140] (unknown [50.47.106.71]) by linux.microsoft.com (Postfix) with ESMTPSA id 0F8E2204DE8D; Wed, 13 Jul 2022 00:24:46 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0F8E2204DE8D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1657697086; bh=xyfcr3sQR84Ly/nvTJHG4HPfK1atahpyAidjxl2yWkE=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=XcZ097XeO7xeC7v5XUwwOFRNJp/3SfBdVsO4i5/EqL5rXYOykkBQcQFZrH5eUk+fH GdHfinkZgeYf9WzJKRJWvBSVXhqwf+/+rj3ay/Dezbp07FtUsA2j0v1iYW0PJpX9OH A6X9pNBzG17b2c4tBFt454w2F+v173E39Qb6miLI= Message-ID: <7041bf01-d91f-3149-e8ba-5db4ba59f9bb@linux.microsoft.com> Date: Wed, 13 Jul 2022 00:24:45 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v7 1/5] crypto: aspeed: Add HACE hash driver Content-Language: en-US From: Dhananjay Phadke To: Neal Liu , Corentin Labbe , Christophe JAILLET , Randy Dunlap , Herbert Xu , "David S . Miller" , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Dhananjay Phadke , Johnny Huang Cc: linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, BMC-SW@aspeedtech.com References: <20220705020936.1751771-1-neal_liu@aspeedtech.com> <20220705020936.1751771-2-neal_liu@aspeedtech.com> <45058512-0661-5d34-7faf-ddf3eb6142ec@linux.microsoft.com> In-Reply-To: <45058512-0661-5d34-7faf-ddf3eb6142ec@linux.microsoft.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 7/12/2022 10:32 PM, Dhananjay Phadke wrote: >> +static void aspeed_ahash_iV(struct aspeed_sham_reqctx *rctx) >> +{ >> +    if (rctx->flags & SHA_FLAGS_SHA1) >> +        memcpy(rctx->digest, sha1_iv, 32); >> +    else if (rctx->flags & SHA_FLAGS_SHA224) >> +        memcpy(rctx->digest, sha224_iv, 32); >> +    else if (rctx->flags & SHA_FLAGS_SHA256) >> +        memcpy(rctx->digest, sha256_iv, 32); >> +    else if (rctx->flags & SHA_FLAGS_SHA384) >> +        memcpy(rctx->digest, sha384_iv, 64); >> +    else if (rctx->flags & SHA_FLAGS_SHA512) >> +        memcpy(rctx->digest, sha512_iv, 64); >> +    else if (rctx->flags & SHA_FLAGS_SHA512_224) >> +        memcpy(rctx->digest, sha512_224_iv, 64); >> +    else if (rctx->flags & SHA_FLAGS_SHA512_256) >> +        memcpy(rctx->digest, sha512_256_iv, 64); >> +} > > Can use the "digsize" from reqctx to memcpy() instead lots of if..else > conditionals for every request? Sorry, meant pre-initialized ivsize not digsize, which could be in alg wrapper structure (aspeed_hace_alg). Thanks, Dhananjay