Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4481850pxa; Mon, 10 Aug 2020 10:03:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3BwhFQWSg6b+YOcv4qDtyMtWxt9mr3HCfvoeiPJKicSRiHH+R0vCUPrybcZPQ9zIxZyL4 X-Received: by 2002:a17:906:496:: with SMTP id f22mr22088145eja.180.1597079023164; Mon, 10 Aug 2020 10:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597079023; cv=none; d=google.com; s=arc-20160816; b=1HM8N85+YtI1DJeRZemC2w3524rBqHBxhRg/GngauRUhCRh/qQcE8H99TBkf2lJbuD PV6VutS98GmMFJf0eHtdY0/OKeCfZCd6JqKO76uoU+BeNKeIM05t6WxquEf3M4fAU5oy fiWywGtM77EQzPrd6iZNdy0NZYQzkUvc214yvJ+GDOdpV53WGIGkfozQ4wg72GJeJHCA NLNe4DLaP+YWwSgMsnLr8kLl7SLBNVIFCcbxWHUK9igzkvhjcGLWv956aL+psKkScLOf c+YRGT1Hb1Yhr7g5kos5TIUV/uMRdJpdonYk1Ymv7yjhA+2b4OpbnGB9WBjh62fIqzHk 0Cgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oZLSa9vYLbpZJYXT0kyqUMVs/SWg8auN4ldTcROlHW4=; b=TScaM4FURwafHA3F6sBaHNOeKWOxEEXwPo09DVGu8luf/thxQZOwIycawBVKTXJFgw 8RxvtSxKXPZzEn0aJe9tsGabOf2tCgGkkIEGOF/Ot5iwoTDavIBp/49jPIWXoZOAm3b8 Mu//lnig0u9pKGmgIWTjg0TEubwvQmPMRcTVLae+nPUU3sfXKPuQfAM3JMLM+rTmtbcH Zgk+w23sxy25LwQtufw1bmHviNQ8DSqnlPNijhGVBs7N/wBvECvlnLASANkg3yeX13gF FvntWPoCBy8ux0vargFI2LaX/8gwOUSxl3No96aoqmYdRJnaXaRXWwyPHS9S/GrBZIxZ Tjmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QxLxVUNJ; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rk3si9828358ejb.12.2020.08.10.10.03.12; Mon, 10 Aug 2020 10:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QxLxVUNJ; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727094AbgHJRDI (ORCPT + 99 others); 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