diff mbox series

[v2,2/2] crypto/qat: add secp384r1 curve

Message ID 20220422093355.13631-3-arkadiuszx.kusztal@intel.com (mailing list archive)
State Accepted
Delegated to: akhil goyal
Headers show
Series crypto/qat: add secp384r1 curve support | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/checkpatch success coding style OK

Commit Message

Kusztal, ArkadiuszX April 22, 2022, 9:33 a.m. UTC
This commit adds secp384r1 (P-384) elliptic
curve to Intel QuickAssist Technology crypto PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 doc/guides/rel_notes/release_22_07.rst |  4 ++
 drivers/common/qat/qat_adf/qat_pke.h   | 12 ++++++
 drivers/crypto/qat/qat_ec.h            | 76 ++++++++++++++++++++++++++++++++++
 3 files changed, 92 insertions(+)

Comments

Zhang, Roy Fan May 10, 2022, 10:10 a.m. UTC | #1
> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Friday, April 22, 2022 10:34 AM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Kusztal,
> ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH v2 2/2] crypto/qat: add secp384r1 curve
> 
> This commit adds secp384r1 (P-384) elliptic
> curve to Intel QuickAssist Technology crypto PMD.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
diff mbox series

Patch

diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index 42a5f2d990..7f44d363b5 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -55,6 +55,10 @@  New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Updated Intel QuickAssist Technology (QAT) crypto PMD.**
+
+  * Added support for secp384r1 elliptic curve.
+
 
 Removed Items
 -------------
diff --git a/drivers/common/qat/qat_adf/qat_pke.h b/drivers/common/qat/qat_adf/qat_pke.h
index b5fb2a020c..6c12bfd989 100644
--- a/drivers/common/qat/qat_adf/qat_pke.h
+++ b/drivers/common/qat/qat_adf/qat_pke.h
@@ -228,6 +228,10 @@  get_ecdsa_verify_function(struct rte_crypto_asym_xform *xform)
 		qat_function.func_id = PKE_ECDSA_VERIFY_GFP_L256;
 		qat_function.bytesize = 32;
 		break;
+	case RTE_CRYPTO_EC_GROUP_SECP384R1:
+		qat_function.func_id = PKE_ECDSA_VERIFY_GFP_L512;
+		qat_function.bytesize = 64;
+		break;
 	case RTE_CRYPTO_EC_GROUP_SECP521R1:
 		qat_function.func_id = PKE_ECDSA_VERIFY_GFP_521;
 		qat_function.bytesize = 66;
@@ -248,6 +252,10 @@  get_ecdsa_function(struct rte_crypto_asym_xform *xform)
 		qat_function.func_id = PKE_ECDSA_SIGN_RS_GFP_L256;
 		qat_function.bytesize = 32;
 		break;
+	case RTE_CRYPTO_EC_GROUP_SECP384R1:
+		qat_function.func_id = PKE_ECDSA_SIGN_RS_GFP_L512;
+		qat_function.bytesize = 64;
+		break;
 	case RTE_CRYPTO_EC_GROUP_SECP521R1:
 		qat_function.func_id = PKE_ECDSA_SIGN_RS_GFP_521;
 		qat_function.bytesize = 66;
@@ -268,6 +276,10 @@  get_ecpm_function(struct rte_crypto_asym_xform *xform)
 		qat_function.func_id = MATHS_POINT_MULTIPLICATION_GFP_L256;
 		qat_function.bytesize = 32;
 		break;
+	case RTE_CRYPTO_EC_GROUP_SECP384R1:
+		qat_function.func_id = MATHS_POINT_MULTIPLICATION_GFP_L512;
+		qat_function.bytesize = 64;
+		break;
 	case RTE_CRYPTO_EC_GROUP_SECP521R1:
 		qat_function.func_id = MATHS_POINT_MULTIPLICATION_GFP_521;
 		qat_function.bytesize = 66;
diff --git a/drivers/crypto/qat/qat_ec.h b/drivers/crypto/qat/qat_ec.h
index 1bcd7d1408..bbd0b31949 100644
--- a/drivers/crypto/qat/qat_ec.h
+++ b/drivers/crypto/qat/qat_ec.h
@@ -92,6 +92,80 @@  static struct elliptic_curve curve[] = {
 				},
 		},
 	},
+	[SECP384R1] = {
+		.name = "secp384r1",
+		.bytesize = 48,
+		.x = {
+			.data = {
+				0xAA, 0x87, 0xCA, 0x22, 0xBE, 0x8B, 0x05, 0x37,
+				0x8E, 0xB1, 0xC7, 0x1E, 0xF3, 0x20, 0xAD, 0x74,
+				0x6E, 0x1D, 0x3B, 0x62, 0x8B, 0xA7, 0x9B, 0x98,
+				0x59, 0xF7, 0x41, 0xE0, 0x82, 0x54, 0x2A, 0x38,
+				0x55, 0x02, 0xF2, 0x5D, 0xBF, 0x55, 0x29, 0x6C,
+				0x3A, 0x54, 0x5E, 0x38, 0x72, 0x76, 0x0A, 0xB7
+				},
+		},
+		.y = {
+			.data = {
+				0x36, 0x17, 0xDE, 0x4A, 0x96, 0x26, 0x2C, 0x6F,
+				0x5D, 0x9E, 0x98, 0xBF, 0x92, 0x92, 0xDC, 0x29,
+				0xF8, 0xF4, 0x1D, 0xBD, 0x28, 0x9A, 0x14, 0x7C,
+				0xE9, 0xDA, 0x31, 0x13, 0xB5, 0xF0, 0xB8, 0xC0,
+				0x0A, 0x60, 0xB1, 0xCE, 0x1D, 0x7E, 0x81, 0x9D,
+				0x7A, 0x43, 0x1D, 0x7C, 0x90, 0xEA, 0x0E, 0x5F
+				},
+		},
+		.n = {
+			.data = {
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xC7, 0x63, 0x4D, 0x81, 0xF4, 0x37, 0x2D, 0xDF,
+				0x58, 0x1A, 0x0D, 0xB2, 0x48, 0xB0, 0xA7, 0x7A,
+				0xEC, 0xEC, 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73,
+				},
+		},
+		.p = {
+			.data = {
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
+				0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+				},
+		},
+		.a = {
+			.data = {
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
+				0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFC,
+				},
+		},
+		.b = {
+			.data = {
+				0xB3, 0x31, 0x2F, 0xA7, 0xE2, 0x3E, 0xE7, 0xE4,
+				0x98, 0x8E, 0x05, 0x6B, 0xE3, 0xF8, 0x2D, 0x19,
+				0x18, 0x1D, 0x9C, 0x6E, 0xFE, 0x81, 0x41, 0x12,
+				0x03, 0x14, 0x08, 0x8F, 0x50, 0x13, 0x87, 0x5A,
+				0xC6, 0x56, 0x39, 0x8D, 0x8A, 0x2E, 0xD1, 0x9D,
+				0x2A, 0x85, 0xC8, 0xED, 0xD3, 0xEC, 0x2A, 0xEF,
+				},
+		},
+		.h = {
+			.data = {
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+				},
+		},
+	},
 	[SECP521R1] = {
 		.name = "secp521r1",
 		.bytesize = 66,
@@ -195,6 +269,8 @@  pick_curve(struct rte_crypto_asym_xform *xform)
 	switch (xform->ec.curve_id) {
 	case RTE_CRYPTO_EC_GROUP_SECP256R1:
 		return SECP256R1;
+	case RTE_CRYPTO_EC_GROUP_SECP384R1:
+		return SECP384R1;
 	case RTE_CRYPTO_EC_GROUP_SECP521R1:
 		return SECP521R1;
 	default: