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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35ACEC433E0 for ; Mon, 10 Aug 2020 17:03:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB0152083B for ; Mon, 10 Aug 2020 17:03:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597078989; bh=elsUXe1opDxYoDghIJZEYwZvrCHsszMPQwltM3nsIeg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=WdFDyyKHVhTG7U0Tyo8nehjJD3LVtamhmnriQQhgR1pUSis/VMqDPgtxxf8MaTRYB YzWWLuTHghPeO6T6C3eqT29230CQoXJpb0Ri1FgOrSxINRlE5VenwvbJ+KL1iVcDqp 1tcdxo+x8t0rv80gGvdWYUC/Um0swwddWWPdGw6M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727094AbgHJRDI (ORCPT ); Mon, 10 Aug 2020 13:03:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:35738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726910AbgHJRDH (ORCPT ); Mon, 10 Aug 2020 13:03:07 -0400 Received: from gmail.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 97839207DE; Mon, 10 Aug 2020 17:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597078987; bh=elsUXe1opDxYoDghIJZEYwZvrCHsszMPQwltM3nsIeg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QxLxVUNJwZ44dXSpRoIUoPC4//0FCrTOzfv/gQ+Ztwn+t6xQrr34/YvroNzHR/Clp hp5i/v/+awZlPt3cj8u960Gg/KGKURjHV6nLJwh7BxzAcAvaQNjTSF+xRa2158DvMP XfdXRi0EAFau/Wwv9Fut2Mvia5B03cVW4V/SnssE= Date: Mon, 10 Aug 2020 10:03:05 -0700 From: Eric Biggers To: Horia =?utf-8?Q?Geant=C4=83?= Cc: Herbert Xu , "Van Leeuwen, Pascal" , "Andrei Botila (OSS)" , "David S. Miller" , "linux-crypto@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-s390@vger.kernel.org" , "x86@kernel.org" , "linux-arm-kernel@axis.com" , Andrei Botila , Antoine Tenart Subject: Re: [PATCH 19/22] crypto: inside-secure - add check for xts input length equal to zero Message-ID: <20200810170305.GA3352718@gmail.com> References: <20200807162010.18979-1-andrei.botila@oss.nxp.com> <20200807162010.18979-20-andrei.botila@oss.nxp.com> <20200810134500.GA22914@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Aug 10, 2020 at 05:33:39PM +0300, Horia Geantă wrote: > On 8/10/2020 4:45 PM, Herbert Xu wrote: > > On Mon, Aug 10, 2020 at 10:20:20AM +0000, Van Leeuwen, Pascal wrote: > >> > >> With all due respect, but this makes no sense. > > > > I agree. This is a lot of churn for no gain. > > > I would say the gain is that all skcipher algorithms would behave the same > when input length equals zero - i.e. treat the request as a no-op. > > We can't say "no input" has any meaning to the other skcipher algorithms, > but the convention is to accept this case and just return 0. > I don't see why XTS has to be handled differently. > CTS also rejects empty inputs. The rule it follows is just that all input lengths >= blocksize are allowed. Input lengths < blocksize aren't allowed. - Eric 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 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FSL_HELO_FAKE,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F6E8C433DF for ; Mon, 10 Aug 2020 17:05:36 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D8C82083B for ; Mon, 10 Aug 2020 17:05:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QxLxVUNJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D8C82083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BQMmD4DkKzDqQD for ; Tue, 11 Aug 2020 03:05:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=ebiggers@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=QxLxVUNJ; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BQMjV27FdzDq9p for ; Tue, 11 Aug 2020 03:03:09 +1000 (AEST) Received: from gmail.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 97839207DE; Mon, 10 Aug 2020 17:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597078987; bh=elsUXe1opDxYoDghIJZEYwZvrCHsszMPQwltM3nsIeg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QxLxVUNJwZ44dXSpRoIUoPC4//0FCrTOzfv/gQ+Ztwn+t6xQrr34/YvroNzHR/Clp hp5i/v/+awZlPt3cj8u960Gg/KGKURjHV6nLJwh7BxzAcAvaQNjTSF+xRa2158DvMP XfdXRi0EAFau/Wwv9Fut2Mvia5B03cVW4V/SnssE= Date: Mon, 10 Aug 2020 10:03:05 -0700 From: Eric Biggers To: Horia =?utf-8?Q?Geant=C4=83?= Subject: Re: [PATCH 19/22] crypto: inside-secure - add check for xts input length equal to zero Message-ID: <20200810170305.GA3352718@gmail.com> References: <20200807162010.18979-1-andrei.botila@oss.nxp.com> <20200807162010.18979-20-andrei.botila@oss.nxp.com> <20200810134500.GA22914@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Andrei Botila \(OSS\)" , Andrei Botila , Herbert Xu , "Van Leeuwen, Pascal" , Antoine Tenart , "linux-s390@vger.kernel.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@axis.com" , "linux-crypto@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "David S. Miller" , "linux-arm-kernel@lists.infradead.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Aug 10, 2020 at 05:33:39PM +0300, Horia Geantă wrote: > On 8/10/2020 4:45 PM, Herbert Xu wrote: > > On Mon, Aug 10, 2020 at 10:20:20AM +0000, Van Leeuwen, Pascal wrote: > >> > >> With all due respect, but this makes no sense. > > > > I agree. This is a lot of churn for no gain. > > > I would say the gain is that all skcipher algorithms would behave the same > when input length equals zero - i.e. treat the request as a no-op. > > We can't say "no input" has any meaning to the other skcipher algorithms, > but the convention is to accept this case and just return 0. > I don't see why XTS has to be handled differently. > CTS also rejects empty inputs. The rule it follows is just that all input lengths >= blocksize are allowed. Input lengths < blocksize aren't allowed. - Eric 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 X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FSL_HELO_FAKE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6359C433DF for ; Mon, 10 Aug 2020 17:04:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CB4920838 for ; Mon, 10 Aug 2020 17:04:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S7nclqEU"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QxLxVUNJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CB4920838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=g8MZFiK7Az4Dqs3shOejm9y8bH7U1Ui4FMJqRafkI2A=; b=S7nclqEUQ50ux3pAUUTmYv2aT WWOomHtETZR1ZbW3r1LNXNlI3TmzmMfg/s9+3RcOkKdONcoC67PhGe/Gb3u01tqgP+podipiPnJTX 0n+OT126mDld1y00BD9oxO7VRg5mNbWtnUm/XxWw9vvRt6B9svsIDhnBeE1Ddrf/sqsGAKDhmxccr W3ueeG72fXX+QY6vQgc33Qv1kPPdDM02AbwIU9ApLD5B6FVdFtbR5F5tnhXJ+tuGcvPXffeoDT5LJ jQESPX3OQeLP/s+QM27MWcsO5HaljrL9/B5idUsxnsELC7gbvJuScdX+OixvX5V9yFZ2y5vTC2ZSJ fSg0bG5Wg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5BCZ-0004aa-9s; Mon, 10 Aug 2020 17:03:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5BCW-0004Zj-Rq for linux-arm-kernel@lists.infradead.org; Mon, 10 Aug 2020 17:03:09 +0000 Received: from gmail.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 97839207DE; Mon, 10 Aug 2020 17:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597078987; bh=elsUXe1opDxYoDghIJZEYwZvrCHsszMPQwltM3nsIeg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QxLxVUNJwZ44dXSpRoIUoPC4//0FCrTOzfv/gQ+Ztwn+t6xQrr34/YvroNzHR/Clp hp5i/v/+awZlPt3cj8u960Gg/KGKURjHV6nLJwh7BxzAcAvaQNjTSF+xRa2158DvMP XfdXRi0EAFau/Wwv9Fut2Mvia5B03cVW4V/SnssE= Date: Mon, 10 Aug 2020 10:03:05 -0700 From: Eric Biggers To: Horia =?utf-8?Q?Geant=C4=83?= Subject: Re: [PATCH 19/22] crypto: inside-secure - add check for xts input length equal to zero Message-ID: <20200810170305.GA3352718@gmail.com> References: <20200807162010.18979-1-andrei.botila@oss.nxp.com> <20200807162010.18979-20-andrei.botila@oss.nxp.com> <20200810134500.GA22914@gondor.apana.org.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200810_130309_038814_380A5A16 X-CRM114-Status: GOOD ( 16.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Andrei Botila \(OSS\)" , Andrei Botila , Herbert Xu , "Van Leeuwen, Pascal" , Antoine Tenart , "linux-s390@vger.kernel.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@axis.com" , "linux-crypto@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "David S. Miller" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org T24gTW9uLCBBdWcgMTAsIDIwMjAgYXQgMDU6MzM6MzlQTSArMDMwMCwgSG9yaWEgR2VhbnTEgyB3 cm90ZToKPiBPbiA4LzEwLzIwMjAgNDo0NSBQTSwgSGVyYmVydCBYdSB3cm90ZToKPiA+IE9uIE1v biwgQXVnIDEwLCAyMDIwIGF0IDEwOjIwOjIwQU0gKzAwMDAsIFZhbiBMZWV1d2VuLCBQYXNjYWwg d3JvdGU6Cj4gPj4KPiA+PiBXaXRoIGFsbCBkdWUgcmVzcGVjdCwgYnV0IHRoaXMgbWFrZXMgbm8g c2Vuc2UuCj4gPiAKPiA+IEkgYWdyZWUuICBUaGlzIGlzIGEgbG90IG9mIGNodXJuIGZvciBubyBn YWluLgo+ID4gCj4gSSB3b3VsZCBzYXkgdGhlIGdhaW4gaXMgdGhhdCBhbGwgc2tjaXBoZXIgYWxn b3JpdGhtcyB3b3VsZCBiZWhhdmUgdGhlIHNhbWUKPiB3aGVuIGlucHV0IGxlbmd0aCBlcXVhbHMg emVybyAtIGkuZS4gdHJlYXQgdGhlIHJlcXVlc3QgYXMgYSBuby1vcC4KPiAKPiBXZSBjYW4ndCBz YXkgIm5vIGlucHV0IiBoYXMgYW55IG1lYW5pbmcgdG8gdGhlIG90aGVyIHNrY2lwaGVyIGFsZ29y aXRobXMsCj4gYnV0IHRoZSBjb252ZW50aW9uIGlzIHRvIGFjY2VwdCB0aGlzIGNhc2UgYW5kIGp1 c3QgcmV0dXJuIDAuCj4gSSBkb24ndCBzZWUgd2h5IFhUUyBoYXMgdG8gYmUgaGFuZGxlZCBkaWZm ZXJlbnRseS4KPiAKCkNUUyBhbHNvIHJlamVjdHMgZW1wdHkgaW5wdXRzLgoKVGhlIHJ1bGUgaXQg Zm9sbG93cyBpcyBqdXN0IHRoYXQgYWxsIGlucHV0IGxlbmd0aHMgPj0gYmxvY2tzaXplIGFyZSBh bGxvd2VkLgpJbnB1dCBsZW5ndGhzIDwgYmxvY2tzaXplIGFyZW4ndCBhbGxvd2VkLgoKLSBFcmlj CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpsaW51eC1h cm0ta2VybmVsIG1haWxpbmcgbGlzdApsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5v cmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9saW51eC1hcm0t a2VybmVsCg==