From patchwork Sun Dec 7 12:26:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Spelvin X-Patchwork-Id: 5451561 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C8EE4BEEA8 for ; Sun, 7 Dec 2014 12:27:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC04120154 for ; Sun, 7 Dec 2014 12:27:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1070120155 for ; Sun, 7 Dec 2014 12:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753183AbaLGM1N (ORCPT ); Sun, 7 Dec 2014 07:27:13 -0500 Received: from ns.horizon.com ([71.41.210.147]:16236 "HELO ns.horizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753201AbaLGM1H (ORCPT ); Sun, 7 Dec 2014 07:27:07 -0500 Received: (qmail 20893 invoked by uid 1000); 7 Dec 2014 07:26:56 -0500 From: George Spelvin To: nhorman@tuxdriver.com, linux-crypto@vger.kernel.org Cc: smueller@chronox.de, herbert@gondor.apana.org.au, linux@horizon.com Subject: [PATCH v2 22/25] crypto: ansi_cprng - Tweak comments Date: Sun, 7 Dec 2014 07:26:30 -0500 Message-Id: <7d3afdf56eb85b9e06586a97bad963f4f24c3030.1417951990.git.linux@horizon.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's not based on the NIST-recommended algorithm, it *is* the NIST-recommended algorithm, and has even passed their validation tests. Also make clear that it's intended to be a determinsitic generator, despite the confusing name of the DT vector. Signed-off-by: George Spelvin --- crypto/ansi_cprng.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index f3e280c4..9c8475a2 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -1,7 +1,9 @@ /* - * PRNG: Pseudo Random Number Generator - * Based on NIST Recommended PRNG From ANSI X9.31 Appendix A.2.4 using - * AES 128 cipher + * PRNG: This is the "NIST-Recommended Random Number Generator Based + * on ANSI X9.31 Appendix A.2.4" using the AES 128 cipher. + * Many specific kernel snapshots have collected validations from + * the NIST RNG Validation System; results are available at + * http://csrc.nist.gov/groups/STM/cavp/documents/rng/rngval.html * * (C) Neil Horman * @@ -9,8 +11,6 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * any later version. - * - * */ #include @@ -36,7 +36,12 @@ * Note: DT is our counter value * V is our seed vector * See http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf - * for implementation details + * for implementation details. + * + * Note that even though DT stands for "date/time", since this is a + * deterministic pseudo-random generator, it is a determinsitic counter, + * not a timestamp. Its function is not to inject seed entropy, but to + * ensure a long period in the output. */ struct prng_context { spinlock_t prng_lock;