From owner-freebsd-arch@freebsd.org Wed Sep 13 16:34:41 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A60F8E0495E for ; Wed, 13 Sep 2017 16:34:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B8DA6D074 for ; Wed, 13 Sep 2017 16:34:41 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 76f30345-98a1-11e7-950d-03a3531dacf2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 76f30345-98a1-11e7-950d-03a3531dacf2; Wed, 13 Sep 2017 16:34:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v8DGYYER017835; Wed, 13 Sep 2017 10:34:34 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1505320474.32063.120.camel@freebsd.org> Subject: hardware RNG harvest rate From: Ian Lepore To: "freebsd-arch@FreeBSD.org" Date: Wed, 13 Sep 2017 10:34:34 -0600 Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2017 16:34:41 -0000 While looking into updating the hardware rng driver for RPi 3 I discovered that on the original wimpy RPi we're feeding random_harvest_queue() with 16 bytes of generated data, 82 times a second.  That seems like a lot of work for a wimpy processor, and probably more than needed for good random numbers. I looked at some other rng drivers, and I see them feeding in a few bytes at a time at rates ranging from 100 Hz to once every 5 seconds.  So no clear concensus there.  Some have this comment:   /* MarkM: FIX!! Check that this does not swamp the harvester! */ A comment block above random_harvest_queue() warns, in part:  * It is also illegal (and morally reprehensible) to insert any  * high-rate data here. So is there any simple "X bytes per second is good and more than Y is wasted/harmful" advice available? -- Ian