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 AB176C433EF for ; Mon, 9 May 2022 20:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229525AbiEIUn6 (ORCPT ); Mon, 9 May 2022 16:43:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbiEIUlH (ORCPT ); Mon, 9 May 2022 16:41:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF58928E18; Mon, 9 May 2022 13:37:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1FA99616E9; Mon, 9 May 2022 20:37:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1850CC385BA; Mon, 9 May 2022 20:37:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652128631; bh=hfhwSRPKpmCQiR4AWXJNzlQccUhXLt9YToKJxxPPASY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tFdOx9HeBIeyMBt5gSS7grymNkPUHSE1YVzDiOtXmus2HnnAqp0sGx44436ka/JjK I387rYUkxfMdDytacNXNhNdyw+gRMYaPO67M9P9Z6/vigTdb2jxJmfzSiXwR77Bhgy +L/OYMTfHq9q458tv+6koQytNRPpUGZq19BguAzdlXoagqOvYcnL7Fla6MPijxt9eC 74f/Jx8LoOAB7BVEQRG0k+qA8lVeGiwz0ZcGE8zruPKwZk1QPHxG8MNWZKjQKDEjT3 kGcFBVuutnd3h1pO/0qTZJZdxFiaQ1OEXnhL9cTUCqjRobkRB5vgpTeMwXJJjf37nh 7fIWs6dOzU3hg== Date: Mon, 9 May 2022 13:37:09 -0700 From: Eric Biggers To: Xiaoming Zhou Cc: "kbusch@kernel.org" , "linux-nvme@lists.infradead.org" , "linux-block@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "axboe@kernel.dk" , "hch@lst.de" , "martin.petersen@oracle.com" , "colyli@suse.de" Subject: Re: [PATCHv3 06/10]crypto: add rocksoft 64b crc framework Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sun, May 08, 2022 at 12:01:21AM +0000, Xiaoming Zhou wrote: > Hi Keith, > For the polynomial you used in this path is 0x9A6C9329AC4BC9B5ULL, why it is > different than the 0xAD93D23594C93659ULL defined in NVMe command set spec > 5.2.1.3.4 ? Though the crc66 implemented in this patch can pass with test > cases defined in Figure 121: 64b CRC Test Cases for 4KiB Logical Block with no > Metadata. Could you explain the discrepancy between the spec and the patch? > 0x9A6C9329AC4BC9B5 is 0xAD93D23594C93659 with its bits reversed. 0xAD93D23594C93659 maps the polynomial coefficients to bits in the natural way. However, writing the polynomial in this way isn't useful for this CRC variant, as it is a bit-reversed CRC. - Eric