2929#include <wolfssl/wolfcrypt/asn.h>
3030#include <wolfssl/wolfcrypt/ecc.h>
3131
32- #define WOLFKM_ECDSA_NAME "ecdsa"
33- #define WOLFKM_ECDSA_DRIVER ("ecdsa" WOLFKM_DRIVER_SUFFIX)
32+ #define WOLFKM_ECDSA_DRIVER ("ecdsa-wolfcrypt")
33+
34+ #define WOLFKM_ECDSA_P192_NAME ("ecdsa-nist-p192")
35+ #define WOLFKM_ECDSA_P192_DRIVER ("ecdsa-nist-p192" WOLFKM_DRIVER_FIPS \
36+ "-wolfcrypt")
37+
38+ #define WOLFKM_ECDSA_P256_NAME ("ecdsa-nist-p256")
39+ #define WOLFKM_ECDSA_P256_DRIVER ("ecdsa-nist-p256" WOLFKM_DRIVER_FIPS \
40+ "-wolfcrypt")
41+
42+ #define WOLFKM_ECDSA_P384_NAME ("ecdsa-nist-p384")
43+ #define WOLFKM_ECDSA_P384_DRIVER ("ecdsa-nist-p384" WOLFKM_DRIVER_FIPS \
44+ "-wolfcrypt")
45+
46+ #define WOLFKM_ECDSA_P521_NAME ("ecdsa-nist-p521")
47+ #define WOLFKM_ECDSA_P521_DRIVER ("ecdsa-nist-p521" WOLFKM_DRIVER_FIPS \
48+ "-wolfcrypt")
49+
3450
3551static int linuxkm_test_ecdsa_nist_driver (const char * driver ,
3652 const byte * pub , word32 pub_len ,
@@ -71,8 +87,8 @@ static int km_ecdsa_nist_p521_init(struct crypto_akcipher *tfm);
7187
7288#if defined(LINUXKM_ECC192 )
7389static struct akcipher_alg ecdsa_nist_p192 = {
74- .base .cra_name = "ecdsa-nist-p192" ,
75- .base .cra_driver_name = "ecdsa-nist-p192-wolfcrypt" ,
90+ .base .cra_name = WOLFKM_ECDSA_P192_NAME ,
91+ .base .cra_driver_name = WOLFKM_ECDSA_P192_DRIVER ,
7692 .base .cra_priority = WOLFSSL_LINUXKM_LKCAPI_PRIORITY ,
7793 .base .cra_module = THIS_MODULE ,
7894 .base .cra_ctxsize = sizeof (struct km_ecdsa_ctx ),
@@ -85,8 +101,8 @@ static struct akcipher_alg ecdsa_nist_p192 = {
85101#endif /* LINUXKM_ECC192 */
86102
87103static struct akcipher_alg ecdsa_nist_p256 = {
88- .base .cra_name = "ecdsa-nist-p256" ,
89- .base .cra_driver_name = "ecdsa-nist-p256-wolfcrypt" ,
104+ .base .cra_name = WOLFKM_ECDSA_P256_NAME ,
105+ .base .cra_driver_name = WOLFKM_ECDSA_P256_DRIVER ,
90106 .base .cra_priority = WOLFSSL_LINUXKM_LKCAPI_PRIORITY ,
91107 .base .cra_module = THIS_MODULE ,
92108 .base .cra_ctxsize = sizeof (struct km_ecdsa_ctx ),
@@ -98,8 +114,8 @@ static struct akcipher_alg ecdsa_nist_p256 = {
98114};
99115
100116static struct akcipher_alg ecdsa_nist_p384 = {
101- .base .cra_name = "ecdsa-nist-p384" ,
102- .base .cra_driver_name = "ecdsa-nist-p384-wolfcrypt" ,
117+ .base .cra_name = WOLFKM_ECDSA_P384_NAME ,
118+ .base .cra_driver_name = WOLFKM_ECDSA_P384_DRIVER ,
103119 .base .cra_priority = WOLFSSL_LINUXKM_LKCAPI_PRIORITY ,
104120 .base .cra_module = THIS_MODULE ,
105121 .base .cra_ctxsize = sizeof (struct km_ecdsa_ctx ),
@@ -112,8 +128,8 @@ static struct akcipher_alg ecdsa_nist_p384 = {
112128
113129#if defined(HAVE_ECC521 )
114130static struct akcipher_alg ecdsa_nist_p521 = {
115- .base .cra_name = "ecdsa-nist-p521" ,
116- .base .cra_driver_name = "ecdsa-nist-p521-wolfcrypt" ,
131+ .base .cra_name = WOLFKM_ECDSA_P521_NAME ,
132+ .base .cra_driver_name = WOLFKM_ECDSA_P521_DRIVER ,
117133 .base .cra_priority = WOLFSSL_LINUXKM_LKCAPI_PRIORITY ,
118134 .base .cra_module = THIS_MODULE ,
119135 .base .cra_ctxsize = sizeof (struct km_ecdsa_ctx ),
@@ -436,7 +452,7 @@ static int linuxkm_test_ecdsa_nist_p192(void)
436452 hash_len = sizeof (hash );
437453 sig_len = sizeof (sig );
438454
439- rc = linuxkm_test_ecdsa_nist_driver ("ecdsa-nist-p192-wolfcrypt" ,
455+ rc = linuxkm_test_ecdsa_nist_driver (WOLFKM_ECDSA_P192_DRIVER ,
440456 p192_pub , pub_len ,
441457 sig , sig_len ,
442458 hash , hash_len );
@@ -491,7 +507,7 @@ static int linuxkm_test_ecdsa_nist_p256(void)
491507 hash_len = sizeof (hash );
492508 sig_len = sizeof (sig );
493509
494- rc = linuxkm_test_ecdsa_nist_driver ("ecdsa-nist-p256-wolfcrypt" ,
510+ rc = linuxkm_test_ecdsa_nist_driver (WOLFKM_ECDSA_P256_DRIVER ,
495511 p256_pub , pub_len ,
496512 sig , sig_len ,
497513 hash , hash_len );
@@ -554,7 +570,7 @@ static int linuxkm_test_ecdsa_nist_p384(void)
554570 hash_len = sizeof (hash );
555571 sig_len = sizeof (sig );
556572
557- rc = linuxkm_test_ecdsa_nist_driver ("ecdsa-nist-p384-wolfcrypt" ,
573+ rc = linuxkm_test_ecdsa_nist_driver (WOLFKM_ECDSA_P384_DRIVER ,
558574 p384_pub , pub_len ,
559575 sig , sig_len ,
560576 hash , hash_len );
@@ -629,7 +645,7 @@ static int linuxkm_test_ecdsa_nist_p521(void)
629645 hash_len = sizeof (hash );
630646 sig_len = sizeof (sig );
631647
632- rc = linuxkm_test_ecdsa_nist_driver ("ecdsa-nist-p521-wolfcrypt" ,
648+ rc = linuxkm_test_ecdsa_nist_driver (WOLFKM_ECDSA_P521_DRIVER ,
633649 p521_pub , pub_len ,
634650 sig , sig_len ,
635651 hash , hash_len );
0 commit comments