Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp909567ybi; Fri, 26 Jul 2019 22:39:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRRndax3ZVGOQkPKmsX+D8hCRLBBmfJcVEeOQNHwkW5MkLu4MbJRmJpkI34uGkW+edRtWk X-Received: by 2002:a62:1ac8:: with SMTP id a191mr26030552pfa.164.1564205993236; Fri, 26 Jul 2019 22:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564205993; cv=none; d=google.com; s=arc-20160816; b=L6Xe3vkUUCLrC0iSWM28ZuzNFRJs09E+bc7GaI6unWZD1KXK4E+mAMyoFVVtPzrvq/ s79kYRDnvb6MzSIVlFm2Nc7BAz/j9Dys0stwRxT5q5d78k4mbr8w/AQmWlkHS8wpAVv7 +Lhf7EEvlPP2g6w737L1aIAGei/0p1hGQ5oGr6jKQp3CA2uH2jvLYCJQdH0VmInp05Q8 42dIM1GsBuMrGtOnKIg5TQazZM89chDZ7Mi5aCdvg0hSU5Wiw5WuyfBa0Pnwk6QqvbBO +IGNhn/X6RzmNiid/vp6nrcGEfE2g2CDGZaCudu2JxBJmi/PEPBXDlkt9guM/tz7awMA q0ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MUVETRd5jGXNj319q2hmPRDJzjSos23f23Rl11EPouA=; b=CdbaMcedAjeP92qsNpK/E7tmu3jNLq9QiqGhdB1D/M4G78RmeynRNlx16VXeaDfWyw B2sVrbMRJpA0/wrlDAHnKxlPTIqWJyyfxi61CwES1mK39YGC8QvRDFHvJTYj5VqllE6L UrSY5zxycdjM0K4NA+Jdh+5RQzdoebuHQh64CQxljtVf+SEPHlyt6tUGGTUPYrSaaLfq TvmUHR43GBAjQ+e7c3bV6wNr3fGokY0Wwga8WNAYS1QzFOBNqfUwoM2fJY5cNvOkYvWI 2dgRvbFTVQSjRfV3udwrHkE3BtVyLiQ56nYc/QzJ15u75NkK+jRrPzBLQ8HA4d25Rurv Ippw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EdvLuNMV; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id az12si19164150plb.5.2019.07.26.22.39.27; Fri, 26 Jul 2019 22:39:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EdvLuNMV; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 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 S1726058AbfG0FjX (ORCPT + 99 others); Sat, 27 Jul 2019 01:39:23 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40778 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfG0FjX (ORCPT ); Sat, 27 Jul 2019 01:39:23 -0400 Received: by mail-wm1-f65.google.com with SMTP id v19so49260795wmj.5 for ; Fri, 26 Jul 2019 22:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MUVETRd5jGXNj319q2hmPRDJzjSos23f23Rl11EPouA=; b=EdvLuNMV7jhFKSns1ldkH4GCbJ0g1ZLoSbu87dsGP/8WFobdd2gPZpvGvGopDuGCrO NAhClaioZe9t3QF+E68aQIqEGhYofXiezJCZRKv95d9qdljFZ1g4dj3kx5749R7ajExW 9HIozlw1j7shQqGCp3+dD2eF5aJXqxJzvy6noDoSaVULiP4kD5S6KE4x36cyEiU9cnmt xHbBbit2+LdsFgPtS9HMZqE3vEKfCgEmI6ElZuatUpqkdO/s/S2d2AQtUiHs518+eIJe dqE9O/qZZ7RHu4fquRjH88kalLbQjm0sj8gKbN2lHAtW7q36SCUDoC2Myfp62Y7JDOnJ 4T4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MUVETRd5jGXNj319q2hmPRDJzjSos23f23Rl11EPouA=; b=BqfUusGPHfIh7h8sfZPoMPhjzTPDfa8mDezIkPjzvc85iTudXKcNI1Dqt66/EGVvSn +GLbZhtYIoj1MRV+lWH7MYFoafaAu+tiSXPbkFjAhfY/rsjjnSU2amyHsGW76JbQYlJj Wb91QICy+Xow4FoLalYsNtvQipchNz+Yfje7BGkIIzDiaFSYeZblRqmNrmP+yBrx+lac XhtH4rRJtSBFvn5iSe49qdptGxNBDnMd7eACqi4L+25kM60K/woAQLH/Zepe0VzosIYI jUuTO/gfxIMyLXUtcuxa4H879ZTJV1hPZDAmKFblK3ZSLHhyxKp5z6xhj0hHCGxGugwF DSJg== X-Gm-Message-State: APjAAAUytGB4bX5+pIGf4nxganvuGwC0noxoiqm5DARJffXFYxZUymTP qNLk3fdiln8M6V/rLg+rZcHaEKYIR+bXJeaHeB4GVg== X-Received: by 2002:a1c:720e:: with SMTP id n14mr7388848wmc.53.1564205960368; Fri, 26 Jul 2019 22:39:20 -0700 (PDT) MIME-Version: 1.0 References: <20190716221639.GA44406@gmail.com> <20190717172823.GA205944@gmail.com> <20190718065223.4xaefcwjoxvujntw@gondor.apana.org.au> <20190718072154.m2umem24x4grbf6w@gondor.apana.org.au> <36e78459-1594-6d19-0ab4-95b03a6de036@gmail.com> <20190720065807.GA711@sol.localdomain> <0d4d6387-777c-bfd3-e54a-e7244fde0096@gmail.com> In-Reply-To: From: Ard Biesheuvel Date: Sat, 27 Jul 2019 08:39:12 +0300 Message-ID: Subject: Re: [dm-devel] xts fuzz testing and lack of ciphertext stealing support To: Pascal Van Leeuwen Cc: Horia Geanta , Milan Broz , Herbert Xu , "dm-devel@redhat.com" , "linux-crypto@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sat, 27 Jul 2019 at 00:43, Pascal Van Leeuwen wrote: > > > -----Original Message----- > > From: Horia Geanta > > Sent: Friday, July 26, 2019 9:59 PM > > To: Pascal Van Leeuwen ; Ard Biesheuvel > > Cc: Milan Broz ; Herbert Xu ; dm-devel@redhat.com; linux- > > crypto@vger.kernel.org > > Subject: Re: [dm-devel] xts fuzz testing and lack of ciphertext stealing support > > > > On 7/26/2019 1:31 PM, Pascal Van Leeuwen wrote: > > > Ok, find below a patch file that adds your vectors from the specification > > > plus my set of additional vectors covering all CTS alignments combined > > > with the block sizes you desired. Please note though that these vectors > > > are from our in-house home-grown model so no warranties. > > I've checked the test vectors against caam (HW + driver). > > > > Test vectors from IEEE 1619-2007 (i.e. up to and including "XTS-AES 18") > > are fine. > > > > caam complains when /* Additional vectors to increase CTS coverage */ > > section starts: > > alg: skcipher: xts-aes-caam encryption test failed (wrong result) on test vector 9, cfg="in-place" > > > > (Unfortunately it seems that testmgr lost the capability of dumping > > the incorrect output.) > > > > IMO we can't rely on test vectors if they are not taken > > straight out of a spec, or cross-checked with other implementations. > > > > First off, I fully agree with your statement, which is why I did not post this as a straight > patch. The problem is that specification vectors usually (or actuaclly, always) don't cover > all the relevant corner cases needed for verification. And "reference" implementations > by academics are usually shady at best as well. > > In this particular case, the reference vectors only cover 5 out of 16 possible alignment > cases and the current situation proves that this is not sufficient. As we have 2 imple- > mentations (or actually more, if you count the models used for vector generation) > that are considered to be correct that disagree on results. > > Which is very interesting, because which one is correct? I know that our model and > hardware implementation were independently developed (by 2 different engineers) > from the IEEE spec and match on results. And our hardware has been used "out in > the field" for many years already in disk controllers from major silicon vendors. > But that's still not a guarantee .... So how do we resolve this? Majority vote? ;-) > Thanks for the additional test vectors. They work fine with my SIMD implementations for ARM [0], so this looks like it might be a CAAM problem, not a problem with the test vectors. I will try to find some time today to run them through OpenSSL to double check. [0] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?h=xts-cts