Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1170327ybl; Fri, 24 Jan 2020 17:10:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzELsWNfgkE2Re1bKDSv7skWAu0DAUmZDcfEIPWMjNtsph+2obGRnSOAvtxhnUETYZe393e X-Received: by 2002:aca:6545:: with SMTP id j5mr1203616oiw.60.1579914632576; Fri, 24 Jan 2020 17:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579914632; cv=none; d=google.com; s=arc-20160816; b=KngxaEduwTX0cI3InoYWk4oySa5BvRMdhWx6xKyMHu3XNyaW+mAdUtiwcY8YZxawPd EwGeNNkduBigdRersEV+pwJj1dTcz5VD3m7uTWhTaADHe4TZKmYtpoeTbEFHBz8bmJjz XLdUD6l35/CbCsIILbakhANXYERV1Mn6xTwCB2GY4bPF39WztAV3UgjkOqeGQxU2pQAc n3vERs+V4GkKaQ3LzulRnLPH3E8cQ6MEP+TXivYJE9e1vmv7Mdv7pHKjzdOPn3lY8Qmk JpWYGk6ePYGhNTmfmyVIEGbCpvElvXgAk9g26nlmpn4b6KTnity++5BvOeTi8GjUmHQY no6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=PU7A0GGM5OeYPxHQqdzowR7YF2x2k/eE4MxNem25afU=; b=Hv1hiJlpdG9YX5UKPQD9s8c5fduIUocaW7qFAn3L+47qAL0e4bmuOz12Em70x5BW4V a6oL2/9zaGnzolPWUAbAxa/BD+9fEJzbfIBqbNY4TAfSBnOje7BTwZqMk/9PpvdTY+if 8vSs4HTHn2fy20yObf0+H6BGArMw3s9WK9+Q5hmt4+rBrlTMCylE4ueJ4Ms+NjsoH+yw vrzS/BPqy71Crz1F8GBno8kzD/oIh8k/KnE5ft3BNTPR8W1yPashE+3zGFxC/hx8f4Wy gfArBbyNotPwmQHsPnbG6GRR92de9FUDTYaec4JhPCma1hOg/8CHWoQI5dESLnjPKWZQ EEzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@neuralgames.com header.s=default header.b=g1w1f5kv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si1666080otj.308.2020.01.24.17.10.08; Fri, 24 Jan 2020 17:10:32 -0800 (PST) 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=@neuralgames.com header.s=default header.b=g1w1f5kv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387584AbgAYBKG (ORCPT + 99 others); Fri, 24 Jan 2020 20:10:06 -0500 Received: from kross.rwserver.com ([69.13.37.146]:43868 "EHLO kross2019.rwserver.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387564AbgAYBKG (ORCPT ); Fri, 24 Jan 2020 20:10:06 -0500 Received: from localhost (localhost [127.0.0.1]) by kross2019.rwserver.com (Postfix) with ESMTP id ADA55B3DC2; Fri, 24 Jan 2020 19:10:05 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=neuralgames.com; h=user-agent:message-id:references:in-reply-to:subject:subject :from:from:date:date:content-transfer-encoding:content-type :content-type:mime-version; s=default; t=1579914605; x= 1581729006; bh=oobQmrNrtMrH5ic0QlZWtjmXlS2bin04onbQAnRpyJI=; b=g 1w1f5kv5ixK4UfVj48ni8bD3RCw1DXYJy8+YnATBfjEGqB7+wMPBm5d3kIcsaOBS MEeRZDujLnNQIP/QVcKRCPUD1fIf260MmOsEJUlzojaejtbETzjCLfHYU/ISy84P KyvzeG7ldpFXIES2zkKUcV/P7FgNrAGQnQH+zEr3es= X-Virus-Scanned: Debian amavisd-new at kross2019.rwserver.com Received: from kross2019.rwserver.com ([127.0.0.1]) by localhost (kross2019.rwserver.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yE5rXoj6bgXT; Fri, 24 Jan 2020 19:10:05 -0600 (CST) Received: from rwserver.com (localhost [IPv6:::1]) (Authenticated sender: linux@neuralgames.com) by kross2019.rwserver.com (Postfix) with ESMTPA id 30E46B3DC1; Fri, 24 Jan 2020 19:10:05 -0600 (CST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 24 Jan 2020 19:10:05 -0600 From: linux@neuralgames.com To: Andrew Jeffery Cc: Joel Stanley , Matt Mackall , Herbert Xu , Rob Herring , Mark Rutland , Linux Crypto Mailing List , devicetree , Linux ARM , linux-aspeed , Linux Kernel Mailing List Subject: Re: [PATCH 1/2] hwrng: Add support for ASPEED RNG In-Reply-To: <575811fd-24ca-409c-8d33-c2152ee401d7@www.fastmail.com> References: <20200120150113.2565-1-linux@neuralgames.com> <4446ffb694c7742ca9492c7360856789@neuralgames.com> <575811fd-24ca-409c-8d33-c2152ee401d7@www.fastmail.com> Message-ID: <136bbab84d13d8d56a5ac297e415975e@neuralgames.com> X-Sender: linux@neuralgames.com User-Agent: Roundcube Webmail/1.3.8 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2020-01-22 19:53, Andrew Jeffery wrote: >> Thanks for reviewing the patch. >> >> The RNG on Aspeed hardware allows eight different modes for combining >> its four internal Ring Oscillators that together generate a stream of >> random bits. However, the timeriomem-rng driver does not allow for >> mode >> selection so, the Aspeed RNG with this generic driver runs always on >> mode 'seven' (The default value for mode according to the AspeedTech >> datasheets). >> >> I've performed some testings on this Aspeed RNG using the NIST >> Statistical Test Suite (NIST 800-22r1a) and, the results I got show >> that >> the default mode 'seven' isn't producing the best entropy and linear >> rank when compared against the other modes available on these SOCs. >> On >> the other hand, the driver that I'm proposing here allows for mode >> selection which would help improve the random output for those looking >> to get the best out of this Aspeed RNG. > > Have you published the data and results of this study somewhere? This > really should be mentioned in the commit message as justification for > not using timeriomem-rng. > > Andrew Hi Andrew, I have uploaded the results of my tests to my GitHub, along with all the binaries containing the random bits that I collected from this Aspeed RNG using all 8 modes. You can also find in this repository a patch for the hw_random core driver that I've been using to collect this data. Here is the link: https://github.com/operezmuena/aspeed-rng-testing You can see in the reports that when using large enough samples (40Mb in size) this Aspeed RNG consistently fails the linear rank and entropy tests, no matter what RNG mode is selected. However, modes 2, 4 and 6 produce better entropy than the rest. I'm now collecting rng data from 2 other AST2520 SOCs that I have in order to compare results. Regards, Oscar