2021-05-10 09:03:15

by Hui Tang

[permalink] [raw]
Subject: [PATCH 0/2] 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


2021-05-10 09:03:15

by Hui Tang

[permalink] [raw]
Subject: [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.

Signed-off-by: Hui Tang <[email protected]>
---
crypto/ecdh.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/ecdh.c b/crypto/ecdh.c
index 04a427b..07eb34f 100644
--- a/crypto/ecdh.c
+++ b/crypto/ecdh.c
@@ -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),
--
2.8.1

2021-05-10 09:03:35

by Hui Tang

[permalink] [raw]
Subject: [PATCH 2/2] crypto: hisilicon/hpre - 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.

Signed-off-by: Hui Tang <[email protected]>
---
drivers/crypto/hisilicon/hpre/hpre_crypto.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
index a380087..c07a7f5 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
@@ -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,
},
};
--
2.8.1

2021-05-21 10:30:45

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 0/2] crypto: extend 'cra_driver_name' with curve name

On Mon, May 10, 2021 at 04:59:46PM +0800, Hui Tang wrote:
> 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.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt