Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6488985rwi; Tue, 18 Oct 2022 13:07:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PJfbDLEJ7uWZiE+lD1jTH2y1dhkqJMu5yXyNKdzkSG31G0Mh02ogO1bb6PzLx5Ee9Dyxc X-Received: by 2002:a05:6a00:bc7:b0:562:d2e5:adfd with SMTP id x7-20020a056a000bc700b00562d2e5adfdmr5068898pfu.4.1666123636683; Tue, 18 Oct 2022 13:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666123636; cv=none; d=google.com; s=arc-20160816; b=BArt+l43M6DdCJb+8ukPEqCag2A1YTrKB1P5SMwkC2Ul8/f9z2fgsfAzXLKNUfovkT HsrRTlj48hIShauZtFwNmJShS+nBbgKPAR7SRmOdlvf4MYPdG9RNxmgeV5co9MM+PGK+ s81niPhY2rlx2FIrddtIsCX/57mUlY5hTeowKUF4ooWOLwCmZhRPe0P6BNtqGWYaf71a AnOyLuZFd6KOzCKgXz+/juJ/K3lxMruwlyfVTJI/YR345JmkWnDmjUuFr4F/30+bWawP gqsFAmYyFoWIIL1CiSw0BjIjVp4sAsBgPupdEm0efE26/KcZmgjz9SjH6j6wo44gOKQ/ Tb0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5+lff+l0lN3HpBVXRxyI6Up31aD+I4kLCKcS9kAibmI=; b=lAxrlMn9mhpHy68pJDzxvzJwM3V2bHY+1QpSdJ27KQfM5lyDS7TRvSJLng1rvXklWy NcSusOfuZLEpzIcU7ecIj3d1HxyW6u0MDW1rh+Wi+aha6cuaLk3PHRmKckapExvOwHoO bLRQoSuIE7LGCkRRIu9aIVTOTg5/oaFmbT1IIpGKoGeEAGBCn6p143Z5ne2hzkr7bq2p iWLNbUguxn41wIRaVFsauppE61cBu1WvuYzLEw9aGbMdmcBBeWWLBxxvvVeF6d7gqsa7 di/fXh1J2Ylf1Lp9GJ6EeunTPJaKaxj4lRnu4tzS36LMtLfmOJxyaxoaoS/M2PcHELIM SlMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iP1NI2N0; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q34-20020a635c22000000b0043c9db24662si16209453pgb.269.2022.10.18.13.06.12; Tue, 18 Oct 2022 13:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iP1NI2N0; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbiJRUEt (ORCPT + 99 others); Tue, 18 Oct 2022 16:04:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiJRUEq (ORCPT ); Tue, 18 Oct 2022 16:04:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95EA028E01 for ; Tue, 18 Oct 2022 13:04:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 84762B81F12 for ; Tue, 18 Oct 2022 20:04:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B69FFC433B5; Tue, 18 Oct 2022 20:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666123478; bh=MVStoeot+9N481gE+IzlwIXraNYXd9DYcPzHHvi46mA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iP1NI2N0eYGt+NG1l+J9mG66e2+ClaHI8XfDrfu3kOil5zmpzSnLInTF54UW7LUZA 0pNY7r7SSH6MLt6WfRfZR+lIC9oUnJzFD98qKKZAYW2yHBJ0cTj6cAvzzszXO1PL13 /Ee/XsEaKX5txTkbetj8TGAJrkKkdJMrjxGAkvyUyqpyOh690Nhj0Wy1AZlJK1zVX6 uvuHp2Do2MfKWPKun0AT8Ktfn0Dm4By4cx9ueKLd4nAtUPAZ7LmoytaI0jjL1mAZGD Eqx3FY0GbsirSmzoQu18ioKH6NP5pevlHOvEF0lWHi/sGIYqtR5EmLJeQ3ouc/mnFK HXaQi3r5MCabA== From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: keescook@chromium.org, ebiggers@kernel.org, jason@zx2c4.com, herbert@gondor.apana.org.au, nikunj@amd.com, Ard Biesheuvel Subject: [PATCH v3 1/3] crypto: move gf128mul library into lib/crypto Date: Tue, 18 Oct 2022 22:04:20 +0200 Message-Id: <20221018200422.179372-2-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221018200422.179372-1-ardb@kernel.org> References: <20221018200422.179372-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2469; i=ardb@kernel.org; h=from:subject; bh=MVStoeot+9N481gE+IzlwIXraNYXd9DYcPzHHvi46mA=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjTwbB0vEsO+UUZuKB7qbu1LDJGNo0I6eQ1XIqe/mZ RwGA+96JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY08GwQAKCRDDTyI5ktmPJJ2ODA CzpKqOcxqbWKEsMOqTlNNNDhne786zvI/6KPWRts8eFO6WoJFJdvCnNJbilvcBXoam+WCUXVt+lkmX k97ylURwH71fT56A2AeFyempCRxEmWJRI7MKCq97lMoU+k+0Wk8seLTKEi9VZJlxiz3NFn75ZIVf5t ihThRDxf1yuNKHdqM8gIpN3UJx9Hk5I/qEixW2GqYk0wKdChqrxfZbo00OW/XckbtmMlNUXNH5vvTh Luhucm4j4CWzpnMmQO3qTvWCA/Is5SIa56DiBD+GwynotJEj8X11uh9kijAfr2W+8T6FMBxacc1wny AJ9dWt7w+YDHEkea2NTC0wI4trMhS0srjtHcsG33uiaJndSGEQsngmMXuObWQBrBISPT2nsVFWElB1 goSiNOg+8fKvi9FUCAc7k8YmVROMiyNi5CPGDDYhY+UV2atGjMdp8ZyNjsQnhCYNOZjSMPA9vb/0Dm INv5SJpP6Pr+KXaFaLDmqUxaH8EYZ+OA34S3XKRz1jGHA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The gf128mul library does not depend on the crypto API at all, so it can be moved into lib/crypto. This will allow us to use it in other library code in a subsequent patch without having to depend on CONFIG_CRYPTO. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 3 --- crypto/Makefile | 1 - lib/crypto/Kconfig | 3 +++ lib/crypto/Makefile | 2 ++ {crypto => lib/crypto}/gf128mul.c | 0 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index 2589ad5357df..a466beb64a69 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -175,9 +175,6 @@ config CRYPTO_MANAGER_EXTRA_TESTS This is intended for developer use only, as these tests take much longer to run than the normal self tests. -config CRYPTO_GF128MUL - tristate - config CRYPTO_NULL tristate "Null algorithms" select CRYPTO_NULL2 diff --git a/crypto/Makefile b/crypto/Makefile index 303b21c43df0..d0126c915834 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -85,7 +85,6 @@ obj-$(CONFIG_CRYPTO_WP512) += wp512.o CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b_generic.o CFLAGS_blake2b_generic.o := -Wframe-larger-than=4096 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105930 -obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o obj-$(CONFIG_CRYPTO_ECB) += ecb.o obj-$(CONFIG_CRYPTO_CBC) += cbc.o obj-$(CONFIG_CRYPTO_CFB) += cfb.o diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig index 7e9683e9f5c6..2a4b57779fd7 100644 --- a/lib/crypto/Kconfig +++ b/lib/crypto/Kconfig @@ -8,6 +8,9 @@ config CRYPTO_LIB_UTILS config CRYPTO_LIB_AES tristate +config CRYPTO_GF128MUL + tristate + config CRYPTO_LIB_ARC4 tristate diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile index c852f067ab06..60bb566eed78 100644 --- a/lib/crypto/Makefile +++ b/lib/crypto/Makefile @@ -10,6 +10,8 @@ obj-$(CONFIG_CRYPTO_LIB_CHACHA_GENERIC) += libchacha.o obj-$(CONFIG_CRYPTO_LIB_AES) += libaes.o libaes-y := aes.o +obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o + obj-$(CONFIG_CRYPTO_LIB_ARC4) += libarc4.o libarc4-y := arc4.o diff --git a/crypto/gf128mul.c b/lib/crypto/gf128mul.c similarity index 100% rename from crypto/gf128mul.c rename to lib/crypto/gf128mul.c -- 2.35.1