Skip to contentSkip to conversation

crypto: extend 'cra_driver_name' with curve name

PATCH In review Hui Tang 2 participants 4 messages May 10, 2021 – May 21, 2021

Subsystems (2)
lore
Share & tools
lore

Hui Tang

author
#0 lore raw

cover crypto: extend 'cra_driver_name' with curve name

Extend initialization of ecdh 'cra_driver_name' with curve name.

Hui Tang (2):
crypto: ecdh - extend 'cra_driver_name' with curve name
crypto: hisilicon/hpre - extend 'cra_driver_name' with curve name

 crypto/ecdh.c                               | 4 ++--
 drivers/crypto/hisilicon/hpre/hpre_crypto.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

--
2.8.1

author
#1 lore raw

PATCH 1/2 crypto: ecdh - extend 'cra_driver_name' with curve name

Currently, 'cra_driver_name' cannot be used to specify ecdh algorithm with a special curve, so extending it with curve name.

Although using 'cra_name' can also specify a special curve, but ecdh generic driver cannot be specified when vendor hardware accelerator has registered.

---
 crypto/ecdh.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/ecdh.c +2 -2
index 04a427b..07eb34f 100644
@@ -141,7 +141,7 @@ static struct kpp_alg ecdh_nist_p192 = {
 	.init = ecdh_nist_p192_init_tfm,
 	.base = {
 		.cra_name = "ecdh-nist-p192",
-		.cra_driver_name = "ecdh-generic",
+		.cra_driver_name = "ecdh-nist-p192-generic",
 		.cra_priority = 100,
 		.cra_module = THIS_MODULE,
 		.cra_ctxsize = sizeof(struct ecdh_ctx),
@@ -166,7 +166,7 @@ static struct kpp_alg ecdh_nist_p256 = {
 	.init = ecdh_nist_p256_init_tfm,
 	.base = {
 		.cra_name = "ecdh-nist-p256",
-		.cra_driver_name = "ecdh-generic",
+		.cra_driver_name = "ecdh-nist-p256-generic",
 		.cra_priority = 100,
 		.cra_module = THIS_MODULE,
 		.cra_ctxsize = sizeof(struct ecdh_ctx),
Signature · 1 line
2.8.1
author
#2 lore raw

PATCH 2/2 crypto: hisilicon/hpre - extend 'cra_driver_name' with curve name

In reply to Hui Tang

Currently,'cra_driver_name' cannot be used to specify ecdh algorithm with a special curve, so extending it with curve name.

---
 drivers/crypto/hisilicon/hpre/hpre_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/hisilicon/hpre/hpre_crypto.c +2 -2
index a380087..c07a7f5 100644
@@ -1940,7 +1940,7 @@ static struct kpp_alg ecdh_nist_p192 = {
 		.cra_ctxsize = sizeof(struct hpre_ctx),
 		.cra_priority = HPRE_CRYPTO_ALG_PRI,
 		.cra_name = "ecdh-nist-p192",
-		.cra_driver_name = "hpre-ecdh",
+		.cra_driver_name = "hpre-ecdh-nist-p192",
 		.cra_module = THIS_MODULE,
 	},
 };
@@ -1957,7 +1957,7 @@ static struct kpp_alg ecdh_nist_p256 = {
 		.cra_ctxsize = sizeof(struct hpre_ctx),
 		.cra_priority = HPRE_CRYPTO_ALG_PRI,
 		.cra_name = "ecdh-nist-p256",
-		.cra_driver_name = "hpre-ecdh",
+		.cra_driver_name = "hpre-ecdh-nist-p256",
 		.cra_module = THIS_MODULE,
 	},
 };
Signature · 1 line
2.8.1
maintainer
#3 lore raw
In reply to Hui Tang
Quoted 9 lines · Hui Tang

Extend initialization of ecdh 'cra_driver_name' with curve name.

Hui Tang (2):
crypto: ecdh - extend 'cra_driver_name' with curve name
crypto: hisilicon/hpre - extend 'cra_driver_name' with curve name

 crypto/ecdh.c                               | 4 ++--
 drivers/crypto/hisilicon/hpre/hpre_crypto.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

All applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt