[PATCH 1/5] public-keys: ecdsa: remove list in ecdsa keys

Sascha Hauer s.hauer at pengutronix.de
Mon Oct 20 04:30:58 PDT 2025


We have a function to iterate over ecdsa keys. This is unused and
shouldn't be necessary as we have a function to iterate over public
keys. Remove the iterator and the list entry which gives us the
possibility to put ecdsa keys into the RO data section.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 crypto/ecdsa.c         | 18 ------------------
 include/crypto/ecdsa.h | 12 ------------
 2 files changed, 30 deletions(-)

diff --git a/crypto/ecdsa.c b/crypto/ecdsa.c
index 69c0accc9534b754a97080b6cf584b221037e821..6aaeff5c14634e3ada7319446f2f189c410a8e04 100644
--- a/crypto/ecdsa.c
+++ b/crypto/ecdsa.c
@@ -104,15 +104,6 @@ int ecdsa_verify(const struct ecdsa_public_key *key, const uint8_t *sig,
 	return _ecdsa_verify(ctx, (void *)mhash, rh, sh);
 }
 
-static LIST_HEAD(ecdsa_keys);
-
-int ecdsa_key_add(struct ecdsa_public_key *key)
-{
-	list_add_tail(&key->list, &ecdsa_keys);
-
-	return 0;
-}
-
 struct ecdsa_public_key *ecdsa_key_dup(const struct ecdsa_public_key *key)
 {
 	struct ecdsa_public_key *new;
@@ -129,12 +120,3 @@ struct ecdsa_public_key *ecdsa_key_dup(const struct ecdsa_public_key *key)
 
 	return new;
 }
-
-const struct ecdsa_public_key *ecdsa_key_next(const struct ecdsa_public_key *prev)
-{
-	prev = list_prepare_entry(prev, &ecdsa_keys, list);
-	list_for_each_entry_continue(prev, &ecdsa_keys, list)
-		return prev;
-
-	return NULL;
-}
diff --git a/include/crypto/ecdsa.h b/include/crypto/ecdsa.h
index 2e2b359d96cfd4fef6878c7a0f3045d9dbad4100..3b6bb394d960839284213729a569f5ba5b7741b6 100644
--- a/include/crypto/ecdsa.h
+++ b/include/crypto/ecdsa.h
@@ -11,18 +11,11 @@ struct ecdsa_public_key {
 	const uint64_t *x;	/* x coordinate of public key */
 	const uint64_t *y;	/* y coordinate of public key */
 	unsigned int size_bits;	/* key size in bits, derived from curve name */
-	struct list_head list;
 };
 
-const struct ecdsa_public_key *ecdsa_key_next(const struct ecdsa_public_key *prev);
-
-#define for_each_ecdsa_key(key) \
-	for (key = ecdsa_key_next(NULL); key; key = ecdsa_key_next(key))
-
 #ifdef CONFIG_CRYPTO_ECDSA
 int ecdsa_verify(const struct ecdsa_public_key *key, const uint8_t *sig,
 		 const uint32_t sig_len, const uint8_t *hash);
-int ecdsa_key_add(struct ecdsa_public_key *key);
 struct ecdsa_public_key *ecdsa_key_dup(const struct ecdsa_public_key *key);
 #else
 static inline int ecdsa_verify(const struct ecdsa_public_key *key, const uint8_t *sig,
@@ -31,11 +24,6 @@ static inline int ecdsa_verify(const struct ecdsa_public_key *key, const uint8_t
 	return -ENOSYS;
 }
 
-static inline int ecdsa_key_add(struct ecdsa_public_key *key)
-{
-	return -ENOSYS;
-}
-
 static inline struct ecdsa_public_key *ecdsa_key_dup(const struct ecdsa_public_key *key)
 {
 	return NULL;

-- 
2.47.3




More information about the barebox mailing list