Received: by 2002:a25:d80d:0:0:0:0:0 with SMTP id p13csp321895ybg; Sat, 23 May 2020 15:41:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoPp/GAAQpOKDJ4Xyi1Z80F/mNbvm+cT5K4myBTW2S0BYqFk8abVqO+76zKcvArlMe4ZkQ X-Received: by 2002:aa7:d399:: with SMTP id x25mr8595035edq.164.1590273672518; Sat, 23 May 2020 15:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590273672; cv=none; d=google.com; s=arc-20160816; b=t9NLpeBohzsNOhwoHoXtkT9rEflSPdh+2vuU/eXzTumPVJVlUZR8UR3lX1lWPNsKdL EwYpyFYjgKcznyOeEWKDFxocId15oSzeiCjO9jf+RJpuSeVDKLcxxZh4IgzDzux3Ytam fD5Zip7B8LfCNodX6CnYoZssObp1CcHiDDPbtCG1zpR+jCNQ53NXPMiCXr3bPFZSgZSU gcUrPkFQ0sWgNC5jgsPAUqdQOaL6eJZXuHUmMfLrubBgH+o40y0gEiQft4FFE1qpckow kVC5fEsTbn9jrkXlWg939Qr+Mv3FA1m/BLv+pLTPz7FbWOQIEhAHWjC0KesAWoYqkn8K 3abg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=PeI+WYnPsD7w0jwv2k/jUh8n9+ukJb90e5rZ9yP2Czs=; b=CiT8ON6C8zLf+1YODlwl53WKQTlU1n3DRTA2hXMavrgCCZh4hCX+NWHWg6Oh3Zt588 RuJLAXFur5dWIsTe6wk7NdWJnCLA4sLEt/nY9BvlVw9VeN/tFcZUk2T+uCAWTrBTDvuh HdLV+B9UqJIjlQQkz9WoWF6+ICzGu0J+BWDd3UE7H2eB+jZ06sofKogeMRs87r3L79Dd xCT4kQgGnmCNCGeWzsQc2QmVNTLYyG4GQdHu20ZY7/s8x6hjJ7XSVPKrPv42u6+ttD6j husL1jJA2b/Ptx5upvqvjsCw/djeK67+pb4tuJv5ti26WaMlg0sI06sVju1mz9ALKGer aNhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nnFvQEzM; 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 a4si7069003ejr.560.2020.05.23.15.40.34; Sat, 23 May 2020 15:41:12 -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=nnFvQEzM; 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 S1728414AbgEWWkR (ORCPT + 99 others); Sat, 23 May 2020 18:40:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:53428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727827AbgEWWkR (ORCPT ); Sat, 23 May 2020 18:40:17 -0400 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B7C720727 for ; Sat, 23 May 2020 22:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590273616; bh=PeI+WYnPsD7w0jwv2k/jUh8n9+ukJb90e5rZ9yP2Czs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nnFvQEzMjolV/IawZclz6nakDTmydTSeo6A2kSbIydHNLPJzHOxOVzdMcM5jbI6rf yf/mHWw3195y/yc0HNvl16CBQKyAE3PWGvSZ/MEofZ8cmd/7UlpVEqScL9DsSOf6EB mIHvvhAFHZTo7YDZEYjYOvoMFVu4XxIvq/x8lIS4= Received: by mail-io1-f41.google.com with SMTP id h10so15278052iob.10 for ; Sat, 23 May 2020 15:40:16 -0700 (PDT) X-Gm-Message-State: AOAM530NVH5wzIechyhp2S8ErRND+J7jPFzLnEPbZrkw9JLXZcjBPbkC 0ObIMPhL4tNIopYKb32oyaf6q7dhnxciXq7yk9s= X-Received: by 2002:a6b:5008:: with SMTP id e8mr8369503iob.161.1590273615918; Sat, 23 May 2020 15:40:15 -0700 (PDT) MIME-Version: 1.0 References: <20200519190211.76855-1-ardb@kernel.org> <9730423.nUPlyArG6x@positron.chronox.de> In-Reply-To: <9730423.nUPlyArG6x@positron.chronox.de> From: Ard Biesheuvel Date: Sun, 24 May 2020 00:40:04 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr To: =?UTF-8?Q?Stephan_M=C3=BCller?= Cc: Gilad Ben-Yossef , Linux Crypto Mailing List , Linux ARM , Eric Biggers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sat, 23 May 2020 at 20:52, Stephan M=C3=BCller wro= te: > > Am Donnerstag, 21. Mai 2020, 15:23:41 CEST schrieb Ard Biesheuvel: > > Hi Ard, > > > On Thu, 21 May 2020 at 15:01, Gilad Ben-Yossef wr= ote: > > > Hi Ard, > > > > > > Thank you for looping me in. > > > > > > On Wed, May 20, 2020 at 10:09 AM Ard Biesheuvel wro= te: > > > > On Wed, 20 May 2020 at 09:01, Stephan Mueller > wrote: > > > > > Am Mittwoch, 20. Mai 2020, 08:54:10 CEST schrieb Ard Biesheuvel: > > > > > > > > > > Hi Ard, > > > > > > > > > > > On Wed, 20 May 2020 at 08:47, Stephan Mueller > wrote: > > > > ... > > > > > > > > > > > The state of all block chaining modes we currently have is de= fined > > > > > > > with > > > > > > > the > > > > > > > IV. That is the reason why I mentioned it can be implemented > > > > > > > stateless > > > > > > > when I am able to get the IV output from the previous operati= on. > > > > > > > > > > > > But it is simply the same as the penultimate block of ciphertex= t. So > > > > > > you can simply capture it after encrypt, or before decrypt. The= re is > > > > > > really no need to rely on the CTS transformation to pass it bac= k to > > > > > > you via the buffer that is only specified to provide an input t= o the > > > > > > CTS transform. > > > > > > > > > > Let me recheck that as I am not fully sure on that one. But if it= can > > > > > be > > > > > handled that way, it would make life easier. > > > > > > > > Please refer to patch 2. The .iv_out test vectors were all simply > > > > copied from the appropriate offset into the associated .ctext membe= r. > > > > > > Not surprisingly since to the best of my understanding this behaviour > > > is not strictly specified, ccree currently fails the IV output check > > > with the 2nd version of the patch. > > > > That is what I suspected, hence the cc: > > > If I understand you correctly, the expected output IV is simply the > > > next to last block of the ciphertext? > > > > Yes. But this happens to work for the generic case because the CTS > > driver itself requires the encapsulated CBC mode to return the output > > IV, which is simply passed through back to the caller. CTS mode itself > > does not specify any kind of output IV, so we should not rely on this > > behavior. > > Note, the update to the spec based on your suggestion is already in a mer= ge > request: > > https://github.com/usnistgov/ACVP/issues/860 > > Thanks for your input. > Thanks for the head's up. I've left a comment there, as the proposed change is not equivalent to the unspecified current behavior.