Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp898562imu; Mon, 5 Nov 2018 10:25:21 -0800 (PST) X-Google-Smtp-Source: AJdET5eZxqjNxp3KtElFqN2xNd7/3UCRYE2HVxIe6pdBPTnovJKskHydTiMn0aGrLn4sSiqODSVY X-Received: by 2002:a17:902:4025:: with SMTP id b34-v6mr23395712pld.318.1541442321857; Mon, 05 Nov 2018 10:25:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541442321; cv=none; d=google.com; s=arc-20160816; b=hmHLaY8XeIIt6TcBwdJWe/4po/9cOvimvFPbQMJ+MbE85ixaP6B27MqX4HkHCke9Ye gZ0FM0h1cuNC3DISiENM8PIyWHty5gV8EmF/625FBo9KFnFdNgd25soWmxnTFbMkDEMM FuWZBeQXYf8NzvjhCGCyVBUOfMZuiDiTLuOUpcmuJYMzodENg0sIuJ6X+RFuBDmBkqAy p4cayquVq3zW1GZtEf2VdFb+inC3DwGgWP/MO1BexjVoy+0fyfpR0uYad29zqW7DOyaz 2w3uDwwW4jy1dexvyFhhgitWHNCTZEe9IGOP68VRLVD901UDAJvLJH8UTbZjcLJEqHJ+ RIgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=MbgXbu24WV+YgEtnZRSUdR3qbPb+3aDUQDA3vW8j8s0=; b=HxLuBuKsAIKG2fkw+u9PJrBTmZwlp2904fG9NmuT3L2buGSuMTOjWvtFsFaHI30gv8 lpkizviKjArxEAc7pBvdqNtWNdWxz/T967HVuPXM7HPsQ+zlZ0AmmKxN7KKRDxpZ+U9d rS1xwEmrYxFakvsN5OQ9oGB2khWCstS7ibtCuxwdoOp/hPCSkPFzMJNy9M1hIBFK15GT quyIaBlrl/njn/gNaJOcbpA6aeY1zZjlXnosZf73pRgIG1IYwcwoFAo1CmiCDSRFxLeQ HThkPnw3eKgPKqJ2mpfSzqPptv4cfE31Z9+GDOulLx2nUWLhPp6iQPsu5QMYfTooENDI Q4aA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f34-v6si43250947pgm.161.2018.11.05.10.25.06; Mon, 05 Nov 2018 10:25:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729943AbeKFDoN (ORCPT + 99 others); Mon, 5 Nov 2018 22:44:13 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:55708 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729559AbeKFDoN (ORCPT ); Mon, 5 Nov 2018 22:44:13 -0500 Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vmicros1.altlinux.org (Postfix) with ESMTP id D0FC672CC68; Mon, 5 Nov 2018 21:23:15 +0300 (MSK) Received: from sole.flsd.net (sole.flsd.net [185.75.180.6]) by imap.altlinux.org (Postfix) with ESMTPSA id B81624A4A29; Mon, 5 Nov 2018 21:23:15 +0300 (MSK) Date: Mon, 5 Nov 2018 21:23:14 +0300 From: Vitaly Chikunov To: Ard Biesheuvel Cc: 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 Subject: Re: [PATCH v3 1/3] crypto: streebog - add Streebog hash function Message-ID: <20181105182314.c7xdsolvxr2iyd5n@sole.flsd.net> Mail-Followup-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 References: <20181024032356.3388-1-vt@altlinux.org> <20181024032356.3388-2-vt@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215-106-ac61c7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks,