mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] crypto: ecc: drop unused curve25519 definitions
@ 2025-09-22 14:16 Ahmad Fatoum
  2025-09-22 16:45 ` Jonas Rebmann
  2025-09-23  8:14 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2025-09-22 14:16 UTC (permalink / raw)
  To: barebox; +Cc: Jonas Rebmann, Ahmad Fatoum

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.

Reported-by: Jonas Rebmann <jre@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-23  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-22 14:16 [PATCH] crypto: ecc: drop unused curve25519 definitions Ahmad Fatoum
2025-09-22 16:45 ` Jonas Rebmann
2025-09-23  8:14 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox