Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp160434pxy; Thu, 6 May 2021 23:42:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8aH/rqL5/48fQ66Al1VH0jW4x6wuHxFq+At+bPXLyhEvBko3oDapQ+0avlbAOPolgoYyY X-Received: by 2002:a17:907:397:: with SMTP id ss23mr8052749ejb.298.1620369777349; 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=Ezj/WxtMirAIavohWBSdb8izT3G28A+VXLRwMMa8yJZXugA/DwVKgYg6x8Mn4hREHA dZIjbDjXRDjzU0OqljV1jd2AhZ73XdY0QyCTTBEpDqjVQyVCn2NNLXzB16fqVU+Ina8u LP6b/strHlutxVFGeqBmR1MMjMGsXjvhKfnS21m4jjjYLVXZeVCzyTfMry9EwaJJ177e mMr6UiONSAEjfZ9Z5Ml0/0WIfr1b2YarVQPWAqZeJ2Tg4QWWG8b4zd40ixE1xBT5OP0u Nedea8qyq66H8Yfi7sS1xKkpxeFSSX3atPXTKgzQI7vLMOkDHiFyec8X6o/Wbiw4z2uo aroQ== 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:mime-version :dkim-signature; bh=u9p/hcj120BpkW4kUwOeQkNGvLx4nAXkS2ikZg09zjg=; b=WVr0MUyVnzUeJES5rDzwHEVJUV+VW++7bcbGwVe7GzxU/958ZQ5gXFv+gGTz178guZ cXZQmWYl/g6e4lEwLUNoPwesewg/GKObxEcWUdATg9C7+OGrlG3KsDgtgdPndQ0odhd6 mmQHdmed90yfCgdD13YYt8QAOB+xDK06awy5BudKvcJRnFxMcLBU8O4ZuIE+XlUPNh6X CvDvxAuOaUoAmmaCdG+s63RQD8Rb/ayuTTw5smVVznSLIeeT8fhnKmYbuE4XOGHMqM5w 4y51QAg2ryhr1G+nHrdSbMbQRS86eR2dbeE8QDvwnMeMjL6HV6U2gV24QQC0kGqJgnpR mWYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sTaHQ1B7; 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 j10si4299844edn.595.2021.05.06.23.42.21; 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=sTaHQ1B7; 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 S234400AbhEGF6e (ORCPT + 99 others); Fri, 7 May 2021 01:58:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234382AbhEGF6a (ORCPT ); Fri, 7 May 2021 01:58:30 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1830C061574 for ; Thu, 6 May 2021 22:57:12 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id i67so7422719qkc.4 for ; Thu, 06 May 2021 22:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=u9p/hcj120BpkW4kUwOeQkNGvLx4nAXkS2ikZg09zjg=; b=sTaHQ1B7k1EgneBBm6KSnNkhpxsgRTLJ3lBWP6r+zHo/uQIF9HytOIS0yAiuDsGkui XNz1TmErmNWYuLQxW1vc5G7inQMDv6jdDyOtdzNzS/InBsCjfKm9EoIvufpbo1SOM6/U vdA2FmEwOPZQ/fPVpyI9VeL2xh+oHewRO9hHJCMb53XgpvdaSD8kYKckxZygoXXDFPQd aFoovB/k3qcyS9Fgix7SKSJhYj4Ifl6NRPgcoOEMduJmljf662L9i+oAsAk0S+CYlrVD dNOu2t58eL5/4Ci1BstUcG2PfXBJ4ioq7Vq1DtSjyqdDk0dBX8gRskSUxc0T2FDxmwf3 OW5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=u9p/hcj120BpkW4kUwOeQkNGvLx4nAXkS2ikZg09zjg=; b=i0/pR/QdVu5eNypP6ipGZytUcvI8ttYq2u/Vu5W8rl7exfCnMJmzqlKBkPB4Ls4oGp AR9UeqGgH0b2GD20SF360r9RkTFzjEQfZQYD7/Tw0X3MRRNuH/jz5CTxAgiehkatkWWz cM4dWqyE9x8nLc2zeSGwpAfkl5TT6OT8iIR0zpusIKAAu3d+lhljX33QJ0VHKYOmQ6Wn sWTbEck316BiNS7WpajQ4efTvJ0p3EyLfWt6ITtx6YyM53MRIIhVYh0oPGzCfC6NMCzO y8V202NJNmxt3symTm0tOgfpQvHukfwnWP6Z5BK47tW0GpsHyAlMxuRxuKcaxJ3KX+2D gnQw== X-Gm-Message-State: AOAM530lXtlvsNYOqoE2TnDMVEBNuu7MS8wX9D1VX6sUrBYERpsNCJRT 8rqWKB0H8oc+ohzMZT5J2UUiQtivFKwddUAEsl0v9S4QKVOONw== X-Received: by 2002:a37:62cf:: with SMTP id w198mr7783930qkb.126.1620367032109; Thu, 06 May 2021 22:57:12 -0700 (PDT) MIME-Version: 1.0 From: Kestrel seventyfour Date: Fri, 7 May 2021 07:57:01 +0200 Message-ID: Subject: xts.c and block size inkonsistency? cannot pass generic driver comparision tests 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, I have also added xts aes on combining the old hardware cbc algorithm with an additional xor and the gfmul tweak handling. However, I struggle to pass the comparision tests to the generic xts implementation. In detail, xts.c exposes the block size of the underlying algo, which is AES_BLOCK_SIZE. But it does not use the walk functions, because they do not work if the input is not dividable by blocksize. Now the xts.c has its own implementation, but I wonder, if that implementation should accept input sizes other than dividable by block size? Actually if xts would only accept multiples of block size, the cipher text stealing would be obsolete. If I use walksize=1, I get the issues with the unaligned or splitted scatterlists. I really would prefer using walk just returning the remaining bytes instead of moving out with -EINVAL: https://elixir.bootlin.com/linux/latest/source/crypto/skcipher.c#L360 Is that intentional? For me its not logical to allow any input size to xts, but the walk functions return errors if there are inputs not a multiple of block size. Furthermore, its a waste of resources to process all previous walks and then return an error on the last walk?! I would expect xts to work in a similar way as ecb and ignore extra bytes? https://elixir.bootlin.com/linux/latest/source/crypto/ecb.c#L36 Or is the advice simply, implement xts to work as in xts.c without using walks and not worry about the inkonsistencies? Thanks, D. Kestrel