Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7166223ybl; Wed, 15 Jan 2020 16:55:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwu+R5LoQ19HKIv7snGa6MbhBl394ycraDdMUuyFZk3jvyJ2lYwCvz1VSue9rF689y+up7z X-Received: by 2002:aca:889:: with SMTP id 131mr2146167oii.3.1579136120873; Wed, 15 Jan 2020 16:55:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579136120; cv=none; d=google.com; s=arc-20160816; b=hQW5BZ6nroqrYw7T2l3VsNLvSZKz+LpSkZbDlkHAM63oUrDKchlR3gehZz5fsd+zIX rgolFyplQsOkwQywBU3U5QtmiTaxAEuNd/UVirJgARbBB4USYaPcBgU2EY8Fsqa/WoDW MTAYi1HODI539rXiiV6QY5UnnRyf4vnss9S9IOZMx7rxH0JduvryHVapktRKWa94KJcH +YqxpEaBjRyfe2HP+rxW6A6iithKZG/GPecU3tgte6faVruHa2dKB3G3Z7iw19zT1Ali X2bjNVMLl33g13/SfaTVFMaL0i4YZys5BhPbRSKzpqv3uK+7MP3wvmFyo9kIQ/wX0H9/ X0kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=MQr6tj+Mp45NCi5STZEnxYiRcYedUwjyvwRnYKIeYBs=; b=BLUzAj7DGoVTTQEnhEU/g/LIiu6dlEwvPgKNIkHv3DlE+Ik/ObR2QLQnByLAdzvSRn OkUFOjwDkGVvW8lvvk9LITaVGTjs7bGpd1PjAajzmYZa9GpnZ6uliJqyGIHCeBtM2BMd 7HHjKqFLtG73QJzx1q+QFXYsNg9hckpydzw6wz0hccze8tkNqtbTpl8x+L91OLwm6Z9G hVH6YwORTWmdw7cqhWnzYVzKU/rP0ZNBUJ49tYGbfebPaC5hya66y4MQmlC5G7xEyy70 eJIH8VtYOZEF3otc+UYlnifdOLDziAOFBr5MlDeopkWURluIP7x1JGjIwTK17nhQWuv9 TqPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uY1sPTi8; 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 f15si10590309oij.160.2020.01.15.16.55.09; Wed, 15 Jan 2020 16:55:20 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uY1sPTi8; 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 S1729449AbgAPARk (ORCPT + 99 others); Wed, 15 Jan 2020 19:17:40 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:54222 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgAPARk (ORCPT ); Wed, 15 Jan 2020 19:17:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MQr6tj+Mp45NCi5STZEnxYiRcYedUwjyvwRnYKIeYBs=; b=uY1sPTi8qPTWhuGaHChPdG568 A6N9YE8YuawRE0rXDlxU2rNZNLpKeg0Ikb6FcoQwapUWphNigQS5QgbiDkZoP2Q87W9gldCQ8K3VL lpMNupV1/VYJBztc8X6Tfy8RUXCsNDYwHsU3ZhOxrlbpnBVWgdXMUBrjdjl6gwVWqYmx5j3b+GuWn KWhCu+YJk7uhblu59dcRVuUb9nAMy2RL5NDWbRtXnim4Obx1Nk1GOSZ3SsiffsmyQ8x1fj62pYOiZ BWb685e9T7PSjqNrWJE+LS59E3uVybTEdtIU2aFtd1Te2NukAImJf4rfsOAck81wtWBsWu9z/sqqr C4fyJh/0g==; Received: from [2601:1c0:6280:3f0::ed68] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1irsqQ-0003a4-T5; Thu, 16 Jan 2020 00:17:06 +0000 Subject: Re: [PATCH v28 09/12] LRNG - add Jitter RNG fast noise source To: =?UTF-8?Q?Stephan_M=c3=bcller?= , Arnd Bergmann Cc: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, LKML , linux-api@vger.kernel.org, "Eric W. Biederman" , "Alexander E. Patrakov" , "Ahmed S. Darwish" , "Theodore Y. Ts'o" , Willy Tarreau , Matthew Garrett , Vito Caputo , Andreas Dilger , Jan Kara , Ray Strode , William Jon McCann , zhangjs , Andy Lutomirski , Florian Weimer , Lennart Poettering , Nicolai Stange , "Peter, Matthias" , Marcelo Henrique Cerri , Roman Drahtmueller , Neil Horman , Julia Lawall , Dan Carpenter References: <6157374.ptSnyUpaCn@positron.chronox.de> <2641155.iNH938UiKq@positron.chronox.de> <5951792.lmNsirYsPE@positron.chronox.de> <2704719.5neY5jeiZ3@positron.chronox.de> From: Randy Dunlap Message-ID: Date: Wed, 15 Jan 2020 16:17:05 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <2704719.5neY5jeiZ3@positron.chronox.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 1/15/20 2:34 AM, Stephan Müller wrote: > > CC: "Eric W. Biederman" > CC: "Alexander E. Patrakov" > CC: "Ahmed S. Darwish" > CC: "Theodore Y. Ts'o" > CC: Willy Tarreau > CC: Matthew Garrett > CC: Vito Caputo > CC: Andreas Dilger > CC: Jan Kara > CC: Ray Strode > CC: William Jon McCann > CC: zhangjs > CC: Andy Lutomirski > CC: Florian Weimer > CC: Lennart Poettering > CC: Nicolai Stange > Reviewed-by: Marcelo Henrique Cerri > Reviewed-by: Roman Drahtmueller > Tested-by: Roman Drahtmüller > Tested-by: Marcelo Henrique Cerri > Tested-by: Neil Horman > Signed-off-by: Stephan Mueller > --- > drivers/char/lrng/Kconfig | 11 +++++ > drivers/char/lrng/Makefile | 1 + > drivers/char/lrng/lrng_jent.c | 89 +++++++++++++++++++++++++++++++++++ > 3 files changed, 101 insertions(+) > create mode 100644 drivers/char/lrng/lrng_jent.c > > diff --git a/drivers/char/lrng/Kconfig b/drivers/char/lrng/Kconfig > index 0d070a3897dd..10b7cbdb8c8e 100644 > --- a/drivers/char/lrng/Kconfig > +++ b/drivers/char/lrng/Kconfig > @@ -92,4 +92,15 @@ config LRNG_KCAPI > provided by the selected kernel crypto API RNG. > endif # LRNG_DRNG_SWITCH > > +config LRNG_JENT > + bool "Enable Jitter RNG as LRNG Seed Source" > + select CRYPTO_JITTERENTROPY Don't select unless CRYPTO is already set/enabled. > + help > + The Linux RNG may use the Jitter RNG as noise source. Enabling > + this option enables the use of the Jitter RNG. Its default > + entropy level is 16 bits of entropy per 256 data bits delivered > + by the Jitter RNG. This entropy level can be changed at boot > + time or at runtime with the lrng_base.jitterrng configuration > + variable. > + > endif # LRNG > diff --git a/drivers/char/lrng/lrng_jent.c b/drivers/char/lrng/lrng_jent.c > new file mode 100644 > index 000000000000..ff0bbe2680c4 > --- /dev/null > +++ b/drivers/char/lrng/lrng_jent.c > @@ -0,0 +1,89 @@ > +// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause > +/* > + * LRNG Fast Noise Source: Jitter RNG > + * > + * Copyright (C) 2016 - 2020, Stephan Mueller > + */ > + > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > + > +#include > +#include > + > +#include "lrng_internal.h" > + > +/* > + * Estimated entropy of data is a 16th of LRNG_DRNG_SECURITY_STRENGTH_BITS. > + * Albeit a full entropy assessment is provided for the noise source indicating > + * that it provides high entropy rates and considering that it deactivates > + * when it detects insufficient hardware, the chosen under estimation of > + * entropy is considered to be acceptable to all reviewers. > + */ > +static u32 jitterrng = LRNG_DRNG_SECURITY_STRENGTH_BITS>>4; > +module_param(jitterrng, uint, 0644); > +MODULE_PARM_DESC(jitterrng, "Entropy in bits of 256 data bits from Jitter " > + "RNG noise source"); One line for the string, please, not split to 2 lines. -- ~Randy Reported-by: Randy Dunlap