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 E83BCC04FF3 for ; Mon, 24 May 2021 20:22:26 +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 733E3613CC for ; Mon, 24 May 2021 20:22:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 733E3613CC 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 5A81782F22; Mon, 24 May 2021 22:20:36 +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="ULD7Heia"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D8DA182EEA; Mon, 24 May 2021 22:19:57 +0200 (CEST) Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (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 A726582EDC for ; Mon, 24 May 2021 22:19:53 +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-x22e.google.com with SMTP id v22so28206193oic.2 for ; Mon, 24 May 2021 13:19:53 -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=yGgINWZNXA+ZI2g7kfOUuWAGY8Y64iYE0Uers3jMYU0=; b=ULD7HeiakenLGh2Ezrx1QyDSxc4k9jR1PKl/mSiaSFogW4BNtHQtZUd05LFMpKWbJK 5U96nn4At9pmn8DrOAt1+iLLNOP8MtHsIwpxnGv2VMFVC3k3ymRK4Qv1IeqYxThNPqhQ Ntr9tKwcMgPvfbYeEYftHD8bRdGWd4R/TQ5hlsttZL+kltiD6C6/wQIqbrwjb+FrEcbF FYXrQ15Pz1Ek66kUtPLSLqUiPZsw2GX1lwjRZd2pz4/IITYuG41UZDxsG7An5YxbUpY9 tZtrFg9xnj/CU45urdx0etUrScQVwQQDEjU9b2ZXj6JYejUFVA2KdgVOa4lmTvVVS1s6 Az3w== 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=yGgINWZNXA+ZI2g7kfOUuWAGY8Y64iYE0Uers3jMYU0=; b=FdmMVgr7j+YnORfzPZO5SpWJSXLvI0+FWRwV9ePT8WXu8enmNt53o6WhHUXQxTVbk5 8mDLenWTdAFyyBVaaFip6ExKMOdFDouSQC8Isd5qqIVGrs1BIe44GvVnwcsFhLYelidQ KwDbwmr7FSHmiVlBSDJi5MrLRpW0KZ3Ea5vdyrRPGue0KBTLygJwjJsc3XruTNQfteEJ SPTiJJs1Hqf344ccPYFiuu0jlkVvWvnMiE+rNIzU7tVePNmWVR9bWi5OhNydUJVAEGEO WQxn6CwM7GPkbG/H6ZNsIEqWrFxwTxGrW2TB/dEh6CxmRY+cez/U3YYxzfqYOulxKHB1 zvsg== X-Gm-Message-State: AOAM530zVDp714SjF8qYptoGyte9YZ4wb/F+VzaIP98wzyMLscHQD7HX IvyhquT6TphXPv349H295ed/CUnIhiVXTQ== X-Google-Smtp-Source: ABdhPJxUVEm/ypB93gN/ahnAy25OmutXs56+T7h18kXzGpF3HI/LQuUwK7i4WYmVet0WepIeBAjvMA== X-Received: by 2002:aca:cf09:: with SMTP id f9mr11654345oig.37.1621887592354; Mon, 24 May 2021 13:19:52 -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.51 (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 14/18] lib: ecdsa: Remove #ifdefs from ecdsa.h Date: Mon, 24 May 2021 15:19:35 -0500 Message-Id: <20210524201939.1491676-15-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 ecdsa_() functions as no-ops depending on config options. It is merely sufficient to provide the prototypes, as the ecdsa code is no longer linked when unused. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- include/u-boot/ecdsa.h | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/include/u-boot/ecdsa.h b/include/u-boot/ecdsa.h index 979690d966..f6951c7346 100644 --- a/include/u-boot/ecdsa.h +++ b/include/u-boot/ecdsa.h @@ -15,7 +15,6 @@ * @see "struct crypto_algo" * @{ */ -#if IMAGE_ENABLE_SIGN /** * sign() - calculate and return signature for given input data * @@ -49,22 +48,7 @@ int ecdsa_sign(struct image_sign_info *info, const struct image_region region[], * other -ve value on error */ int ecdsa_add_verify_data(struct image_sign_info *info, void *keydest); -#else -static inline -int ecdsa_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 ecdsa_add_verify_data(struct image_sign_info *info, void *keydest) -{ - return -ENXIO; -} -#endif -#if IMAGE_ENABLE_VERIFY_ECDSA /** * verify() - Verify a signature against some data * @@ -78,15 +62,6 @@ int ecdsa_add_verify_data(struct image_sign_info *info, void *keydest) int ecdsa_verify(struct image_sign_info *info, const struct image_region region[], int region_count, uint8_t *sig, uint sig_len); -#else -static inline -int ecdsa_verify(struct image_sign_info *info, - const struct image_region region[], int region_count, - uint8_t *sig, uint sig_len) -{ - return -ENXIO; -} -#endif /** @} */ #define ECDSA256_BYTES (256 / 8) -- 2.31.1