Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5E3DC433EF for ; Mon, 28 Mar 2022 13:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LRNwIfewu1/Ld/75IhXBXJYE1PhXNp3EQqTcQRjDrIU=; b=bJQiK/3umAp5n7cZtt1TnQe3pz i6ln/T6+cK77Xg3NDTDywQJeJVaGMOWkNbZ0DwRldihZXAkMn5GfVkUEXzsAtYpCJ2EK1LHH5YoNw 5RloMKfiyLrm5psH8SoLVm9qCK7n+rjrdMP2ZEGUrMsW2wC869mLpNJEgQ4dWltRsEKLoe8HQ9aCD nF5OrPydPfRO+QSYUHhrOKZVx2Gz9hZJl8eXH68DMzcgJM6OtNtDokZWPm89rin3Vt4lX9aV/4XEx ar0tvjJTwPK865uFcSKkuRiTJ+P6qbk7MXtJw9g0B3iHl2ZhAiZj6xtfgIt0vu7NxWAt/eqxG737C EbKgjR3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYpbd-008ql3-Hd; Mon, 28 Mar 2022 13:40:25 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYpb5-008qWk-JP for linux-nvme@lists.infradead.org; Mon, 28 Mar 2022 13:39:54 +0000 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EBF1F1F385; Mon, 28 Mar 2022 13:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1648474789; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LRNwIfewu1/Ld/75IhXBXJYE1PhXNp3EQqTcQRjDrIU=; b=Hv94N5mEicwgKXW+QNR7z2H1DIEGEFtsa+BpAI9rRa2pYuN1W+3Q6JNvbt956mmRpq/DrA bl4mpQGD+eLiVfuCFJFVTSpHeUj1LEx/v6j9isCOcrLXKAB+cHxjQcXL12v1bEOnor/4xq yC/FJBrYbqtEwXxbRYB84R8Jdpv5LuA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1648474789; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LRNwIfewu1/Ld/75IhXBXJYE1PhXNp3EQqTcQRjDrIU=; b=EY4nkaGlOWyyi+Z5PC0wH84oy0e7WxxD4RnC5pDNstI/FBmvGCJ1mbRKrcoie0VLDv4Jk+ CUlLyKOntAOZGEAg== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id E32A6A3B95; Mon, 28 Mar 2022 13:39:49 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 16045) id D496451939D8; Mon, 28 Mar 2022 15:39:49 +0200 (CEST) From: Hannes Reinecke To: Christoph Hellwig Cc: Sagi Grimberg , Keith Busch , linux-nvme@lists.infradead.org, Hannes Reinecke , Chaitanya Kulkarni , Himanshu Madhani Subject: [PATCH 02/11] crypto: add crypto_has_kpp() Date: Mon, 28 Mar 2022 15:39:29 +0200 Message-Id: <20220328133938.146146-3-hare@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220328133938.146146-1-hare@suse.de> References: <20220328133938.146146-1-hare@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220328_063951_882891_63329324 X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org Add helper function to determine if a given key-agreement protocol primitive is supported. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Himanshu Madhani --- crypto/kpp.c | 6 ++++++ include/crypto/kpp.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/crypto/kpp.c b/crypto/kpp.c index 7aa6ba4b60a4..678e871ce418 100644 --- a/crypto/kpp.c +++ b/crypto/kpp.c @@ -104,6 +104,12 @@ int crypto_grab_kpp(struct crypto_kpp_spawn *spawn, } EXPORT_SYMBOL_GPL(crypto_grab_kpp); +int crypto_has_kpp(const char *alg_name, u32 type, u32 mask) +{ + return crypto_type_has_alg(alg_name, &crypto_kpp_type, type, mask); +} +EXPORT_SYMBOL_GPL(crypto_has_kpp); + static void kpp_prepare_alg(struct kpp_alg *alg) { struct crypto_alg *base = &alg->base; diff --git a/include/crypto/kpp.h b/include/crypto/kpp.h index cccceadc164b..24d01e9877c1 100644 --- a/include/crypto/kpp.h +++ b/include/crypto/kpp.h @@ -104,6 +104,8 @@ struct kpp_alg { */ struct crypto_kpp *crypto_alloc_kpp(const char *alg_name, u32 type, u32 mask); +int crypto_has_kpp(const char *alg_name, u32 type, u32 mask); + static inline struct crypto_tfm *crypto_kpp_tfm(struct crypto_kpp *tfm) { return &tfm->base; -- 2.29.2