Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1148628ybc; Tue, 12 Nov 2019 15:18:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyCSY3nW2O5B2OGP9OUdbOBZ5MY15vvIWc8avBQcOEwa1cvOe0XhtDcwls+vspAr/eBzXi4 X-Received: by 2002:a17:906:80d5:: with SMTP id a21mr4675795ejx.114.1573600726149; Tue, 12 Nov 2019 15:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573600726; cv=none; d=google.com; s=arc-20160816; b=MvadDOaz47HjDHzBsiqoWVYibLQl8S3lCqq0/Jl/II66AxVFJBfTb9JAt7SU0poHdh HfID/AH4PBvVDEkrzWOqM6HI0JyulactxZjWHxa+RadNJGzjyVUBci/G7ak6w5rQdL7L jNyLvJH7j+CWos8XSD7Pk1GRnvmhcWt9hJ+eNzRre3bBlDs3Grv8SZbujC9lYf2JQlQR fiw4Dnv4ZdUANB+yJx5UUQ8RQnPEJbYBPeje6oofRWO8hNl9wSGQO6iqkAVmuO+qgurG F/0yTNvIFVaXba/H8Q35mJWYR74FXh84e72LBJFY68Bdwg6nEGypic79IKgVtRbsJDL9 YnQg== 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:message-id:subject:cc :to:from:date; bh=o/p6v67EvfPefO5GlGJuqu5sRenSZ13sFz1WjM6rN7k=; b=EyTyGxWfBIZ557xVegmA7QHIm4u5TmB7isSlCHNIXAR0uU2Bvm/Xq4OqDH0ZZDiKoq MNkS9k+AiHGic6LhvqHG7Cx7CSwG62X4glp+yB2bfPu8l5AWzSAxIVijLyDIzGUCm2nH X9aOa+6mF2YwqsWgLOWT/skxDCq512w+3OOZh4oxZ87PU2iQg2bMds0JrQ8svqRwQ3Et XalobZQTkRns9NNROumvVj7nACq4q0wUDRM0NNL4gWMfoZ9Xda960YdSFaBGrQo8sBGg P4lv0Xz9TZfVCjd3oYg9Jvw28H0iBdRdzzo+jEWn87pHxjdYZfSXmoNQHGMeoqu80efL WGgA== ARC-Authentication-Results: i=1; mx.google.com; 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 ca10si43447edb.67.2019.11.12.15.18.20; Tue, 12 Nov 2019 15:18:46 -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; 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 S1726910AbfKLXRi (ORCPT + 99 others); Tue, 12 Nov 2019 18:17:38 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:44266 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727226AbfKLXRi (ORCPT ); Tue, 12 Nov 2019 18:17:38 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1iUfPe-0006vY-AT; Wed, 13 Nov 2019 07:17:30 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1iUfPb-0001MR-AW; Wed, 13 Nov 2019 07:17:27 +0800 Date: Wed, 13 Nov 2019 07:17:27 +0800 From: Herbert Xu To: Andrey Smirnov Cc: Lucas Stach , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Chris Healy , Horia =?utf-8?Q?Geant=C4=83?= , Iuliana Prodan , linux-kernel Subject: Re: [PATCH 0/3] enable CAAM's HWRNG as default Message-ID: <20191112231727.bzgh42lc333gu4eu@gondor.apana.org.au> References: <20191029162916.26579-1-andrew.smirnov@gmail.com> <226f5a669c2199408abcdec0ccddc9ff05672631.camel@pengutronix.de> <20191108151948.ojn6ga3preh66utl@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Nov 12, 2019 at 07:13:02AM -0800, Andrey Smirnov wrote: > > If I am reading the datasheet right reseeding should be done every > time CAAM is asked to generated random data. If you can guarantee that everytime the driver reads n bytes from the hardware, that the hardware is then reseeded with nbytes prior to that read, then it should be good enough. If the hardware only reseeds afterwards or reseeds with less than n bytes then it is not sufficient. > Even if prediction resistance is an acceptable approach, would it be > better to expose underlying TRNG and downgrade current CAAM hwrng code > to crypto rng API? If that's the best path forward, I am more than > happy to go that way in v2. If it offers true prediction resistance it should be good enough to use the drivers/char/hw_random interface. Otherwise please switch to the Crypto API RNG interface. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt