From patchwork Fri May 14 19:46:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 1478672 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=pVOv4iwP; 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 4FhfFh2b5pz9sWX for ; Sat, 15 May 2021 05:47:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D524582D47; Fri, 14 May 2021 21:47:22 +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="pVOv4iwP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 61E3682AF1; Fri, 14 May 2021 21:46:25 +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-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (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 CEC0982AF6 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-ot1-x329.google.com with SMTP id n32-20020a9d1ea30000b02902a53d6ad4bdso256451otn.3 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=IMAEEjuCK+2gq/+wgsS5iwNDYRLXBy9KYFmq3vmPs9o=; b=pVOv4iwP8qX66trsJ7w1x8E60ULxiusnHz/e8wXOYyqvvFEVlg7wcB7JO+sDxCw1bv j6dVn//3/buRsYu55GMtl60vqVgPZ3076G/2xSnXgC3TrKfuXMpBpEHt9RItCDX1w/Ga QX8jF3L7Xe4PHHKoj/5MHyBDb8TVCycoLzlNptoRla6Cgt1I0HHwAEAhm6X9aluORdEb IfqgjVzFdFt93PqEDgfK7NbC6ngLA4NjJ20FAl9ygp9Tt+L50+NUl+rtWTnF4QrnXQcc ipeelGKJYCG/ptL93zczBJT2U5WnMyv+qr82vOwZqNGek6itO3fMXu7AhPzzFiX31cT4 ME2g== 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=IMAEEjuCK+2gq/+wgsS5iwNDYRLXBy9KYFmq3vmPs9o=; b=lB+H/EbLWdnFPdRkLjaqBnqx5qJWEfQ0TKFPvPzEDpU+nM2H7BvhswM6+Qg+Mt7GH7 OWVIFugsVfslDkhlKXpaZJCwNuRbuKq0N9oCswxAPv/UU3wgrVBa7eO8o95tQzbgWUf+ 98txbiour/QcJL9t4kH4OmMb2T+6yWsOt+fRK90UYrY9i7tiEm03qm0U2q/+GIaVebvz h9FJS8P/anFA9IRQCo2ydqM2VI7ZfDI4JKQf8gkCL4Ulu8/oRd/TJb9RHGNtnNrBYkR3 AA9/YReWr9cB6TRig2gdytROjK41Mm0ZgYCbwsG81xVtJzz66wFCRhxIQKVpCAJLrZHd XqMQ== X-Gm-Message-State: AOAM532UfTR9qSXTQSz5Sx9tGBAV4/FC04NmL0F30ssamTDdhEZLLBip IMnGesi4atXKpv3zaGrSk+symuWS1Nn8+A== X-Google-Smtp-Source: ABdhPJw/UwZpqe8Z7B0MhKOt3uxkuUtPdYAWXasy4U7EWc9yUG3FitEyMCHceF/V4YnsgbIHXrbrhg== X-Received: by 2002:a05:6830:905:: with SMTP id v5mr40391646ott.214.1621021569378; Fri, 14 May 2021 12:46:09 -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:09 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, sjg@chromium.org Cc: Alexandru Gagniuc , trini@konsulko.com Subject: [PATCH RFC 08/10] lib: rsa: Remove #ifdefs from rsa.h Date: Fri, 14 May 2021 14:46:00 -0500 Message-Id: <20210514194602.598322-9-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 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 bed1c097c2..4ac373cd5e 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_ENABLE_RSASSA_PSS_SUPPORT */ -#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_ENABLE_RSASSA_PSS_SUPPORT -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_ENABLE_RSASSA_PSS_SUPPORT */ -#endif #define RSA_DEFAULT_PADDING_NAME "pkcs-1.5"