mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jonas Rebmann <jre@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH] crypto: ecc: drop unused curve25519 definitions
Date: Mon, 22 Sep 2025 18:45:08 +0200	[thread overview]
Message-ID: <b0b1d755-8bf0-4200-8015-871a04b31e35@pengutronix.de> (raw)
In-Reply-To: <20250922141613.2626411-1-a.fatoum@pengutronix.de>

Hi,

On 2025-09-22 16:16, Ahmad Fatoum wrote:
> ecc_get_curve25519 is used in the kernel only to support the hisilicon
> hpre driver and can't be used for general purpose like the NIST curves
> defined in ecc_curve_defs.h.
> 
> In barebox, the function is fully unused, so drop it to prevent
> confusion.

Confusing indeed :)

> 
> Reported-by: Jonas Rebmann<jre@pengutronix.de>
> Signed-off-by: Ahmad Fatoum<a.fatoum@pengutronix.de>

Reviewed-by: Jonas Rebmann <jre@pengutronix.de>

Thanks,
Jonas

> ---
>   crypto/ecc.c               |  7 -------
>   crypto/ecc_curve_defs.h    | 18 ------------------
>   include/crypto/ecc_curve.h |  7 -------
>   3 files changed, 32 deletions(-)
> 
> diff --git a/crypto/ecc.c b/crypto/ecc.c
> index b90fe0e74809..c3d71627a64a 100644
> --- a/crypto/ecc.c
> +++ b/crypto/ecc.c
> @@ -38,13 +38,6 @@ typedef struct {
>   	u64 m_high;
>   } uint128_t;
>   
> -/* Returns curv25519 curve param */
> -const struct ecc_curve *ecc_get_curve25519(void)
> -{
> -	return &ecc_25519;
> -}
> -EXPORT_SYMBOL(ecc_get_curve25519);
> -
>   const struct ecc_curve *ecc_get_curve(unsigned int curve_id)
>   {
>   	switch (curve_id) {
> diff --git a/crypto/ecc_curve_defs.h b/crypto/ecc_curve_defs.h
> index 0ecade7d02f5..6867fe50e81b 100644
> --- a/crypto/ecc_curve_defs.h
> +++ b/crypto/ecc_curve_defs.h
> @@ -134,22 +134,4 @@ static struct ecc_curve nist_p521 = {
>   	.b = nist_p521_b
>   };
>   
> -/* curve25519 */
> -static u64 curve25519_g_x[] = { 0x0000000000000009, 0x0000000000000000,
> -				0x0000000000000000, 0x0000000000000000 };
> -static u64 curve25519_p[] = { 0xffffffffffffffed, 0xffffffffffffffff,
> -				0xffffffffffffffff, 0x7fffffffffffffff };
> -static u64 curve25519_a[] = { 0x000000000001DB41, 0x0000000000000000,
> -				0x0000000000000000, 0x0000000000000000 };
> -static const struct ecc_curve ecc_25519 = {
> -	.name = "curve25519",
> -	.nbits = 255,
> -	.g = {
> -		.x = curve25519_g_x,
> -		.ndigits = 4,
> -	},
> -	.p = curve25519_p,
> -	.a = curve25519_a,
> -};
> -
>   #endif
> diff --git a/include/crypto/ecc_curve.h b/include/crypto/ecc_curve.h
> index 7d90c5e82266..4ffb9fd8d228 100644
> --- a/include/crypto/ecc_curve.h
> +++ b/include/crypto/ecc_curve.h
> @@ -52,11 +52,4 @@ struct ecc_curve {
>    */
>   const struct ecc_curve *ecc_get_curve(unsigned int curve_id);
>   
> -/**
> - * ecc_get_curve25519() - get curve25519 curve;
> - *
> - * Returns curve25519
> - */
> -const struct ecc_curve *ecc_get_curve25519(void);
> -
>   #endif
> -- 2.47.3
> 

-- 
Pengutronix e.K.                           | Jonas Rebmann               |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |




  reply	other threads:[~2025-09-22 16:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 14:16 Ahmad Fatoum
2025-09-22 16:45 ` Jonas Rebmann [this message]
2025-09-23  8:14 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0b1d755-8bf0-4200-8015-871a04b31e35@pengutronix.de \
    --to=jre@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox