From patchwork Fri Apr 24 13:40:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 11507891 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC969912 for ; Fri, 24 Apr 2020 13:41:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB64B20776 for ; Fri, 24 Apr 2020 13:41:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="PbpA/M6v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727074AbgDXNk7 (ORCPT ); Fri, 24 Apr 2020 09:40:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727034AbgDXNk5 (ORCPT ); Fri, 24 Apr 2020 09:40:57 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F86DC09B046 for ; Fri, 24 Apr 2020 06:40:57 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id b11so10851429wrs.6 for ; Fri, 24 Apr 2020 06:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lZIpuSXPWLsZ3Ntzn02RaqZNB9d6vv/shxve5+NZrVw=; b=PbpA/M6vlDjGx2msHfbPEgx/0Gh27wx83HRlNWMItDypNd1lm61IKglY2gTJqgHinR pAI2vwQKyWYpC2JofIrkmK4L/w5JRW9VVwabZuxF2F/EAI6fyRdtTwlFwDnJzwHavsGj eYkmVQCHT7SKlFeCGqLmQvVvfOC1wBlohUFmISLz858FmCRTkQxCstXuIUjjd4hz3J8l iYe30ZIP7XCSCzCu/Zg6EBfg2nssXmH0tNxPu5gPFmnmzwpIE8sKgzXC+yqF2EqCUwOs CO1u5xmMHTLIISY16OX4YAbl95NyLc04RJR967aJqJNt0Q7WM/Xcw+hslecFOvRf1d7S ReNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lZIpuSXPWLsZ3Ntzn02RaqZNB9d6vv/shxve5+NZrVw=; b=PHgVXjUiOzr+C9sOTTc0nTJ/gaGoGVEE29V4C+GAFVkDO8yz1qUNzYjUDZwIeT/aCb lF32A89PB2XD6RhTaZul4yOUHNi3WMMBoFNCGHRnysFvUuSTlCgEkQvFkA/oVYxtCYZv SAuHwvxMith6AIu9eUKPAakF2614Aor3on7x467R0QiG5NhWo9EBrI1Z9UheVZomw9nK hma9hcSr7Uugvu3mI9ZEuhTc46l+DW4oQtDiIyScN2HgSusqASfFk1N4RwYVTKWbeHUg FcuOcYrcsh1OojZ5BTeele1H9kYPnDDTJ7pUwRGboE48wY3mkgeXzXIPrFPLpP2cNTZs 1qZg== X-Gm-Message-State: AGi0PuZgen9eAVO13dmF08fml4tYtWSg1EfQTB36iLKM4b5tVOIXti1s j4nmoV38AipBNoHBT487Ae+dXSIyaAk= X-Google-Smtp-Source: APiQypL35SBMMUsY5m5WKFj4P1hk4bx3+QgIbAuAEuKOPI7TwoKFQzAuisIx7hpc0X/gdYCoGiqr1Q== X-Received: by 2002:adf:fe87:: with SMTP id l7mr11890198wrr.360.1587735656113; Fri, 24 Apr 2020 06:40:56 -0700 (PDT) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id 185sm3408958wmc.32.2020.04.24.06.40.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Apr 2020 06:40:55 -0700 (PDT) From: Corentin Labbe To: davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH v3 1/3] crypto: drbg: DRBG should select SHA512 Date: Fri, 24 Apr 2020 13:40:45 +0000 Message-Id: <1587735647-17718-2-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587735647-17718-1-git-send-email-clabbe@baylibre.com> References: <1587735647-17718-1-git-send-email-clabbe@baylibre.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Since DRBG could use SHA384/SHA512, it should select it. Signed-off-by: Corentin Labbe --- crypto/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index c24a47406f8f..6d27fc6a7bf5 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -1810,10 +1810,12 @@ config CRYPTO_DRBG_HMAC default y select CRYPTO_HMAC select CRYPTO_SHA256 + select CRYPTO_SHA512 config CRYPTO_DRBG_HASH bool "Enable Hash DRBG" select CRYPTO_SHA256 + select CRYPTO_SHA512 help Enable the Hash DRBG variant as defined in NIST SP800-90A. From patchwork Fri Apr 24 13:40:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 11507887 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 396F192A for ; Fri, 24 Apr 2020 13:41:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20C3A20776 for ; Fri, 24 Apr 2020 13:41:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="ADkPnr9y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727034AbgDXNlF (ORCPT ); Fri, 24 Apr 2020 09:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727089AbgDXNlA (ORCPT ); Fri, 24 Apr 2020 09:41:00 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59342C09B047 for ; Fri, 24 Apr 2020 06:40:58 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id g13so10848639wrb.8 for ; Fri, 24 Apr 2020 06:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ndmpq96aa384Sl37ToPJaNdgDlf/x8LYEzQhHaZaot8=; b=ADkPnr9yiaJF6N83Qi1UawN9bUOTC2Lz/MtEbZn5OOZx/E5srl3KrUk2E27M/S2X4r U1eeGYQLhrcy++Mk8dVDU98gGWuwX0FrxKaeRuzRQYoexv3d2HB1sScZ3lMTK8k+uxR7 SnkeUasvRakQ1tu2bREUrO8DV6761/6cnQYh5vTiQ+QrZ57zSXb+rwbzqS2tnRORzxI3 EJGcPmAcEl/wDCAeDX+1PSnhr2yPh/U8tLNgst4aOKqOpfHU5fpuNOtFjZsSIIAuzVy7 56vs+RbGY7D0CMMyXQmAJSoPpYhpNXhGPea3ipagCNecPElxA5TMVfb1f+7AzTn7m1GH ijaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ndmpq96aa384Sl37ToPJaNdgDlf/x8LYEzQhHaZaot8=; b=MMeKNuMk24Hwd2Ej4boOQMjmeqqK5x4OZlBxQQXTmxrwlDnecyVjU7oFp9mSeLeBQu WT3qPtjRD8SLABB6rxJRl2t0hAR0FreK9PAO+iP7RTw9qClsjVSqYoPjmYUhzVKPmao9 XfhkEzAP4Rsapydg+oaEBVPDxtAJRwrsRxPEdlkrJrwc4LDM9hmjO+MYvIzIWGsUlGic b1hG2q7AuGNhy8TQGjAF73bOdk/pt4VcUxXdjC9whY5j0WHaWR9CTMUKwdACgxdNLnG2 8ZWZhXNqlKTGjs4aidcb7SmS0J6KoY3BlAfaWAHAeuXAw4Ap0+zySEixtvmLXv01XXK7 aKsA== X-Gm-Message-State: AGi0PuZNQA3EXASXZ5226SHtGguWIDT/jSkQ+7iZbfAXfqtOkjOuFdsF WFSQCIrQ8k3XaXwDpJJU3qkKncv6S1U= X-Google-Smtp-Source: APiQypIM3oR2zdqBn4FAYYq15nUy0OKbqAG2Qu+Xz4Qva4HgoEXlu8D3GkIfWKWMwxq1IUmnin2vMQ== X-Received: by 2002:adf:83c2:: with SMTP id 60mr11023887wre.169.1587735657134; Fri, 24 Apr 2020 06:40:57 -0700 (PDT) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id 185sm3408958wmc.32.2020.04.24.06.40.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Apr 2020 06:40:56 -0700 (PDT) From: Corentin Labbe To: davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH v3 2/3] crypto: CRYPTO_CTR no longer need CRYPTO_SEQIV Date: Fri, 24 Apr 2020 13:40:46 +0000 Message-Id: <1587735647-17718-3-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587735647-17718-1-git-send-email-clabbe@baylibre.com> References: <1587735647-17718-1-git-send-email-clabbe@baylibre.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org As comment of the v2, Herbert said: "The SEQIV select from CTR is historical and no longer necessary." So let's get rid of it. Signed-off-by: Corentin Labbe --- crypto/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index 6d27fc6a7bf5..a5936e967fe2 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -370,7 +370,6 @@ config CRYPTO_CFB config CRYPTO_CTR tristate "CTR support" select CRYPTO_SKCIPHER - select CRYPTO_SEQIV select CRYPTO_MANAGER help CTR: Counter mode From patchwork Fri Apr 24 13:40:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 11507889 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A89492A for ; Fri, 24 Apr 2020 13:41:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0190220736 for ; Fri, 24 Apr 2020 13:41:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="G81Ll6c5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbgDXNlG (ORCPT ); Fri, 24 Apr 2020 09:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727082AbgDXNk7 (ORCPT ); Fri, 24 Apr 2020 09:40:59 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 560CBC09B045 for ; Fri, 24 Apr 2020 06:40:59 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id g13so10848707wrb.8 for ; Fri, 24 Apr 2020 06:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O3kXCksVkplPGu3RGgTbI+iq8pciZUYI4GkLsC8wbL8=; b=G81Ll6c5opzW5zFc63Alaqh/e+btp5X6IQl1HpHHDi6dl0xRO4wvNA9qi3J59TOz+o SvXiRP6tetznCFSbdETva7YcrKJmDPcBMJKNIJZJXgO4RpYRS0sWAgEILBButaqg8W80 TW5Uls5hswSlnuMz0fv//No+aoD9XjRGTWb1ulgHJ7j1xVCLGjNzXQ0Mh/oGWgTND94d pgQZhaaJ3DvAWxn1eKeoZpZcc7JEp3EX/WsQO7pD6nvwBYGG5Lcj3dlk38mwmXMFmzT4 gFSb4lLr6W+VJpwRLk296Jzz3kTCeajnhE4WJLkLXLhFvqPqegy7ZGijF5hEV1mPB7uk /OoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O3kXCksVkplPGu3RGgTbI+iq8pciZUYI4GkLsC8wbL8=; b=pV+JGD4ecIcsdrYo9v4IPkuOhTYKLELtQ9fxrtErwT7UZuI+lE3ILLUfSp7d2b6WEm xxliWPrAudNKNrYYksPwBA4otDG2SvlKKmaXwMMII1CK55eCAfzop4KAYva0lRDctkig xLH6CnBeHV910McVGGf472cV1UODkcAlTmRdqOuTw8e9u9se8guVVo3YDVE9mkWkBeP0 Cc6mMHuHzxNqT5pMalztaZ/EEIR0rEgzVTQyERODP7Nx2T55wEba6cgZjr+oicREOM1N yk49tMVT09m/KWSvqbFPvd3ZVKUhkz7ZmzduugOyoOhrAImCWumJU2OjhG/aPCvt5wvW Fl9Q== X-Gm-Message-State: AGi0PuZ+Q0zuqRVEnPTzncIzDgZjir67E42p1xFecZszX+q/Fz9ck2GU azOlaLZRo8gKQAYH0vSFDAyXwA== X-Google-Smtp-Source: APiQypKnTfqip7b5mE8+3UKvsXuGNUavHQ6pIWXq2hDs60y/tQb8fIgLHxsyOKmb1F51FZBX1GVKNg== X-Received: by 2002:adf:d091:: with SMTP id y17mr10891464wrh.418.1587735658098; Fri, 24 Apr 2020 06:40:58 -0700 (PDT) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id 185sm3408958wmc.32.2020.04.24.06.40.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Apr 2020 06:40:57 -0700 (PDT) From: Corentin Labbe To: davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH v3 3/3] crypto: drbg: DRBG_CTR should select CTR Date: Fri, 24 Apr 2020 13:40:47 +0000 Message-Id: <1587735647-17718-4-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587735647-17718-1-git-send-email-clabbe@baylibre.com> References: <1587735647-17718-1-git-send-email-clabbe@baylibre.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org if CRYPTO_DRBG_CTR is builtin and CTR is module, allocating such algo will fail. DRBG: could not allocate CTR cipher TFM handle: ctr(aes) alg: drbg: Failed to reset rng alg: drbg: Test 0 failed for drbg_pr_ctr_aes128 DRBG: could not allocate CTR cipher TFM handle: ctr(aes) alg: drbg: Failed to reset rng alg: drbg: Test 0 failed for drbg_nopr_ctr_aes128 DRBG: could not allocate CTR cipher TFM handle: ctr(aes) alg: drbg: Failed to reset rng alg: drbg: Test 0 failed for drbg_nopr_ctr_aes192 DRBG: could not allocate CTR cipher TFM handle: ctr(aes) alg: drbg: Failed to reset rng alg: drbg: Test 0 failed for drbg_nopr_ctr_aes256 So let's select CTR instead of just depend on it. Signed-off-by: Corentin Labbe --- crypto/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index a5936e967fe2..7c2c09a76173 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -1821,7 +1821,7 @@ config CRYPTO_DRBG_HASH config CRYPTO_DRBG_CTR bool "Enable CTR DRBG" select CRYPTO_AES - depends on CRYPTO_CTR + select CRYPTO_CTR help Enable the CTR DRBG variant as defined in NIST SP800-90A.