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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 81112C04FF3 for ; Mon, 24 May 2021 20:22:47 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 072C66140B for ; Mon, 24 May 2021 20:22:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 072C66140B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 803F282F2A; Mon, 24 May 2021 22:20:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pS+xxMNQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C90382EC9; Mon, 24 May 2021 22:19:59 +0200 (CEST) Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CA6E882EE3 for ; Mon, 24 May 2021 22:19:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-oi1-x231.google.com with SMTP id j75so28148819oih.10 for ; Mon, 24 May 2021 13:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mZWA1xuNmJtcDFExz5UCrwrPKHwQBvMfhWKjBtHy/j4=; b=pS+xxMNQ0+Opbw0ee7qimttwvleNppZwZCpY6lrJmMzJ0uuZE4ape6mba4MHoJDXpL vZ8snEV5gStLSG1ePNuz/nhpA6jPqVL8niGoFL2RBOVNpvPdIuIkZBdNGG6ETVKiHykf IUllWxg+AXWSCz4d1vKVN3U9jlMgfGuspACpXCjKfhSVyk9Qojvu8tZ2nxIMWibQftdz /3PowHuAPDSfJy/uzL0ZlfnJBdChFa6SzTj7hRO/OlaT+YEZup2eW9zYkRHDkck6VK68 vzINnmIKF+88TKZqPNBp/kZhnhW6Dlq9YS+9JQHprnr+irL3v+NT/f9QzuP5oT4wfZYu Hdiw== 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:mime-version:content-transfer-encoding; bh=mZWA1xuNmJtcDFExz5UCrwrPKHwQBvMfhWKjBtHy/j4=; b=RU1u3BOaFba95tm7dckAqH3Olx5Hc1NjuGSWQ1rvKecSA9IABApKiB3gSfl3MjOPFf XVyTwoCB/i/g6NhVsxg8GQlgBcbxMaD7wvWYuFYdkVDpmD3/o6KFd90pUiufuCA3zjrA +/AAnd0yjcfH3L7MljDyeMeWd4X17yUETbR37hIpa0jNlgwdDBMFC/YbzZUAkAovWO0J 3Tz7ecp/mzZ+2SLIDo/r9wur1CDt8763YLMlykx4suY6tb49fB4GTse5Y53Z+7a6NnKI 0VeyjhKpA1uJzDXSRDvx1X691rzlm2FR9Ts2T+fawCJu/z7DUJ8pPlaT2ofl9Cwpfsn+ E6gA== X-Gm-Message-State: AOAM5304WgE/b5sg/B05MMMkAfoZnEvpH48Nk9D11VSrff8jpPaNJvrT 7xSL+zs6AxuXOSCdflT0GThepu3VnnHbZw== X-Google-Smtp-Source: ABdhPJyj//+9IZ4HKy34nWhvKY4ePCBDEw6UsVHSipbfFo0k4zqR3cK7F3VR//UZXzMG5nSwkcnYAA== X-Received: by 2002:aca:bcc5:: with SMTP id m188mr542301oif.15.1621887593407; Mon, 24 May 2021 13:19:53 -0700 (PDT) Received: from nuclearis3.lan (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id w13sm2816338otp.10.2021.05.24.13.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 13:19:52 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, sjg@chromium.org Cc: Alexandru Gagniuc , trini@konsulko.com, michal.simek@xilinx.com, rasmus.villemoes@prevas.dk Subject: [PATCH v2 15/18] lib: rsa: Remove #ifdefs from rsa.h Date: Mon, 24 May 2021 15:19:36 -0500 Message-Id: <20210524201939.1491676-16-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524201939.1491676-1-mr.nuke.me@gmail.com> References: <20210524201939.1491676-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean It is no longer necessary to implement rsa_() functions as no-ops depending on config options. It is merely sufficient to provide the prototypes, as the rsa code is no longer linked when unused. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- include/u-boot/rsa.h | 47 -------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/include/u-boot/rsa.h b/include/u-boot/rsa.h index bc564d56fa..89a9c4caa0 100644 --- a/include/u-boot/rsa.h +++ b/include/u-boot/rsa.h @@ -31,7 +31,6 @@ struct rsa_public_key { struct image_sign_info; -#if IMAGE_ENABLE_SIGN /** * sign() - calculate and return signature for given input data * @@ -66,22 +65,7 @@ int rsa_sign(struct image_sign_info *info, other -ve value on error */ int rsa_add_verify_data(struct image_sign_info *info, void *keydest); -#else -static inline int rsa_sign(struct image_sign_info *info, - const struct image_region region[], int region_count, - uint8_t **sigp, uint *sig_len) -{ - return -ENXIO; -} - -static inline int rsa_add_verify_data(struct image_sign_info *info, - void *keydest) -{ - return -ENXIO; -} -#endif -#if IMAGE_ENABLE_VERIFY /** * rsa_verify_hash() - Verify a signature against a hash * @@ -124,37 +108,6 @@ int padding_pss_verify(struct image_sign_info *info, uint8_t *msg, int msg_len, const uint8_t *hash, int hash_len); #endif /* CONFIG_FIT_RSASSA_PSS */ -#else -static inline int rsa_verify_hash(struct image_sign_info *info, - const uint8_t *hash, - uint8_t *sig, uint sig_len) -{ - return -ENXIO; -} - -static inline int rsa_verify(struct image_sign_info *info, - const struct image_region region[], int region_count, - uint8_t *sig, uint sig_len) -{ - return -ENXIO; -} - -static inline int padding_pkcs_15_verify(struct image_sign_info *info, - uint8_t *msg, int msg_len, - const uint8_t *hash, int hash_len) -{ - return -ENXIO; -} - -#ifdef CONFIG_FIT_RSASSA_PSS -static inline int padding_pss_verify(struct image_sign_info *info, - uint8_t *msg, int msg_len, - const uint8_t *hash, int hash_len) -{ - return -ENXIO; -} -#endif /* CONFIG_FIT_RSASSA_PSS */ -#endif #define RSA_DEFAULT_PADDING_NAME "pkcs-1.5" -- 2.31.1