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=-15.7 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,URIBL_BLOCKED,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 863CBC12002 for ; Wed, 14 Jul 2021 22:09:05 +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 01EB5613BF for ; Wed, 14 Jul 2021 22:09:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01EB5613BF 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 570D982F32; Thu, 15 Jul 2021 00:08:04 +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="PEvNB1G5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8096F80F0E; Thu, 15 Jul 2021 00:06:23 +0200 (CEST) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (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 1F9798164D for ; Thu, 15 Jul 2021 00:06:08 +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-ot1-x32e.google.com with SMTP id o17-20020a9d76510000b02903eabfc221a9so4185526otl.0 for ; Wed, 14 Jul 2021 15:06:07 -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=PEvNB1G5Ahg5Dcf1/+WDA0vlzbE3sCylmxgG6xsHz2r+KJ0JxtLDjK6uIddoPbHN3q 05jpOTKGJBNzChq543mcjdx2Q57YUIxrFG6WJjbexy1glXPL8Tyi1qwQ14oLPLhGwL22 VxBRQ2oPbc/NsRyRIOSyBwJH5+2NgdvT6a6UKCi1oftzz6GMS/aa7N2QpSjLXFkSfw9d +NeLyXIIsh1l+5vN3U4kyjgKpyZh8ezLxrmsAleM4UDc62shh/uktiisRoNewgYuW0yA AAwK4F+yUPz9Zt9iQ3WxJSH/bU19EXwbYwufzdNjaQiboeT4YBQEgF++kWmaVNb0r9Jt h+dQ== 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=p0+lviogU75teHPaY5A03NGxzRzJD0f1OGt09v+vDaltN8euUWAp95G54AWzrn01kX pdFpuiaoU/rfncaaWc39cqVMvF0k4W5HOPr3zq146EwGu2srQ/T8/iPfxpC91T4tGvZZ jahacudx7WMDtIHWhXYamNm9LEm5Y/4H8LBCs7Uu0jvtTas89rxYunrqQT8qrjBKGcMF bIKlCLWZB8KrWlSOPAMX38KSF7dE/GHDUNC4BZvI0JZzIkARwjMNpJttfV1z4ATYxGkk TFMyGjyyFAZ62ZzsRyoU+1QIZi3KNMlNC0demiblm57a7yttjOH1SWzkTFYfbh0u8e5J vheA== X-Gm-Message-State: AOAM530jVZcHjeW9SfVwv+4Jru/gBASakVLBxKa/NcpUMUvp7/TOtYY/ GqQJdNVERHJk27UKzkEU40ggnX3/uKM= X-Google-Smtp-Source: ABdhPJwD035QiCgwixKCee3VmxY4vDrkKSmTbyPsImERFf5tTFzc/AX6Pb+wmCutXrjkrIyUury2Tw== X-Received: by 2002:a05:6830:25cb:: with SMTP id d11mr299613otu.56.1626300366383; Wed, 14 Jul 2021 15:06:06 -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 w64sm687278otb.45.2021.07.14.15.06.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 15:06:05 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, trini@konsulko.com Cc: Alexandru Gagniuc , Simon Glass Subject: [PATCH v3 15/19] lib: rsa: Remove #ifdefs from rsa.h Date: Wed, 14 Jul 2021 17:05:43 -0500 Message-Id: <20210714220547.170371-16-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210714211138.GA25256@bill-the-cat> References: <20210714211138.GA25256@bill-the-cat> 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.103.2 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