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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67B58C27C55 for ; Tue, 11 Jun 2024 03:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=flYjcUe7kpvi04h4v7vTREx/houQ49WcpeRiYI/0Dgc=; b=r1ErUeXuhZiOOM 8NbK1tJYeG4VXgNL+IfAKGgFm1ZYu1zH4ZzEgcxITnJmC2Y6GBeoowsIhkVT47++IVDx39obnvUg7 A/lLiyVwA1AWhfzWzy0dB/qQ5Xn6F8iaIRAEBvFhL0Cu2HPcMtmx7aTu1IKRXkkU8l9gZaoFqdK3W Di6zyZ4B31z8SyD0hI2xBM7xpgBm9QunjSS3/cvFXa4Z9KWk0mjVIn0Ju43iOf59dzI4KEtwAByK6 eitqRB4EBG+EFiqEW2SiOZJGBJzLoWzJ958DrZG82n1Cmc8ci2b8ugheNwdv580IKxpwvqAGgbqpw 9AhDxwxE4+MW8wWl54ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGrxi-00000007Ebb-1e7D; Tue, 11 Jun 2024 03:14:18 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGrxd-00000007EaQ-1g2v for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2024 03:14:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 4096ACE01BC; Tue, 11 Jun 2024 03:14:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE838C2BBFC; Tue, 11 Jun 2024 03:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718075650; bh=mbLv1uH2SZYJsLfBUYXgs87kE41hXHw1r1WdE9F1N8c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NLzAwj3Q7cuqOrIBmQCoD309Oia4DvkXjzRhFz6WEvf2FFKM2GNjA/mb1UBMH02B1 xH+lTl2C2R6KuTB0CidmE/RB0/eDRIfsZqwPmyQ4GDiWW4AD2CcZYPcqE+qmIghEns 7wP1bTRbGiDy/rzyBpadzaF6EioxRsRNruXdMWgoFF0DfWWsvFIyoTkBUwK9zAI8gt 1PH2Q7xMGt/Q5MziAJHxjxLEzy8ElPCi/FvSCK3bp/MH7qxX+sWnciFZlWSwEnPQ3w 3Q32bWqqNqcIEWwVJN9pcteBwpJ3SWrpXhnMOnobkgjIrKt9SAXUtfLDgzTGr5pOwr //9KmDYX2vrDA== Date: Mon, 10 Jun 2024 20:14:08 -0700 From: Eric Biggers To: kamlesh@ti.com Cc: herbert@gondor.apana.org.au, kristo@kernel.org, will@kernel.org, akpm@linux-foundation.org, davem@davemloft.net, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, vigneshr@ti.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 1/6] lib: add ISO 3309 model crc64 Message-ID: <20240611031408.GB2557@sol.localdomain> References: <20240524-mcrc64-upstream-v3-0-24b94d8e8578@ti.com> <20240524-mcrc64-upstream-v3-1-24b94d8e8578@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240524-mcrc64-upstream-v3-1-24b94d8e8578@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_201415_566161_83528893 X-CRM114-Status: GOOD ( 17.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 30, 2024 at 05:54:23PM +0530, kamlesh@ti.com wrote: > diff --git a/lib/crc64.c b/lib/crc64.c > index 61ae8dfb6a1c..40369dd26812 100644 > --- a/lib/crc64.c > +++ b/lib/crc64.c > @@ -22,6 +22,11 @@ > * x^24 + x^23 + x^22 + x^21 + x^19 + x^17 + x^13 + x^12 + x^10 + x^9 + > * x^7 + x^4 + x + 1 > * > + * crc64iso3309table[256] table is from the ISO-3309:1991 specification > + * polynomial defined as, > + * > + * x^64 + x^4 + x^3 + x + 1 > + * > * crc64rocksoft[256] table is from the Rocksoft specification polynomial > * defined as, > * > @@ -63,6 +68,28 @@ u64 __pure crc64_be(u64 crc, const void *p, size_t len) > } > EXPORT_SYMBOL_GPL(crc64_be); > > +/** > + * crc64_iso3309_generic - Calculate bitwise ISO3309 CRC64 > + * @crc: seed value for computation. 0 for a new CRC calculation, or the > + * previous crc64 value if computing incrementally. > + * @p: pointer to buffer over which CRC64 is run > + * @len: length of buffer @p > + */ > +u64 __pure crc64_iso3309_generic(u64 crc, const void *p, size_t len) > +{ > + size_t i, t; > + > + const unsigned char *_p = p; > + > + for (i = 0; i < len; i++) { > + t = ((crc >> 56) ^ (*_p++)) & 0xFF; > + crc = crc64iso3309table[t] ^ (crc << 8); > + } > + > + return crc; > +} > +EXPORT_SYMBOL_GPL(crc64_iso3309_generic); Putting this in lib/ seems premature, given that this is only used by crypto/crc64_iso3309_generic.c. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel