From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F90DC43444 for ; Sat, 12 Jan 2019 05:28:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FF1821783 for ; Sat, 12 Jan 2019 05:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547270883; bh=sJA3D8jZy1xB28qUxmFVn6TTU/D9WZsThVBFgei5Gm8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=tgCIeGd1p74MKdLGKEsDueSCdTc8OxrIUdaHjcefyvu3urQBoCdtyMHROfzMIaLiC Ec7K7cgfVvAE2W5bXAEptK/zNEB9ZpCRTrnJNIEdjlOWEPJz9ZtIYYIPVMFnWMwuUQ lz04u8/p5BInrnDsCV56I8ielPSr0CHFy3kqgJc8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725870AbfALF2C (ORCPT ); Sat, 12 Jan 2019 00:28:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:33372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbfALF2C (ORCPT ); Sat, 12 Jan 2019 00:28:02 -0500 Received: from sol.localdomain (c-24-23-143-129.hsd1.ca.comcast.net [24.23.143.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A24182086C; Sat, 12 Jan 2019 05:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547270881; bh=sJA3D8jZy1xB28qUxmFVn6TTU/D9WZsThVBFgei5Gm8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sxexAAZu6HT8IjdjnBWesenfPyg0KN294Qn+OnzTAAGf0zevmmW/qzPnpdeD0iecX rCg37ZtTh/NmZLu06IFpFXiioyX0MsPdZXS25Zs+a9TOD2pWUe2mAr6CF5PvwBHN7S cbch3VCuc97k8Opandw53D4jYsYTYGZfksvxT7L0= Date: Fri, 11 Jan 2019 21:27:59 -0800 From: Eric Biggers To: Stephan =?iso-8859-1?Q?M=FCller?= Cc: Herbert Xu , James Bottomley , Andy Lutomirski , "Lee, Chun-Yi" , "Rafael J . Wysocki" , Pavel Machek , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, keyrings@vger.kernel.org, "Rafael J. Wysocki" , Chen Yu , Oliver Neukum , Ryan Chen , David Howells , Giovanni Gherdovich , Randy Dunlap , Jann Horn , Andy Lutomirski , linux-crypto@vger.kernel.org Subject: Re: [PATCH 2/6] crypto: kdf - SP800-108 Key Derivation Function Message-ID: <20190112052758.GD639@sol.localdomain> References: <20190103143227.9138-1-jlee@suse.com> <20190109082103.GA8586@sol.localdomain> <9733066.Vrs4h5eWcW@positron.chronox.de> <1830918.5I3Y3k8tQf@positron.chronox.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1830918.5I3Y3k8tQf@positron.chronox.de> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 08:10:02PM +0100, Stephan Müller wrote: > The SP800-108 compliant Key Derivation Function is implemented as a > random number generator considering that it behaves like a deterministic > RNG. > > All three KDF types specified in SP800-108 are implemented. > > The code comments provide details about how to invoke the different KDF > types. > > Signed-off-by: Stephan Mueller > --- > crypto/Kconfig | 7 + > crypto/Makefile | 1 + > crypto/kdf.c | 492 ++++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 500 insertions(+) > create mode 100644 crypto/kdf.c > > diff --git a/crypto/Kconfig b/crypto/Kconfig > index 86960aa53e0f..cc80d89e0cf5 100644 > --- a/crypto/Kconfig > +++ b/crypto/Kconfig > @@ -561,6 +561,13 @@ config CRYPTO_HMAC > HMAC: Keyed-Hashing for Message Authentication (RFC2104). > This is required for IPSec. > > +config CRYPTO_KDF > + tristate "Key Derivation Function (SP800-108)" > + select CRYPTO_RNG > + help > + Support for KDF compliant to SP800-108. All three types of > + KDF specified in SP800-108 are implemented. > + > config CRYPTO_XCBC > tristate "XCBC support" > select CRYPTO_HASH > diff --git a/crypto/Makefile b/crypto/Makefile > index 799ed5e94606..69a0bb64b0ac 100644 > --- a/crypto/Makefile > +++ b/crypto/Makefile > @@ -58,6 +58,7 @@ crypto_user-y := crypto_user_base.o > crypto_user-$(CONFIG_CRYPTO_STATS) += crypto_user_stat.o > obj-$(CONFIG_CRYPTO_CMAC) += cmac.o > obj-$(CONFIG_CRYPTO_HMAC) += hmac.o > +obj-$(CONFIG_CRYPTO_KDF) += kdf.o This naming is too generic. CONFIG_CRYPTO_KDF and kdf.c imply that this is related to all KDFs. But actually it is an implementation of a few specific KDFs. Can you give it a clearer name, like KDF_SP800? - Eric