Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1593023pxb; Thu, 4 Feb 2021 17:56:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJysHN1cu10gpzNiohsMa333Wyet44Ju0Dj27tmtel0KUvIoMsTqmo1H1udo12o07Zd4bPBr X-Received: by 2002:a50:8b66:: with SMTP id l93mr1324515edl.384.1612490214223; Thu, 04 Feb 2021 17:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612490214; cv=none; d=google.com; s=arc-20160816; b=IH/KaTUi4pG03z/E5Oo88gsPYNhjyr0t71xvCrBDFctcGwji/4F4JI1dZmbmh+1lWo 9i0n1+pzt4O01MwahPWspbaoaoR4J/SnqV+mnhGElBdLTWZ+gre+2AyXfyA6NjBafu55 jMtdQotSbl9846gLgyMBsL6PeoYwWdVJ15lHTgdYbubQ5dS954HipiL2Okf18wEbEX4H PAmC476wBs/T7HEXK+U+6Emz23iSVpZ9vLf52IauhFx+2cVDFfIOFY5ylR8CH+f1lpg/ Do6U+4BNnfaTPAjDuvoHzUtVGLCO+9lae7spB68WHUwMyaTrrgO4kOdEsbg/YkQ10teX g/1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ZgarHMUxIZlnytWyvoqUUIQG5N3AYseK/6JWelyc+G8=; b=ehAZ4N5OOWjej3TOV3RC5vsoyRU/bvuHPaTRNdY2jT9ZwVHyJmrKFf7Rt+zLN3PvIJ mcS/cDZRHTLZGtuccGcbEsQt0awQJZi45McjzDd47ANJ6HmeNnnTQRnM0SI57BafbvXW wz/zgL7XG2/AKHdOYOzYsKO9zLt0tLrhLvpWB8wo/Z8lnq+pIzkdTvB1U7DvH9vmCms2 Dd1QkhVG9PY1tmux25G/RnnNmEvh7tkIeK9fK2hqTJFgD30MVtoCDRWyne8r3qqOlHxD 5pfeuJkw9j49ujLoJgdUHIAjcDrPIzPuXyzu5QdezGYLAOmFIFlyz5pzLaebc7l03489 lV/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qgFmqFjh; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c14si6126497edn.311.2021.02.04.17.56.30; Thu, 04 Feb 2021 17:56:54 -0800 (PST) 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=@linaro.org header.s=google header.b=qgFmqFjh; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbhBEAYz (ORCPT + 99 others); Thu, 4 Feb 2021 19:24:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbhBEAYz (ORCPT ); Thu, 4 Feb 2021 19:24:55 -0500 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 971EDC0613D6 for ; Thu, 4 Feb 2021 16:24:14 -0800 (PST) Received: by mail-qk1-x735.google.com with SMTP id t63so5375377qkc.1 for ; Thu, 04 Feb 2021 16:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZgarHMUxIZlnytWyvoqUUIQG5N3AYseK/6JWelyc+G8=; b=qgFmqFjhCsdsQIS9AwSyR4wvdBUIyt4rlSaAedFOAujp0lxrkGMHZbyilt02fXFjyC unV5jhegvjujJCR5AMJCJHC2D6N+Qyo3EbU8fPVwsXMZD0kZ8KRy/UIMF4UUXX6PiwFU rAImr1DSLLi+whx6WubuRa7aw7sMZ+vRjhVlTj8u7qen3oTUtdJbEcMgJKwnth+GPTIh 2zsRHBZ/ES7qs523OVeOa/mSGk9S+9gjNyXtXkAFLLGPa3tk+Io2qm4MNxO+mPhN4lCJ m8TvBH87bzGB1iZuylYdtU8mjkjcGdt9gErt+uuvvc9p1WKC56a1I3ejAzGPMGEzWPJe 9d2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZgarHMUxIZlnytWyvoqUUIQG5N3AYseK/6JWelyc+G8=; b=npxLJoqr1lyEWxC3mWiTvpd+bxWcX0qY+lQS3WiY/ioOVCAup/RKLfbtAv0Ksl7n8I lRZVTgfq6kIf+BROrx6o6NYq9m54OnRXg4IC0WjRdOf6Mui8Ya3nWoY48CW5eAmCgicB 540rNmKG5QMEWt7y35hasPWJhPnjQ2OzJ+CmOPh6llbgWGGRcbXfQKgnPBiWSH8gcIOa 1YtRK+yVirjgi0E8YSfeoVa/bZgXaJwx1ODBMwcOJ57fm3iqaFyRODY1C6nN4esmpRIW G4OqwxUdH9V7ujilTKdsNCgHo3jSqWeKPLNPrZ2v3UcVYhGqmQtj85zm1a5mUHocwSqg eMVg== X-Gm-Message-State: AOAM532fi6leQrftEonydb7GXJRbLNzNbcR6BOJKIiHVSWA5YtWW+KGj etAK2Ns4PMVi/zhfFKBboT5UXQ== X-Received: by 2002:a05:620a:ed8:: with SMTP id x24mr1839168qkm.381.1612484653806; Thu, 04 Feb 2021 16:24:13 -0800 (PST) Received: from [192.168.1.93] (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.gmail.com with ESMTPSA id l22sm6348879qtl.96.2021.02.04.16.24.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Feb 2021 16:24:13 -0800 (PST) Subject: Re: [PATCH v5 06/11] crypto: qce: skcipher: Return error for non-blocksize data(ECB/CBC algorithms) To: Eric Biggers Cc: herbert@gondor.apana.org.au, davem@davemloft.net, bjorn.andersson@linaro.org, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210204214359.1993065-1-thara.gopinath@linaro.org> <20210204214359.1993065-7-thara.gopinath@linaro.org> From: Thara Gopinath Message-ID: Date: Thu, 4 Feb 2021 19:24:12 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2/4/21 5:50 PM, Eric Biggers wrote: > On Thu, Feb 04, 2021 at 04:43:54PM -0500, Thara Gopinath wrote: >> + /* >> + * ECB and CBC algorithms require message lengths to be >> + * multiples of block size. >> + * TODO: The spec says AES CBC mode for certain versions >> + * of crypto engine can handle partial blocks as well. >> + * Test and enable such messages. >> + */ >> + if (IS_ECB(rctx->flags) || IS_CBC(rctx->flags)) >> + if (!IS_ALIGNED(req->cryptlen, blocksize)) >> + return -EINVAL; > > CBC by definition only operates on full blocks, so the TODO doesn't make sense. > Is the partial block support really CTS-CBC? Ya you are right. It should be CTS-CBC and not AES CBC. Though the spec is quite fuzzy about this part. I can remove the comment and spin the next version or just leave it there for now and remove it later. > > - Eric > -- Warm Regards Thara