Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp160435pxy; Thu, 6 May 2021 23:42:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztWZGF4TMKGO8ILgGuZF6Vx9MR4nvO2dcxLAZBFwP/bAlVGXnXzYS0e8JzQiB6lQBcSTvf X-Received: by 2002:a17:906:314f:: with SMTP id e15mr8520714eje.30.1620369777354; Thu, 06 May 2021 23:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620369777; cv=none; d=google.com; s=arc-20160816; b=tv4QB2BF9KjIVJ54SQp2BsjdwZEkzieVEzfkYEhY5ZgutacHctQ1y5JAONBdaLlx7V bY/1CIutdw/5Sk7b7IiLsF+CoImD/h2GfDDwiBMZ0sQlI0pP2AEOu43rNnX+ui0Q9ceT awG3/0hDUBq1mrYaSVLrNUPHmSFck9c+bFGUrv46GYZcApGEZb20fArxROjZ+dWSe07D xbj80Gj+IL4c2DjgkI7zS0+wz83wnE65KfWczybbxyzH9tg38jBf6+0HIiIrvRtqtICZ H1A0lOsVlEKkojGCEpNK5fZch/++wZxH2J65a1XjNyO7oUG3ANR1bePALLoydzUXkSj2 x4WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=G2kOry2o6vDINWYKN+kItqoO3L4K4kcs80lC7IG5WJU=; b=cSyiIo5EmIEaGsUwoHkVBVMrk4xeiXyvSJBAcUkHQVIR9tFVQlFscsdrqG+ZeV1piw hvdHJhgkbAOuFgNmzAJ/BV/fM2pzoD5uMj6xUB0lWKflgVnCA+lG+mV5dbI/CVHod0ko xilPHQU31CVbL4QT+nAvI7gnYH9nDhKs1L+ipR7I+M1fmWCCxXP3JJCiJt5VVe4eoOLF CgWsMugTA/oVQLt64r7uKPONScYyKGzNEHREVOqIfA3XvjnKnrYcm3iKXbnsprpCENgb eBuMB5NAOQA826ZVT8II6Ix/5lgDKNHRMwy2ElInNdrQP4p7gMBxFpdkW4wexDLN/cWU VhAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bRNCVPdR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si4383982ejj.406.2021.05.06.23.42.20; Thu, 06 May 2021 23:42:57 -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=@gmail.com header.s=20161025 header.b=bRNCVPdR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233669AbhEGFms (ORCPT + 99 others); Fri, 7 May 2021 01:42:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232868AbhEGFmq (ORCPT ); Fri, 7 May 2021 01:42:46 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F041DC0613ED for ; Thu, 6 May 2021 22:41:46 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id j11so5840880qtn.12 for ; Thu, 06 May 2021 22:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=G2kOry2o6vDINWYKN+kItqoO3L4K4kcs80lC7IG5WJU=; b=bRNCVPdRqAocCuyFxBXJy2AsS3Qe16WxtrKO74QvMjIBi0wx/v0BGOcsSVuCwagmwO mEpXlMTxD1HFdaXZU/T1fxWDz699KuxZayEaQSrFIDZLj8Ead5DAxXB9JfrfRt3f2cRc rNLBYP7Y77arlJFye/ae+jdYD4IXyPTUZ0cUY0OXf49OBpBiYq76ArNyvrHpbghR9Rhg qOhCTh4uIpwLhVXQOSAPeJwuful8xOMAXw5jI01ZZNM/dq+XJLqGGQ63QLXI42+uDEF0 pU9ZzPvgxK4IDacYhC1eWthFdl4lsGumueuhlWco99oFSq6f1ccZdXPiqKhDsysYq+Jx PGCg== 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; bh=G2kOry2o6vDINWYKN+kItqoO3L4K4kcs80lC7IG5WJU=; b=lWC7Qy9tZY3Wz12h5ikmUH6Zrt5hxJC1m0OwHdZj+YBvQhXzpCtSXm482w0WcpjIK/ j8ETFmb7JwYirQeFaumi/TCALz4ggPG1HU2Sg/GP6UahZWhD9zrsKn0ubNnumUxTPwA6 R7+VpldsOHSnXF7innXrBqnzkMldUXkMt+N7ix9FVLTMYSwaGMhDP6IVqF9rA+qWrZRS eKnfs9deQK1mtzcfR7/EEZdvIlNXL+T6NDrpdnk4Gwi587C6xUmYhsw0u+rQ6j9Qpzh7 DsIqx79b3kbGn2jPZpuaefrF5p5N8+/Miaaid2FTOfBCaGtgfVTY1WvmG5+BnDrGck7k SbEg== X-Gm-Message-State: AOAM531Eq7IvL3GT2lbTm2lyVE70m0RvOMkMajoX3z1MVYYbE7MQCJAK LOG2s2UAZpvNNwRk+OddbfzlsiVhGiqiiXMcfDJffnVWdDY= X-Received: by 2002:ac8:714c:: with SMTP id h12mr8066884qtp.221.1620366106260; Thu, 06 May 2021 22:41:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kestrel seventyfour Date: Fri, 7 May 2021 07:41:35 +0200 Message-ID: Subject: Re: cannot pass split cryptomgr tests for aes ctr To: linux-crypto@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Eric, thanks for the info. Walksize did the trick returning the chunks. D. Kestrel Am Di., 4. Mai 2021 um 18:52 Uhr schrieb Eric Biggers : > > On Mon, May 03, 2021 at 09:56:40AM +0200, Kestrel seventyfour wrote: > > Hi, > > > > I am trying to update the old ifxdeu driver to pass the crypto mgr tests. > > However, I continously fail to pass the split tests and I wonder what to do. > > > > For example, I successfully pass the test vector 0 here: > > https://elixir.bootlin.com/linux/latest/source/crypto/testmgr.h#L16654 > > if there is no split. > > > > But if the text "Single block msg" is split into two 8 byte blocks > > (single even aligned splits), which end up as separate skcipher walks > > in the driver, the second block is wrong and does not compare > > correctly, to what is hardcoded in testmgr.h. Same if I try it with > > online aes-ctr encoders in the web. > > I have tried doing the xor manually with the aes encoded iv, but I get > > the same result as the hardware and if I use the next last iv, I still > > do not get the second 8 bytes that are hardcoded in cryptomgr.h. > > > > Can someone shed a light on it? > > Is it valid to compare a crypto result that was done on a single walk > > with 16byte with two separate walks on the 8 byte splits (of the > > original 16)? Is the cryptomgr test on the split tests expecting that > > I concat the two walks into a single one? > > If yes, how to do that on the uneven splits with separations like 15 > > 16 5 byte sequences, etc., fill up the walk up to full block size and > > spill over into the next walk? > > > > The split test cases expect the same output (same sequence of bytes) as the > non-split test cases. The only difference is how the data is split up into > scatterlist elements. Yes, that means that a single 16-byte block of the > keystream may need to be XOR'ed with data from multiple scatterlist elements. > Take a look at how other drivers handle this. > > - Eric