Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp931028imu; Mon, 5 Nov 2018 10:58:45 -0800 (PST) X-Google-Smtp-Source: AJdET5cAKegEhhg+Fxe6BIv0IlO529yIt+PwrfKUugo2OQQ6fkDP1TELGkhm+LqJry1qdTGBzNBF X-Received: by 2002:a17:902:b093:: with SMTP id p19-v6mr17888342plr.107.1541444325437; Mon, 05 Nov 2018 10:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541444325; cv=none; d=google.com; s=arc-20160816; b=st7EHhvfDdvqUDzKeyjJ9HZyRDPAM5v8TFGQIkyghHxN65EpAYAzNk41Klmd4y6oyU RxF+kinIkHl0TsnSDHsEJnNouD/+d8e/lo7TbbNG0S4T8w7XZzRqenc3tLa77ynwscd/ teUCDd2crMnllAlB/WNiCd8xRtGAhRrhjYuHjVQcsFMegtIOogoOmdbFDCRaNAwbo9QP EtaUDWU7zM80OLz2M2YXKVj0YLPV3poX2OVEbnfAbUMDCVetOiAMM8q/tyqEZ4DZihjO Fv1Jxqco+j1AWh814nNuNkVSoxs3KCp+/Dj9Q+vg9WJAqHyiD/f6+hbeToUOk4et696W +byg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=PJ0xWYpcXqt9aEpU0k0lrUjeZxIr8u8feCW2IDN9bbw=; b=ML7uTMXqfWFXI+nAUrVhxgwbD7Y1lV+pz4sxyly07rPGae3MgrQghBYaZJFSOqnTBR aF9RMEku1DSSplMwmcMr9YywZ3aCU2DrQLCGRP9iWQWHlxo2EvbOqJSJnvvvfP7/CB1c GtPFAbGSWUwmQTgZwDT+Txe2qj/o6CNhdmSJGnACxogVdhl4ZP1bdVw+XuB7quLAUAVH 3ZVq727tj6rcj5J5g9Sv7J1DZqs4Y4SRMY+eInenWN064dcXYWs0K0+hYXeFhHJqrV4l Lnzxv6gASRmiVH8IwK5bRDiermeq9af/tsYGiTMxWKV61mdbDmFXQt8bnR3KxeVsypfx kkYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CilEVoYo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 q188-v6si47484763pfb.132.2018.11.05.10.58.30; Mon, 05 Nov 2018 10:58:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=CilEVoYo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2387919AbeKFETI (ORCPT + 99 others); Mon, 5 Nov 2018 23:19:08 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:34762 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387907AbeKFETI (ORCPT ); Mon, 5 Nov 2018 23:19:08 -0500 Received: by mail-it1-f194.google.com with SMTP id t189-v6so8447689itf.1 for ; Mon, 05 Nov 2018 10:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=PJ0xWYpcXqt9aEpU0k0lrUjeZxIr8u8feCW2IDN9bbw=; b=CilEVoYoeHnC3DgaGhwfyA+xIs3N9murIZXKZIeMCbjW8l0IWhtQeSFxm2rmdU+M/r i0nebEN/6OTEQqZZQlz8zx1yCx/azHfgKqMAY3QRmBg34ShE476h0BVoTkMn9iRLJqfT WIQpVber7qrz+Lzlr5SVGPOExu9fj2NzMKp/A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=PJ0xWYpcXqt9aEpU0k0lrUjeZxIr8u8feCW2IDN9bbw=; b=uP6C66t+LP5IEqmpWH4jG9loiSgH6e7xfXZKjq9Nf1f2BnAPmjsqo9s8hCdHFB92e5 lq36alB3dNvwRiFEEQLUak+tACdBlAp5mbOTIQgBCzJTQqWtxR/jvDDwxME0+l5kC6nC zcHOeIs7xEQ2T4+yXPdXJrIk9fKdvTfjS21gRWRUP/laoabTzX6k+KxZVTO++Bkq9erq Ii7Ye02ISMm/6xZRZluSFvlYBnfY6FxYy+klbKzJ99dhrFWvZkwMGT43CkWleSNKEdnn IwHJlYWuHgae2BMB9mzwyDW+xulsgoYFEL1UVJjKU7097PqruaykrHtMaku53Zv2iGS/ 2LRQ== X-Gm-Message-State: AGRZ1gJQ/pQ0v8QW7/PBgueM8/t3XWBMnvR2UP2fZ9Uu0rNTD0wKCtd+ ukl7GY9BuLrvgZgmdwJbyMy3X+m36h5zA354rSvEUrfu X-Received: by 2002:a02:9f85:: with SMTP id a5-v6mr21553083jam.2.1541444285995; Mon, 05 Nov 2018 10:58:05 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a6b:4f16:0:0:0:0:0 with HTTP; Mon, 5 Nov 2018 10:58:05 -0800 (PST) In-Reply-To: <20181105182314.c7xdsolvxr2iyd5n@sole.flsd.net> References: <20181024032356.3388-1-vt@altlinux.org> <20181024032356.3388-2-vt@altlinux.org> <20181105182314.c7xdsolvxr2iyd5n@sole.flsd.net> From: Ard Biesheuvel Date: Mon, 5 Nov 2018 19:58:05 +0100 Message-ID: Subject: Re: [PATCH v3 1/3] crypto: streebog - add Streebog hash function To: Ard Biesheuvel , Herbert Xu , "David S. Miller" , Greg Kroah-Hartman , Thomas Gleixner , Philippe Ombredanne , Kate Stewart , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5 November 2018 at 19:23, Vitaly Chikunov wrote: > Ard, > > On Mon, Nov 05, 2018 at 02:22:21PM +0100, Ard Biesheuvel wrote: >> >> > +static const struct streebog_uint512 buffer512 = { { >> > + cpu_to_le64(0x200ULL), >> >> Can we keep the memory representation in native endianness, and only >> swab the in/output [where needed]? > > I hope you do not insist on that? > > The code is using same primitives to add/xor/permute with data from > these arrays (buffer512[] and C[], those which use cpu_to_le64), and > from generic data buffers. Having these arrays in native endianness will > cause complexities - code split and duplications. For example, XLPS > permutation will require two versions, with one accessing (y) as is and > another as cpu_to_le64(y). > > The code is based on canonical implementation by RFC 6986 ("GOST R > 34.11-2012: Hash Function") author, and I don't want it do deviate that > much from the original, which would complicate algorithm reviews. > That is a very good reason, so unless anyone has concerns about the performance on BE systems, let's leave it as is.