From patchwork Tue Dec 2 09:02:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Spelvin X-Patchwork-Id: 5418561 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 76AE99F1C5 for ; Tue, 2 Dec 2014 09:02:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FF5C20160 for ; Tue, 2 Dec 2014 09:02:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D654620120 for ; Tue, 2 Dec 2014 09:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750931AbaLBJCD (ORCPT ); Tue, 2 Dec 2014 04:02:03 -0500 Received: from ns.horizon.com ([71.41.210.147]:18790 "HELO ns.horizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750927AbaLBJCC (ORCPT ); Tue, 2 Dec 2014 04:02:02 -0500 Received: (qmail 19814 invoked by uid 1000); 2 Dec 2014 04:02:01 -0500 Date: 2 Dec 2014 04:02:01 -0500 Message-ID: <20141202090201.19813.qmail@ns.horizon.com> From: "George Spelvin" To: herbert@gondor.apana.org.au, nhorman@tuxdriver.com Subject: [PATCH 17/17] crypto: ansi_cprng - Shrink default seed size Cc: linux-crypto@vger.kernel.org, linux@horizon.com, smueller@chronox.de In-Reply-To: <20141202083314.17647.qmail@ns.horizon.com> 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 The larger seed with deterministic DT is still supported, but make the default non-deterministically random, with fresh DT. This must come after the patch that makes testmgr.c not depend on the default seedsize to allocate its buffers, since it tests the non-default (larger seed) case. Signed-off-by: George Spelvin --- crypto/ansi_cprng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Patch 15 is a prerequisite for this one. diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 4ed7c0cf..875c4bf9 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -390,7 +390,7 @@ static struct crypto_alg rng_algs[] = { { .rng = { .rng_make_random = cprng_get_random, .rng_reset = cprng_reset, - .seedsize = DEFAULT_PRNG_KSZ + 2*DEFAULT_BLK_SZ, + .seedsize = DEFAULT_BLK_SZ + DEFAULT_PRNG_KSZ } } #ifdef CONFIG_CRYPTO_FIPS @@ -408,7 +408,7 @@ static struct crypto_alg rng_algs[] = { { .rng = { .rng_make_random = fips_cprng_get_random, .rng_reset = fips_cprng_reset, - .seedsize = DEFAULT_PRNG_KSZ + 2*DEFAULT_BLK_SZ, + .seedsize = DEFAULT_BLK_SZ + DEFAULT_PRNG_KSZ } } #endif