From patchwork Fri May 14 19:45:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 1478674 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=eAzSdDli; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FhfG64qCWz9sT6 for ; Sat, 15 May 2021 05:48:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 699A682E33; Fri, 14 May 2021 21:47:35 +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="eAzSdDli"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 082B182B31; Fri, 14 May 2021 21:46:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (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 683E482AED for ; Fri, 14 May 2021 21:46:10 +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-x230.google.com with SMTP id n184so495750oia.12 for ; Fri, 14 May 2021 12:46:10 -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=ewZiT/7reHG4MtQdO0sD/s4UJKfbAtV6V9NwUuahjAU=; b=eAzSdDlieaY/l7aeJh4HFdrgSEEyrmHj3s1MtwosD4mpt0gfaE8FzPOWRv41ZC2Jik GKZ20KCjVHI31dlUqEPUOyx7F2KcnTc7AJqc+6FJcG6/1mqqtMd5rA7JJj5TeQWDT5TX E/XxUakEzh/GpYTVZ01b7n1uiT4ArvJpaOncFRj/APROavG8BMP9oTF8ZJQB15RQmtOA QCJYX1BE1vSDD+8i5ND7VjW7TWGn+Xfe6b38V4YcR0RUNqBm5dZcrhYwlPsP0jIVOVDI 9adOPcAMdoMYQT8t0FgRIKFFrnU5B8P83qfLzms3eYceIsBzLX3Sc34fdGL9y+qjSKYp 10AQ== 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=ewZiT/7reHG4MtQdO0sD/s4UJKfbAtV6V9NwUuahjAU=; b=L/omkaiMf6qA8cdvWWkJqKueVB7Js+YZ8utDFw4aPD9Bab2CGwXJiUrO3iQQU+mu5g qFD4J31w1U9fzhKSOe90gHc0BFLS15yHrowMu7Z77NgEmqb8Wdw+zArXy2LBl5960n4o elPX3bcTvJWUvhtdBFFMWqEw5EoBLo3DSauSQ8VSjz2zUOW8Bqc9T4X3piPTfYxP7RIl Fq3TFeAUSadETlzvlhL9khwftijAyEe+nKtQdnqYOgbyVk5G7Thq4qEvUnvXPZcJMH7e 3F2gCRdsfxwObGVZ3V3Msx1enzQ+YEEg7BXQh/sj5zi3VNqEYnRtCGWOiRefG7JEQ1Ls o0xA== X-Gm-Message-State: AOAM530YWP033dGMAVUTXmOAwSibeRWmYuhxoxkJpIV0s8XUi5DhXPqL xAuvdiRLwTJvehKlW5hm95I8r2gcc0DAhg== X-Google-Smtp-Source: ABdhPJyycPwiDdAZIYbc/P+QwnIECTejMwUjnXSc1othIyCn/DC4y3sf/Ah7x683+ecIM7wLVtbpSg== X-Received: by 2002:aca:47ca:: with SMTP id u193mr7925983oia.69.1621021568875; Fri, 14 May 2021 12:46:08 -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 c131sm1015353oif.29.2021.05.14.12.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 12:46:08 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, sjg@chromium.org Cc: Alexandru Gagniuc , trini@konsulko.com Subject: [PATCH RFC 07/10] lib: ecdsa: Remove #ifdefs from ecdsa.h Date: Fri, 14 May 2021 14:45:59 -0500 Message-Id: <20210514194602.598322-8-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514194602.598322-1-mr.nuke.me@gmail.com> References: <20210514194602.598322-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 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)