* [dpdk-dev] [PATCH 0/4] add ECPM support
@ 2019-12-05 15:37 Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication Anoob Joseph
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Anoob Joseph @ 2019-12-05 15:37 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Anoob Joseph, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, Sunila Sahu, dev
This series adds support for ECPM (Elliptic Curve Point Multiplication)
asymmetric operations. Library changes and PMD changes for
crypto_octeontx & crypto_octeontx2 is added. The final patch adds
the required test vectors and verification routines.
Balakrishna Bhamidipati (1):
lib/crypto: add support for EC Point Multiplication
Sunila Sahu (3):
crypto/octeontx: add EC Point Mul support
crypto/octeontx2: add EC Point Mul support
app/test: add EC point multiplication test
app/test/test_cryptodev_asym.c | 177 +++++++++++
app/test/test_cryptodev_asym_util.h | 11 +
app/test/test_cryptodev_ecpm_test_vectors.h | 353 +++++++++++++++++++++
doc/guides/cryptodevs/features/default.ini | 1 +
doc/guides/cryptodevs/features/octeontx.ini | 1 +
doc/guides/cryptodevs/features/octeontx2.ini | 1 +
drivers/common/cpt/cpt_mcode_defines.h | 2 +
drivers/common/cpt/cpt_ucode_asym.h | 85 +++++
.../crypto/octeontx/otx_cryptodev_capabilities.c | 11 +
drivers/crypto/octeontx/otx_cryptodev_ops.c | 23 ++
.../crypto/octeontx2/otx2_cryptodev_capabilities.c | 11 +
drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 22 ++
lib/librte_cryptodev/rte_crypto_asym.h | 17 +
lib/librte_cryptodev/rte_cryptodev.c | 1 +
14 files changed, 716 insertions(+)
create mode 100644 app/test/test_cryptodev_ecpm_test_vectors.h
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication
2019-12-05 15:37 [dpdk-dev] [PATCH 0/4] add ECPM support Anoob Joseph
@ 2019-12-05 15:37 ` Anoob Joseph
2020-01-13 12:43 ` Akhil Goyal
2019-12-05 15:37 ` [dpdk-dev] [PATCH 2/4] crypto/octeontx: add EC Point Mul support Anoob Joseph
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Anoob Joseph @ 2019-12-05 15:37 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Balakrishna Bhamidipati, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, Sunila Sahu, dev,
Anoob Joseph
From: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Elliptic Curve Point Multiplication xform type and op
parameters are added.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
doc/guides/cryptodevs/features/default.ini | 1 +
lib/librte_cryptodev/rte_crypto_asym.h | 17 +++++++++++++++++
lib/librte_cryptodev/rte_cryptodev.c | 1 +
3 files changed, 19 insertions(+)
diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index 2f6c785..3a54b07 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -109,3 +109,4 @@ Modular Exponentiation =
Modular Inversion =
Diffie-hellman =
ECDSA =
+EC Point Multiplication =
diff --git a/lib/librte_cryptodev/rte_crypto_asym.h b/lib/librte_cryptodev/rte_crypto_asym.h
index dd5e6e3..b98ce6c 100644
--- a/lib/librte_cryptodev/rte_crypto_asym.h
+++ b/lib/librte_cryptodev/rte_crypto_asym.h
@@ -85,6 +85,8 @@ enum rte_crypto_asym_xform_type {
/**< Elliptic Curve Digital Signature Algorithm
* Perform Signature Generation and Verification.
*/
+ RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL,
+ /**< Elliptic Curve Point Multiplication */
RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
/**< End of list */
};
@@ -598,6 +600,20 @@ struct rte_crypto_ecdsa_op_param {
};
/**
+ * Structure for EC point operation param
+ */
+struct rte_crypto_ec_point_mul_param {
+ struct rte_crypto_ec_point p;
+ /**< x and y coordinates of input point */
+
+ struct rte_crypto_ec_point r;
+ /**< x and y coordinates of resultant point */
+
+ rte_crypto_param scalar;
+ /**< Scalar to multiply the input point */
+};
+
+/**
* Asymmetric Cryptographic Operation.
*
* Structure describing asymmetric crypto operation params.
@@ -620,6 +636,7 @@ struct rte_crypto_asym_op {
struct rte_crypto_dh_op_param dh;
struct rte_crypto_dsa_op_param dsa;
struct rte_crypto_ecdsa_op_param ecdsa;
+ struct rte_crypto_ec_point_mul_param ecpm;
};
};
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 0d6babb..eea57c6 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -174,6 +174,7 @@ const char *rte_crypto_asym_xform_strings[] = {
[RTE_CRYPTO_ASYM_XFORM_DH] = "dh",
[RTE_CRYPTO_ASYM_XFORM_DSA] = "dsa",
[RTE_CRYPTO_ASYM_XFORM_ECDSA] = "ecdsa",
+ [RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL] = "ecpm",
};
/**
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH 2/4] crypto/octeontx: add EC Point Mul support
2019-12-05 15:37 [dpdk-dev] [PATCH 0/4] add ECPM support Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication Anoob Joseph
@ 2019-12-05 15:37 ` Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 3/4] crypto/octeontx2: " Anoob Joseph
` (2 subsequent siblings)
4 siblings, 0 replies; 14+ messages in thread
From: Anoob Joseph @ 2019-12-05 15:37 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Sunila Sahu, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, dev, Anoob Joseph,
Balakrishna Bhamidipati
From: Sunila Sahu <ssahu@marvell.com>
Adding support for EC Point Multiplication operation in crypto_octeontx
PMD.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
doc/guides/cryptodevs/features/octeontx.ini | 1 +
drivers/common/cpt/cpt_mcode_defines.h | 2 +
drivers/common/cpt/cpt_ucode_asym.h | 85 ++++++++++++++++++++++
.../crypto/octeontx/otx_cryptodev_capabilities.c | 11 +++
drivers/crypto/octeontx/otx_cryptodev_ops.c | 23 ++++++
5 files changed, 122 insertions(+)
diff --git a/doc/guides/cryptodevs/features/octeontx.ini b/doc/guides/cryptodevs/features/octeontx.ini
index 544bb46..3cc807a 100644
--- a/doc/guides/cryptodevs/features/octeontx.ini
+++ b/doc/guides/cryptodevs/features/octeontx.ini
@@ -73,3 +73,4 @@ Modular Exponentiation = Y
Modular Inversion =
Diffie-hellman =
ECDSA = Y
+EC Point Multiplication = Y
diff --git a/drivers/common/cpt/cpt_mcode_defines.h b/drivers/common/cpt/cpt_mcode_defines.h
index 64d3e8c..d830bef 100644
--- a/drivers/common/cpt/cpt_mcode_defines.h
+++ b/drivers/common/cpt/cpt_mcode_defines.h
@@ -24,6 +24,7 @@
/* AE opcodes */
#define CPT_MAJOR_OP_MODEX 0x03
#define CPT_MAJOR_OP_ECDSA 0x04
+#define CPT_MAJOR_OP_ECC 0x05
#define CPT_MINOR_OP_MODEX 0x01
#define CPT_MINOR_OP_PKCS_ENC 0x02
#define CPT_MINOR_OP_PKCS_ENC_CRT 0x03
@@ -32,6 +33,7 @@
#define CPT_MINOR_OP_MODEX_CRT 0x06
#define CPT_MINOR_OP_ECDSA_SIGN 0x01
#define CPT_MINOR_OP_ECDSA_VERIFY 0x02
+#define CPT_MINOR_OP_ECC_UMP 0x03
#define CPT_BLOCK_TYPE1 0
#define CPT_BLOCK_TYPE2 1
diff --git a/drivers/common/cpt/cpt_ucode_asym.h b/drivers/common/cpt/cpt_ucode_asym.h
index 1f76bd1..9a54d34 100644
--- a/drivers/common/cpt/cpt_ucode_asym.h
+++ b/drivers/common/cpt/cpt_ucode_asym.h
@@ -172,6 +172,8 @@ cpt_fill_asym_session_parameters(struct cpt_asym_sess_misc *sess,
ret = cpt_fill_modex_params(sess, xform);
break;
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
+ /* Fall through */
+ case RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL:
ret = cpt_fill_ec_params(sess, xform);
break;
default:
@@ -199,6 +201,8 @@ cpt_free_asym_session_parameters(struct cpt_asym_sess_misc *sess)
rte_free(mod->modulus.data);
break;
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
+ /* Fall through */
+ case RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL:
break;
default:
CPT_LOG_DP_ERR("Invalid transform type");
@@ -828,4 +832,85 @@ cpt_enqueue_ecdsa_op(struct rte_crypto_op *op,
return 0;
}
+static __rte_always_inline int
+cpt_ecpm_prep(struct rte_crypto_ec_point_mul_param *ecpm,
+ struct asym_op_params *asym_params,
+ uint8_t curveid)
+{
+ struct cpt_request_info *req = asym_params->req;
+ phys_addr_t mphys = asym_params->meta_buf;
+ uint16_t x1_len = ecpm->p.x.length;
+ uint16_t y1_len = ecpm->p.y.length;
+ uint16_t scalar_align, p_align;
+ uint16_t dlen, rlen, prime_len;
+ uint16_t x1_offset, y1_offset;
+ vq_cmd_word0_t vq_cmd_w0;
+ opcode_info_t opcode;
+ buf_ptr_t caddr;
+ uint8_t *dptr;
+
+ prime_len = ec_grp[curveid].prime.length;
+
+ /* Input buffer */
+ dptr = RTE_PTR_ADD(req, sizeof(struct cpt_request_info));
+
+ p_align = ROUNDUP8(prime_len);
+ scalar_align = ROUNDUP8(ecpm->scalar.length);
+
+ /*
+ * Set dlen = sum(ROUNDUP8(input point(x and y coordinates), prime,
+ * scalar length),
+ * Please note point length is equivalent to prime of the curve
+ */
+ dlen = 3 * p_align + scalar_align;
+
+ x1_offset = prime_len - x1_len;
+ y1_offset = prime_len - y1_len;
+
+ memset(dptr, 0, dlen);
+
+ /* Copy input point, scalar, prime */
+ memcpy(dptr + x1_offset, ecpm->p.x.data, x1_len);
+ dptr += p_align;
+ memcpy(dptr + y1_offset, ecpm->p.y.data, y1_len);
+ dptr += p_align;
+ memcpy(dptr, ecpm->scalar.data, ecpm->scalar.length);
+ dptr += scalar_align;
+ memcpy(dptr, ec_grp[curveid].prime.data, ec_grp[curveid].prime.length);
+ dptr += p_align;
+
+ /* Setup opcodes */
+ opcode.s.major = CPT_MAJOR_OP_ECC;
+ opcode.s.minor = CPT_MINOR_OP_ECC_UMP;
+
+ /* GP op header */
+ vq_cmd_w0.s.opcode = opcode.flags;
+ vq_cmd_w0.s.param1 = curveid;
+ vq_cmd_w0.s.param2 = ecpm->scalar.length;
+ vq_cmd_w0.s.dlen = dlen;
+ vq_cmd_w0.u64 = vq_cmd_w0.u64;
+
+ /* Filling cpt_request_info structure */
+ req->ist.ei0 = vq_cmd_w0.u64;
+ req->ist.ei1 = mphys;
+ req->ist.ei2 = mphys + dlen;
+
+ /* Result buffer will store output point where length of
+ * each coordinate will be of prime length, thus set
+ * rlen to twice of prime length.
+ */
+ rlen = p_align << 1;
+ req->rptr = dptr;
+
+ /* alternate_caddr to write completion status by the microcode */
+ req->alternate_caddr = (uint64_t *)(dptr + rlen);
+ *req->alternate_caddr = ~((uint64_t)COMPLETION_CODE_INIT);
+
+ /* Preparing completion addr, +1 for completion code */
+ caddr.vaddr = dptr + rlen + 1;
+ caddr.dma_addr = mphys + dlen + rlen + 1;
+
+ cpt_fill_req_comp_addr(req, caddr);
+ return 0;
+}
#endif /* _CPT_UCODE_ASYM_H_ */
diff --git a/drivers/crypto/octeontx/otx_cryptodev_capabilities.c b/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
index 6418ad2..22f34ad 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
@@ -641,6 +641,17 @@ static const struct rte_cryptodev_capabilities otx_asym_capabilities[] = {
},
}
},
+ { /* EC POINT MUL */
+ .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
+ {.asym = {
+ .xform_capa = {
+ .xform_type =
+ RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL,
+ .op_types = 0
+ }
+ },
+ }
+ },
/* End of asymmetric capabilities */
RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index f97ce3a..e7520d5 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -443,6 +443,13 @@ otx_cpt_enq_single_asym(struct cpt_instance *instance,
if (unlikely(ret))
goto req_fail;
break;
+ case RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL:
+ ret = cpt_ecpm_prep(&asym_op->ecpm, ¶ms,
+ sess->ec_ctx.curveid);
+ if (unlikely(ret))
+ goto req_fail;
+ break;
+
default:
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
ret = -EINVAL;
@@ -704,6 +711,19 @@ otx_cpt_asym_dequeue_ecdsa_op(struct rte_crypto_ecdsa_op_param *ecdsa,
ecdsa->s.length = prime_len;
}
+static __rte_always_inline void
+otx_cpt_asym_dequeue_ecpm_op(struct rte_crypto_ec_point_mul_param *ecpm,
+ struct cpt_request_info *req,
+ struct cpt_asym_ec_ctx *ec)
+{
+ int prime_len = ec_grp[ec->curveid].prime.length;
+
+ memcpy(ecpm->r.x.data, req->rptr, prime_len);
+ memcpy(ecpm->r.y.data, req->rptr + ROUNDUP8(prime_len), prime_len);
+ ecpm->r.x.length = prime_len;
+ ecpm->r.y.length = prime_len;
+}
+
static __rte_always_inline void __hot
otx_cpt_asym_post_process(struct rte_crypto_op *cop,
struct cpt_request_info *req)
@@ -726,6 +746,9 @@ otx_cpt_asym_post_process(struct rte_crypto_op *cop,
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
otx_cpt_asym_dequeue_ecdsa_op(&op->ecdsa, req, &sess->ec_ctx);
break;
+ case RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL:
+ otx_cpt_asym_dequeue_ecpm_op(&op->ecpm, req, &sess->ec_ctx);
+ break;
default:
CPT_LOG_DP_DEBUG("Invalid crypto xform type");
cop->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH 3/4] crypto/octeontx2: add EC Point Mul support
2019-12-05 15:37 [dpdk-dev] [PATCH 0/4] add ECPM support Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 2/4] crypto/octeontx: add EC Point Mul support Anoob Joseph
@ 2019-12-05 15:37 ` Anoob Joseph
2019-12-05 15:38 ` [dpdk-dev] [PATCH 4/4] app/test: add EC point multiplication test Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
4 siblings, 0 replies; 14+ messages in thread
From: Anoob Joseph @ 2019-12-05 15:37 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Sunila Sahu, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, dev, Anoob Joseph,
Balakrishna Bhamidipati
From: Sunila Sahu <ssahu@marvell.com>
Adding support for EC Point MUltiplication operation in crypto_octeontx2
PMD.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
doc/guides/cryptodevs/features/octeontx2.ini | 1 +
.../crypto/octeontx2/otx2_cryptodev_capabilities.c | 11 +++++++++++
drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 22 ++++++++++++++++++++++
3 files changed, 34 insertions(+)
diff --git a/doc/guides/cryptodevs/features/octeontx2.ini b/doc/guides/cryptodevs/features/octeontx2.ini
index dd6369b..f1625c4 100644
--- a/doc/guides/cryptodevs/features/octeontx2.ini
+++ b/doc/guides/cryptodevs/features/octeontx2.ini
@@ -73,3 +73,4 @@ Modular Exponentiation = Y
Modular Inversion =
Diffie-hellman =
ECDSA = Y
+EC Point Multiplication = Y
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
index f2079e2..d1c9c80 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
@@ -639,6 +639,17 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = {
},
}
},
+ { /* EC POINT MUL */
+ .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
+ {.asym = {
+ .xform_capa = {
+ .xform_type =
+ RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL,
+ .op_types = 0
+ }
+ },
+ }
+ },
/* End of asymmetric capabilities */
RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 17c755d..574873a 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -447,6 +447,12 @@ otx2_cpt_enqueue_asym(struct otx2_cpt_qp *qp,
if (unlikely(ret))
goto req_fail;
break;
+ case RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL:
+ ret = cpt_ecpm_prep(&asym_op->ecpm, ¶ms,
+ sess->ec_ctx.curveid);
+ if (unlikely(ret))
+ goto req_fail;
+ break;
default:
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
ret = -EINVAL;
@@ -665,6 +671,19 @@ otx2_cpt_asym_dequeue_ecdsa_op(struct rte_crypto_ecdsa_op_param *ecdsa,
ecdsa->s.length = prime_len;
}
+static __rte_always_inline void
+otx2_cpt_asym_dequeue_ecpm_op(struct rte_crypto_ec_point_mul_param *ecpm,
+ struct cpt_request_info *req,
+ struct cpt_asym_ec_ctx *ec)
+{
+ int prime_len = ec_grp[ec->curveid].prime.length;
+
+ memcpy(ecpm->r.x.data, req->rptr, prime_len);
+ memcpy(ecpm->r.y.data, req->rptr + ROUNDUP8(prime_len), prime_len);
+ ecpm->r.x.length = prime_len;
+ ecpm->r.y.length = prime_len;
+}
+
static void
otx2_cpt_asym_post_process(struct rte_crypto_op *cop,
struct cpt_request_info *req)
@@ -687,6 +706,9 @@ otx2_cpt_asym_post_process(struct rte_crypto_op *cop,
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
otx2_cpt_asym_dequeue_ecdsa_op(&op->ecdsa, req, &sess->ec_ctx);
break;
+ case RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL:
+ otx2_cpt_asym_dequeue_ecpm_op(&op->ecpm, req, &sess->ec_ctx);
+ break;
default:
CPT_LOG_DP_DEBUG("Invalid crypto xform type");
cop->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH 4/4] app/test: add EC point multiplication test
2019-12-05 15:37 [dpdk-dev] [PATCH 0/4] add ECPM support Anoob Joseph
` (2 preceding siblings ...)
2019-12-05 15:37 ` [dpdk-dev] [PATCH 3/4] crypto/octeontx2: " Anoob Joseph
@ 2019-12-05 15:38 ` Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
4 siblings, 0 replies; 14+ messages in thread
From: Anoob Joseph @ 2019-12-05 15:38 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Sunila Sahu, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, dev, Anoob Joseph
From: Sunila Sahu <ssahu@marvell.com>
Adding EC point multiplication test vectors and verify routines.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
app/test/test_cryptodev_asym.c | 177 ++++++++++++++
app/test/test_cryptodev_asym_util.h | 11 +
app/test/test_cryptodev_ecpm_test_vectors.h | 353 ++++++++++++++++++++++++++++
3 files changed, 541 insertions(+)
create mode 100644 app/test/test_cryptodev_ecpm_test_vectors.h
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index b913a7d..b6d96d6 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -19,6 +19,7 @@
#include "test_cryptodev_dh_test_vectors.h"
#include "test_cryptodev_dsa_test_vectors.h"
#include "test_cryptodev_ecdsa_test_vectors.h"
+#include "test_cryptodev_ecpm_test_vectors.h"
#include "test_cryptodev_mod_test_vectors.h"
#include "test_cryptodev_rsa_test_vectors.h"
#include "test_cryptodev_asym_util.h"
@@ -1044,6 +1045,7 @@ static inline void print_asym_capa(
capa->modlen.increment);
break;
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
+ case RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL:
default:
break;
}
@@ -2108,6 +2110,179 @@ test_ecdsa_sign_verify_all_curve(void)
return overall_status;
}
+static int
+test_ec_point_mul(enum curve curve_id)
+{
+ struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct rte_mempool *sess_mpool = ts_params->session_mpool;
+ struct rte_mempool *op_mpool = ts_params->op_mpool;
+ struct crypto_testsuite_ecpm_params input_params;
+ struct rte_cryptodev_asym_session *sess = NULL;
+ uint8_t dev_id = ts_params->valid_devs[0];
+ struct rte_crypto_op *result_op = NULL;
+ uint8_t output_buf_x[TEST_DATA_SIZE];
+ uint8_t output_buf_y[TEST_DATA_SIZE];
+ struct rte_crypto_asym_xform xform;
+ struct rte_crypto_asym_op *asym_op;
+ struct rte_cryptodev_info dev_info;
+ struct rte_crypto_op *op = NULL;
+ int status = TEST_SUCCESS, ret;
+
+ switch (curve_id) {
+ case P192:
+ input_params = ecpm_param_p192;
+ break;
+ case P224:
+ input_params = ecpm_param_p224;
+ break;
+ case P256:
+ input_params = ecpm_param_p256;
+ break;
+ case P384:
+ input_params = ecpm_param_p384;
+ break;
+ case P521:
+ input_params = ecpm_param_p521;
+ break;
+ default:
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Unsupported curve id\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ rte_cryptodev_info_get(dev_id, &dev_info);
+
+ sess = rte_cryptodev_asym_session_create(sess_mpool);
+ if (sess == NULL) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Session creation failed\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Setup crypto op data structure */
+ op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
+ if (op == NULL) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Failed to allocate asymmetric crypto "
+ "operation struct\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+ asym_op = op->asym;
+
+ /* Setup asym xform */
+ xform.next = NULL;
+ xform.xform_type = RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL;
+ xform.ec.curve_id = input_params.curve;
+
+ if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
+ sess_mpool) < 0) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Unable to config asym session\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Attach asymmetric crypto session to crypto operations */
+ rte_crypto_op_attach_asym_session(op, sess);
+
+ /* Populate op with operational details */
+ op->asym->ecpm.p.x.data = input_params.gen_x.data;
+ op->asym->ecpm.p.x.length = input_params.gen_x.length;
+ op->asym->ecpm.p.y.data = input_params.gen_y.data;
+ op->asym->ecpm.p.y.length = input_params.gen_y.length;
+ op->asym->ecpm.scalar.data = input_params.privkey.data;
+ op->asym->ecpm.scalar.length = input_params.privkey.length;
+
+ /* Init out buf */
+ op->asym->ecpm.r.x.data = output_buf_x;
+ op->asym->ecpm.r.y.data = output_buf_y;
+
+ RTE_LOG(DEBUG, USER1, "Process ASYM operation\n");
+
+ /* Process crypto operation */
+ if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Error sending packet for operation\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) == 0)
+ rte_pause();
+
+ if (result_op == NULL) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Failed to process asym crypto op\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ if (result_op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Failed to process asym crypto op\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ asym_op = result_op->asym;
+
+ debug_hexdump(stdout, "r x:",
+ asym_op->ecpm.r.x.data, asym_op->ecpm.r.x.length);
+ debug_hexdump(stdout, "r y:",
+ asym_op->ecpm.r.y.data, asym_op->ecpm.r.y.length);
+
+ ret = verify_ecpm(input_params.pubkey_x.data,
+ input_params.pubkey_y.data, result_op);
+ if (ret) {
+ status = TEST_FAILED;
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "EC Point Multiplication failed.\n");
+ goto exit;
+ }
+
+exit:
+ if (sess != NULL) {
+ rte_cryptodev_asym_session_clear(dev_id, sess);
+ rte_cryptodev_asym_session_free(sess);
+ }
+ if (op != NULL)
+ rte_crypto_op_free(op);
+ return status;
+}
+
+static int
+test_ec_point_mul_all_curve(void)
+{
+ int status, overall_status = TEST_SUCCESS;
+ enum curve curve_id;
+ int test_index = 0;
+ const char *msg;
+
+ for (curve_id = P192; curve_id < END_OF_CURVE_LIST; curve_id++) {
+ status = test_ec_point_mul(curve_id);
+ if (status == TEST_SUCCESS) {
+ msg = "succeeded";
+ } else {
+ msg = "failed";
+ overall_status = status;
+ }
+ printf(" %u) TestCase EC Point Mul Curve %s %s\n",
+ test_index ++, curve[curve_id], msg);
+ }
+ return overall_status;
+}
+
static struct unit_test_suite cryptodev_openssl_asym_testsuite = {
.suite_name = "Crypto Device OPENSSL ASYM Unit Test Suite",
.setup = testsuite_setup,
@@ -2148,6 +2323,8 @@ static struct unit_test_suite cryptodev_octeontx_asym_testsuite = {
TEST_CASE_ST(ut_setup, ut_teardown, test_mod_exp),
TEST_CASE_ST(ut_setup, ut_teardown,
test_ecdsa_sign_verify_all_curve),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_ec_point_mul_all_curve),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
diff --git a/app/test/test_cryptodev_asym_util.h b/app/test/test_cryptodev_asym_util.h
index bddeda0..83dc265 100644
--- a/app/test/test_cryptodev_asym_util.h
+++ b/app/test/test_cryptodev_asym_util.h
@@ -46,4 +46,15 @@ static inline int verify_ecdsa_sign(uint8_t *sign_r,
return 0;
}
+static inline int verify_ecpm(uint8_t *result_x, uint8_t *result_y,
+ struct rte_crypto_op *result_op)
+{
+ if (memcmp(result_x, result_op->asym->ecpm.r.x.data,
+ result_op->asym->ecpm.r.x.length) ||
+ memcmp(result_y, result_op->asym->ecpm.r.y.data,
+ result_op->asym->ecpm.r.y.length))
+ return -1;
+
+ return 0;
+}
#endif /* TEST_CRYPTODEV_ASYM_TEST_UTIL_H__ */
diff --git a/app/test/test_cryptodev_ecpm_test_vectors.h b/app/test/test_cryptodev_ecpm_test_vectors.h
new file mode 100644
index 0000000..96c3455
--- /dev/null
+++ b/app/test/test_cryptodev_ecpm_test_vectors.h
@@ -0,0 +1,353 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2019 Marvell International Ltd.
+ */
+
+#ifndef __TEST_CRYPTODEV_ECPM_TEST_VECTORS_H__
+#define __TEST_CRYPTODEV_ECPM_TEST_VECTORS_H__
+
+#include "rte_crypto_asym.h"
+
+struct crypto_testsuite_ecpm_params {
+ rte_crypto_param gen_x;
+ rte_crypto_param gen_y;
+ rte_crypto_param privkey;
+ rte_crypto_param pubkey_x;
+ rte_crypto_param pubkey_y;
+ int curve;
+};
+
+/* P-192 NIST test vectors */
+
+static uint8_t gen_x_p192[] = {
+ 0x18, 0x8d, 0xa8, 0x0e, 0xb0, 0x30, 0x90, 0xf6,
+ 0x7c, 0xbf, 0x20, 0xeb, 0x43, 0xa1, 0x88, 0x00,
+ 0xf4, 0xff, 0x0a, 0xfd, 0x82, 0xff, 0x10, 0x12
+};
+
+static uint8_t gen_y_p192[] = {
+ 0x07, 0x19, 0x2b, 0x95, 0xff, 0xc8, 0xda, 0x78,
+ 0x63, 0x10, 0x11, 0xed, 0x6b, 0x24, 0xcd, 0xd5,
+ 0x73, 0xf9, 0x77, 0xa1, 0x1e, 0x79, 0x48, 0x11
+};
+
+static uint8_t privkey_p192[] = {
+ 0x24, 0xed, 0xd2, 0x2f, 0x7d, 0xdd, 0x6f, 0xa5,
+ 0xbc, 0x61, 0xfc, 0x06, 0x53, 0x47, 0x9a, 0xa4,
+ 0x08, 0x09, 0xef, 0x86, 0x5c, 0xf2, 0x7a, 0x47
+};
+static uint8_t pubkey_x_p192[] = {
+ 0x9b, 0xf1, 0x2d, 0x71, 0x74, 0xb7, 0x70, 0x8a,
+ 0x07, 0x6a, 0x38, 0xbc, 0x80, 0xaa, 0x28, 0x66,
+ 0x2f, 0x25, 0x1e, 0x2e, 0xd8, 0xd4, 0x14, 0xdc
+};
+
+static uint8_t pubkey_y_p192[] = {
+ 0x48, 0x54, 0xc8, 0xd0, 0x7d, 0xfc, 0x08, 0x82,
+ 0x4e, 0x9e, 0x47, 0x1c, 0xa2, 0xfe, 0xdc, 0xfc,
+ 0xff, 0x3d, 0xdc, 0xb0, 0x11, 0x57, 0x34, 0x98
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_p192 = {
+ .gen_x = {
+ .data = gen_x_p192,
+ .length = sizeof(gen_x_p192),
+ },
+ .gen_y = {
+ .data = gen_y_p192,
+ .length = sizeof(gen_y_p192),
+ },
+ .privkey = {
+ .data = privkey_p192,
+ .length = sizeof(privkey_p192),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_p192,
+ .length = sizeof(pubkey_x_p192),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_p192,
+ .length = sizeof(pubkey_y_p192),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_NISTP192
+};
+
+/* P-224 NIST test vectors */
+
+static uint8_t gen_x_p224[] = {
+ 0xb7, 0x0e, 0x0c, 0xbd, 0x6b, 0xb4, 0xbf, 0x7f,
+ 0x32, 0x13, 0x90, 0xb9, 0x4a, 0x03, 0xc1, 0xd3,
+ 0x56, 0xc2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xd6,
+ 0x11, 0x5c, 0x1d, 0x21
+};
+
+static uint8_t gen_y_p224[] = {
+ 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb,
+ 0x4c, 0x22, 0xdf, 0xe6, 0xcd, 0x43, 0x75, 0xa0,
+ 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99,
+ 0x85, 0x00, 0x7e, 0x34
+};
+
+static uint8_t privkey_p224[] = {
+ 0x88, 0x8f, 0xc9, 0x92, 0x89, 0x3b, 0xdd, 0x8a,
+ 0xa0, 0x2c, 0x80, 0x76, 0x88, 0x32, 0x60, 0x5d,
+ 0x02, 0x0b, 0x81, 0xae, 0x0b, 0x25, 0x47, 0x41,
+ 0x54, 0xec, 0x89, 0xaa
+};
+
+static uint8_t pubkey_x_p224[] = {
+ 0x4c, 0x74, 0x1e, 0x4d, 0x20, 0x10, 0x36, 0x70,
+ 0xb7, 0x16, 0x1a, 0xe7, 0x22, 0x71, 0x08, 0x21,
+ 0x55, 0x83, 0x84, 0x18, 0x08, 0x43, 0x35, 0x33,
+ 0x8a, 0xc3, 0x8f, 0xa4
+};
+
+static uint8_t pubkey_y_p224[] = {
+ 0xdb, 0x79, 0x19, 0x15, 0x1a, 0xc2, 0x85, 0x87,
+ 0xb7, 0x2b, 0xad, 0x7a, 0xb1, 0x80, 0xec, 0x8e,
+ 0x95, 0xab, 0x9e, 0x2c, 0x8d, 0x81, 0xd9, 0xb9,
+ 0xd7, 0xe2, 0xe3, 0x83
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_p224 = {
+ .gen_x = {
+ .data = gen_x_p224,
+ .length = sizeof(gen_x_p224),
+ },
+ .gen_y = {
+ .data = gen_y_p224,
+ .length = sizeof(gen_y_p224),
+ },
+ .privkey = {
+ .data = privkey_p224,
+ .length = sizeof(privkey_p224),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_p224,
+ .length = sizeof(pubkey_x_p224),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_p224,
+ .length = sizeof(pubkey_y_p224),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_NISTP224
+};
+
+/* P-256 NIST test vectors */
+
+static uint8_t gen_x_p256[] = {
+ 0x6b, 0x17, 0xd1, 0xf2, 0xe1, 0x2c, 0x42, 0x47,
+ 0xf8, 0xbc, 0xe6, 0xe5, 0x63, 0xa4, 0x40, 0xf2,
+ 0x77, 0x03, 0x7d, 0x81, 0x2d, 0xeb, 0x33, 0xa0,
+ 0xf4, 0xa1, 0x39, 0x45, 0xd8, 0x98, 0xc2, 0x96
+};
+
+static uint8_t gen_y_p256[] = {
+ 0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f, 0x9b,
+ 0x8e, 0xe7, 0xeb, 0x4a, 0x7c, 0x0f, 0x9e, 0x16,
+ 0x2b, 0xce, 0x33, 0x57, 0x6b, 0x31, 0x5e, 0xce,
+ 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 0xf5
+};
+
+static uint8_t pubkey_x_p256[] = {
+ 0x06, 0x27, 0x5d, 0x38, 0x7b, 0x8f, 0xcd, 0x29,
+ 0x12, 0x02, 0xa5, 0xad, 0x72, 0x35, 0x55, 0xd4,
+ 0xe1, 0xca, 0xd6, 0x32, 0x91, 0xe7, 0x8c, 0xb7,
+ 0xf9, 0x85, 0xfe, 0xb5, 0xca, 0x61, 0xfd, 0xa7,
+};
+
+static uint8_t pubkey_y_p256[] = {
+ 0x6d, 0x28, 0x17, 0x9c, 0x88, 0x2a, 0x06, 0x8c,
+ 0x85, 0x52, 0x44, 0xc1, 0x2f, 0xf6, 0x45, 0x80,
+ 0x63, 0x1c, 0x52, 0xe4, 0xa5, 0xf8, 0x21, 0x43,
+ 0xec, 0xeb, 0xe2, 0xbb, 0x39, 0xff, 0x1f, 0xd8
+};
+
+static uint8_t privkey_p256[] = {
+ 0x36, 0xf7, 0xe3, 0x07, 0x84, 0xfa, 0xb5, 0x8d,
+ 0x8d, 0x1d, 0x00, 0x21, 0x8b, 0x59, 0xd1, 0x70,
+ 0x14, 0x94, 0x86, 0x69, 0xec, 0xd3, 0x99, 0xc8,
+ 0x7a, 0xf0, 0x2d, 0x05, 0xbf, 0x16, 0xed, 0x36
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_p256 = {
+ .gen_x = {
+ .data = gen_x_p256,
+ .length = sizeof(gen_x_p256),
+ },
+ .gen_y = {
+ .data = gen_y_p256,
+ .length = sizeof(gen_y_p256),
+ },
+ .privkey = {
+ .data = privkey_p256,
+ .length = sizeof(privkey_p256),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_p256,
+ .length = sizeof(pubkey_x_p256),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_p256,
+ .length = sizeof(pubkey_y_p256),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_NISTP256
+};
+
+/* P-384 NIST test vectors */
+
+static uint8_t gen_x_p384[] = {
+ 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
+};
+
+static uint8_t gen_y_p384[] = {
+ 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
+};
+
+static uint8_t privkey_p384[] = {
+ 0xc6, 0x02, 0xbc, 0x74, 0xa3, 0x45, 0x92, 0xc3,
+ 0x11, 0xa6, 0x56, 0x96, 0x61, 0xe0, 0x83, 0x2c,
+ 0x84, 0xf7, 0x20, 0x72, 0x74, 0x67, 0x6c, 0xc4,
+ 0x2a, 0x89, 0xf0, 0x58, 0x16, 0x26, 0x30, 0x18,
+ 0x4b, 0x52, 0xf0, 0xd9, 0x9b, 0x85, 0x5a, 0x77,
+ 0x83, 0xc9, 0x87, 0x47, 0x6d, 0x7f, 0x9e, 0x6b
+};
+
+static uint8_t pubkey_x_p384[] = {
+ 0x04, 0x00, 0x19, 0x3b, 0x21, 0xf0, 0x7c, 0xd0,
+ 0x59, 0x82, 0x6e, 0x94, 0x53, 0xd3, 0xe9, 0x6d,
+ 0xd1, 0x45, 0x04, 0x1c, 0x97, 0xd4, 0x9f, 0xf6,
+ 0xb7, 0x04, 0x7f, 0x86, 0xbb, 0x0b, 0x04, 0x39,
+ 0xe9, 0x09, 0x27, 0x4c, 0xb9, 0xc2, 0x82, 0xbf,
+ 0xab, 0x88, 0x67, 0x4c, 0x07, 0x65, 0xbc, 0x75
+};
+
+static uint8_t pubkey_y_p384[] = {
+ 0xf7, 0x0d, 0x89, 0xc5, 0x2a, 0xcb, 0xc7, 0x04,
+ 0x68, 0xd2, 0xc5, 0xae, 0x75, 0xc7, 0x6d, 0x7f,
+ 0x69, 0xb7, 0x6a, 0xf6, 0x2d, 0xcf, 0x95, 0xe9,
+ 0x9e, 0xba, 0x5d, 0xd1, 0x1a, 0xdf, 0x8f, 0x42,
+ 0xec, 0x9a, 0x42, 0x5b, 0x0c, 0x5e, 0xc9, 0x8e,
+ 0x2f, 0x23, 0x4a, 0x92, 0x6b, 0x82, 0xa1, 0x47
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_p384 = {
+ .gen_x = {
+ .data = gen_x_p384,
+ .length = sizeof(gen_x_p384),
+ },
+ .gen_y = {
+ .data = gen_y_p384,
+ .length = sizeof(gen_y_p384),
+ },
+ .privkey = {
+ .data = privkey_p384,
+ .length = sizeof(privkey_p384),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_p384,
+ .length = sizeof(pubkey_x_p384),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_p384,
+ .length = sizeof(pubkey_y_p384),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_NISTP384
+};
+
+/* P-521 NIST test vectors */
+
+static uint8_t gen_x_p521[] = {
+ 0xc6, 0x85, 0x8e, 0x06, 0xb7, 0x04, 0x04,
+ 0xe9, 0xcd, 0x9e, 0x3e, 0xcb, 0x66, 0x23, 0x95,
+ 0xb4, 0x42, 0x9c, 0x64, 0x81, 0x39, 0x05, 0x3f,
+ 0xb5, 0x21, 0xf8, 0x28, 0xaf, 0x60, 0x6b, 0x4d,
+ 0x3d, 0xba, 0xa1, 0x4b, 0x5e, 0x77, 0xef, 0xe7,
+ 0x59, 0x28, 0xfe, 0x1d, 0xc1, 0x27, 0xa2, 0xff,
+ 0xa8, 0xde, 0x33, 0x48, 0xb3, 0xc1, 0x85, 0x6a,
+ 0x42, 0x9b, 0xf9, 0x7e, 0x7e, 0x31, 0xc2, 0xe5,
+ 0xbd, 0x66
+};
+
+static uint8_t gen_y_p521[] = {
+ 0x01, 0x18, 0x39, 0x29, 0x6a, 0x78, 0x9a, 0x3b,
+ 0xc0, 0x04, 0x5c, 0x8a, 0x5f, 0xb4, 0x2c, 0x7d,
+ 0x1b, 0xd9, 0x98, 0xf5, 0x44, 0x49, 0x57, 0x9b,
+ 0x44, 0x68, 0x17, 0xaf, 0xbd, 0x17, 0x27, 0x3e,
+ 0x66, 0x2c, 0x97, 0xee, 0x72, 0x99, 0x5e, 0xf4,
+ 0x26, 0x40, 0xc5, 0x50, 0xb9, 0x01, 0x3f, 0xad,
+ 0x07, 0x61, 0x35, 0x3c, 0x70, 0x86, 0xa2, 0x72,
+ 0xc2, 0x40, 0x88, 0xbe, 0x94, 0x76, 0x9f, 0xd1,
+ 0x66, 0x50
+};
+
+static uint8_t privkey_p521[] = {
+ 0x01, 0xe8, 0xc0, 0x59, 0x96, 0xb8, 0x5e, 0x6f,
+ 0x3f, 0x87, 0x57, 0x12, 0xa0, 0x9c, 0x1b, 0x40,
+ 0x67, 0x2b, 0x5e, 0x7a, 0x78, 0xd5, 0x85, 0x2d,
+ 0xe0, 0x15, 0x85, 0xc5, 0xfb, 0x99, 0x0b, 0xf3,
+ 0x81, 0x2c, 0x32, 0x45, 0x53, 0x4a, 0x71, 0x43,
+ 0x89, 0xae, 0x90, 0x14, 0xd6, 0x77, 0xa4, 0x49,
+ 0xef, 0xd6, 0x58, 0x25, 0x4e, 0x61, 0x0d, 0xa8,
+ 0xe6, 0xca, 0xd3, 0x34, 0x14, 0xb9, 0xd3, 0x3e,
+ 0x0d, 0x7a
+};
+
+static uint8_t pubkey_x_p521[] = {
+ 0x00, 0x7d, 0x04, 0x2c, 0xa1, 0x94, 0x08, 0x52,
+ 0x4e, 0x68, 0xb9, 0x81, 0xf1, 0x41, 0x93, 0x51,
+ 0xe3, 0xb8, 0x47, 0x36, 0xc7, 0x7f, 0xe5, 0x8f,
+ 0xee, 0x7d, 0x11, 0x31, 0x7d, 0xf2, 0xe8, 0x50,
+ 0xd9, 0x60, 0xc7, 0xdd, 0x10, 0xd1, 0x0b, 0xa7,
+ 0x14, 0xc8, 0xa6, 0x09, 0xd1, 0x63, 0x50, 0x2b,
+ 0x79, 0xd6, 0x82, 0xe8, 0xbb, 0xec, 0xd4, 0xf5,
+ 0x25, 0x91, 0xd2, 0x74, 0x85, 0x33, 0xe4, 0x5a,
+ 0x86, 0x7a
+};
+
+static uint8_t pubkey_y_p521[] = {
+ 0x01, 0x97, 0xac, 0x64, 0x16, 0x11, 0x1c, 0xcf,
+ 0x98, 0x7d, 0x29, 0x04, 0x59, 0xeb, 0xc8, 0xad,
+ 0x9e, 0xc5, 0x6e, 0x49, 0x05, 0x9c, 0x99, 0x21,
+ 0x55, 0x53, 0x9a, 0x36, 0xa6, 0x26, 0x63, 0x1f,
+ 0x4a, 0x2d, 0x89, 0x16, 0x4b, 0x98, 0x51, 0x54,
+ 0xf2, 0xdd, 0xdc, 0x02, 0x81, 0xee, 0x5b, 0x51,
+ 0x78, 0x27, 0x1f, 0x3a, 0x76, 0xa0, 0x91, 0x4c,
+ 0x3f, 0xcd, 0x1f, 0x97, 0xbe, 0x8e, 0x83, 0x76,
+ 0xef, 0xb3
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_p521 = {
+ .gen_x = {
+ .data = gen_x_p521,
+ .length = sizeof(gen_x_p521),
+ },
+ .gen_y = {
+ .data = gen_y_p521,
+ .length = sizeof(gen_y_p521),
+ },
+ .privkey = {
+ .data = privkey_p521,
+ .length = sizeof(privkey_p521),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_p521,
+ .length = sizeof(pubkey_x_p521),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_p521,
+ .length = sizeof(pubkey_y_p521),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_NISTP521
+};
+
+#endif /* __TEST_CRYPTODEV_ECPM_TEST_VECTORS_H__ */
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication
2019-12-05 15:37 ` [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication Anoob Joseph
@ 2020-01-13 12:43 ` Akhil Goyal
2020-01-14 6:44 ` Anoob Joseph
0 siblings, 1 reply; 14+ messages in thread
From: Akhil Goyal @ 2020-01-13 12:43 UTC (permalink / raw)
To: Anoob Joseph, Declan Doherty, Pablo de Lara
Cc: Balakrishna Bhamidipati, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, Sunila Sahu, dev
>
> From: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
>
> Elliptic Curve Point Multiplication xform type and op
> parameters are added.
Description should convey that it is an asymmetric crypto feature.
>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
> Signed-off-by: Sunila Sahu <ssahu@marvell.com>
Title should be cryptodev: support ECPM
> ---
> doc/guides/cryptodevs/features/default.ini | 1 +
> lib/librte_cryptodev/rte_crypto_asym.h | 17 +++++++++++++++++
> lib/librte_cryptodev/rte_cryptodev.c | 1 +
> 3 files changed, 19 insertions(+)
>
> diff --git a/doc/guides/cryptodevs/features/default.ini
> b/doc/guides/cryptodevs/features/default.ini
> index 2f6c785..3a54b07 100644
> --- a/doc/guides/cryptodevs/features/default.ini
> +++ b/doc/guides/cryptodevs/features/default.ini
> @@ -109,3 +109,4 @@ Modular Exponentiation =
> Modular Inversion =
> Diffie-hellman =
> ECDSA =
> +EC Point Multiplication =
I think it is better to have ECPM instead of EC Point Multiplication as it is the case with ECDSA.
> diff --git a/lib/librte_cryptodev/rte_crypto_asym.h
> b/lib/librte_cryptodev/rte_crypto_asym.h
> index dd5e6e3..b98ce6c 100644
> --- a/lib/librte_cryptodev/rte_crypto_asym.h
> +++ b/lib/librte_cryptodev/rte_crypto_asym.h
> @@ -85,6 +85,8 @@ enum rte_crypto_asym_xform_type {
> /**< Elliptic Curve Digital Signature Algorithm
> * Perform Signature Generation and Verification.
> */
> + RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL,
Should be RTE_CRYPTO_ASYM_XFORM_ECPM
> + /**< Elliptic Curve Point Multiplication */
> RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
> /**< End of list */
> };
> @@ -598,6 +600,20 @@ struct rte_crypto_ecdsa_op_param {
> };
>
> /**
> + * Structure for EC point operation param
> + */
> +struct rte_crypto_ec_point_mul_param {
Better to have rte_crypto_ecpm_param
> + struct rte_crypto_ec_point p;
> + /**< x and y coordinates of input point */
> +
> + struct rte_crypto_ec_point r;
> + /**< x and y coordinates of resultant point */
> +
> + rte_crypto_param scalar;
> + /**< Scalar to multiply the input point */
> +};
> +
> +/**
> * Asymmetric Cryptographic Operation.
> *
> * Structure describing asymmetric crypto operation params.
> @@ -620,6 +636,7 @@ struct rte_crypto_asym_op {
> struct rte_crypto_dh_op_param dh;
> struct rte_crypto_dsa_op_param dsa;
> struct rte_crypto_ecdsa_op_param ecdsa;
> + struct rte_crypto_ec_point_mul_param ecpm;
> };
> };
>
> diff --git a/lib/librte_cryptodev/rte_cryptodev.c
> b/lib/librte_cryptodev/rte_cryptodev.c
> index 0d6babb..eea57c6 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.c
> +++ b/lib/librte_cryptodev/rte_cryptodev.c
> @@ -174,6 +174,7 @@ const char *rte_crypto_asym_xform_strings[] = {
> [RTE_CRYPTO_ASYM_XFORM_DH] = "dh",
> [RTE_CRYPTO_ASYM_XFORM_DSA] = "dsa",
> [RTE_CRYPTO_ASYM_XFORM_ECDSA] = "ecdsa",
> + [RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL] = "ecpm",
> };
>
> /**
> --
> 2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication
2020-01-13 12:43 ` Akhil Goyal
@ 2020-01-14 6:44 ` Anoob Joseph
0 siblings, 0 replies; 14+ messages in thread
From: Anoob Joseph @ 2020-01-14 6:44 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Balakrishna Bhamidipati, Fiona Trahe, Arek Kusztal,
Jerin Jacob Kollanukkaran, Narayana Prasad Raju Athreya,
Shally Verma, Ankur Dwivedi, Sunila Sahu, dev
Hi Akhil,
Please see inline.
Thanks,
Anoob
> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Monday, January 13, 2020 6:14 PM
> To: Anoob Joseph <anoobj@marvell.com>; Declan Doherty
> <declan.doherty@intel.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>
> Cc: Balakrishna Bhamidipati <bbhamidipati@marvell.com>; Fiona Trahe
> <fiona.trahe@intel.com>; Arek Kusztal <arkadiuszx.kusztal@intel.com>;
> Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Narayana Prasad Raju
> Athreya <pathreya@marvell.com>; Shally Verma <shallyv@marvell.com>;
> Ankur Dwivedi <adwivedi@marvell.com>; Sunila Sahu
> <ssahu@marvell.com>; dev@dpdk.org
> Subject: [EXT] RE: [PATCH 1/4] lib/crypto: add support for EC Point
> Multiplication
>
> External Email
>
> ----------------------------------------------------------------------
>
> >
> > From: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
> >
> > Elliptic Curve Point Multiplication xform type and op parameters are
> > added.
>
> Description should convey that it is an asymmetric crypto feature.
[Anoob] Will update in v2.
>
> >
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> > Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
> > Signed-off-by: Sunila Sahu <ssahu@marvell.com>
>
> Title should be cryptodev: support ECPM
[Anoob] Will update in v2.
>
> > ---
> > doc/guides/cryptodevs/features/default.ini | 1 +
> > lib/librte_cryptodev/rte_crypto_asym.h | 17 +++++++++++++++++
> > lib/librte_cryptodev/rte_cryptodev.c | 1 +
> > 3 files changed, 19 insertions(+)
> >
> > diff --git a/doc/guides/cryptodevs/features/default.ini
> > b/doc/guides/cryptodevs/features/default.ini
> > index 2f6c785..3a54b07 100644
> > --- a/doc/guides/cryptodevs/features/default.ini
> > +++ b/doc/guides/cryptodevs/features/default.ini
> > @@ -109,3 +109,4 @@ Modular Exponentiation =
> > Modular Inversion =
> > Diffie-hellman =
> > ECDSA =
> > +EC Point Multiplication =
>
> I think it is better to have ECPM instead of EC Point Multiplication as it is the
> case with ECDSA.
[Anoob] Agreed. Will update in v2.
>
>
> > diff --git a/lib/librte_cryptodev/rte_crypto_asym.h
> > b/lib/librte_cryptodev/rte_crypto_asym.h
> > index dd5e6e3..b98ce6c 100644
> > --- a/lib/librte_cryptodev/rte_crypto_asym.h
> > +++ b/lib/librte_cryptodev/rte_crypto_asym.h
> > @@ -85,6 +85,8 @@ enum rte_crypto_asym_xform_type {
> > /**< Elliptic Curve Digital Signature Algorithm
> > * Perform Signature Generation and Verification.
> > */
> > + RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL,
> Should be RTE_CRYPTO_ASYM_XFORM_ECPM
>
> > + /**< Elliptic Curve Point Multiplication */
> > RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
> > /**< End of list */
> > };
> > @@ -598,6 +600,20 @@ struct rte_crypto_ecdsa_op_param { };
> >
> > /**
> > + * Structure for EC point operation param */ struct
> > +rte_crypto_ec_point_mul_param {
>
> Better to have rte_crypto_ecpm_param
[Anoob] Agreed. Will update in v2.
>
> > + struct rte_crypto_ec_point p;
> > + /**< x and y coordinates of input point */
> > +
> > + struct rte_crypto_ec_point r;
> > + /**< x and y coordinates of resultant point */
> > +
> > + rte_crypto_param scalar;
> > + /**< Scalar to multiply the input point */ };
> > +
> > +/**
> > * Asymmetric Cryptographic Operation.
> > *
> > * Structure describing asymmetric crypto operation params.
> > @@ -620,6 +636,7 @@ struct rte_crypto_asym_op {
> > struct rte_crypto_dh_op_param dh;
> > struct rte_crypto_dsa_op_param dsa;
> > struct rte_crypto_ecdsa_op_param ecdsa;
> > + struct rte_crypto_ec_point_mul_param ecpm;
> > };
> > };
> >
> > diff --git a/lib/librte_cryptodev/rte_cryptodev.c
> > b/lib/librte_cryptodev/rte_cryptodev.c
> > index 0d6babb..eea57c6 100644
> > --- a/lib/librte_cryptodev/rte_cryptodev.c
> > +++ b/lib/librte_cryptodev/rte_cryptodev.c
> > @@ -174,6 +174,7 @@ const char *rte_crypto_asym_xform_strings[] = {
> > [RTE_CRYPTO_ASYM_XFORM_DH] = "dh",
> > [RTE_CRYPTO_ASYM_XFORM_DSA] = "dsa",
> > [RTE_CRYPTO_ASYM_XFORM_ECDSA] = "ecdsa",
> > + [RTE_CRYPTO_ASYM_XFORM_EC_POINT_MUL] = "ecpm",
> > };
> >
> > /**
> > --
> > 2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH v2 0/4] add ECPM support
2019-12-05 15:37 [dpdk-dev] [PATCH 0/4] add ECPM support Anoob Joseph
` (3 preceding siblings ...)
2019-12-05 15:38 ` [dpdk-dev] [PATCH 4/4] app/test: add EC point multiplication test Anoob Joseph
@ 2020-01-15 12:56 ` Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 1/4] cryptodev: support ECPM Anoob Joseph
` (4 more replies)
4 siblings, 5 replies; 14+ messages in thread
From: Anoob Joseph @ 2020-01-15 12:56 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Anoob Joseph, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, Sunila Sahu, dev
This series adds support for ECPM (Elliptic Curve Point Multiplication)
asymmetric operations. Library changes and PMD changes for
crypto_octeontx & crypto_octeontx2 is added. The final patch adds
the required test vectors and verification routines.
v2:
* Made all references to point multiplication operation as ECPM.
* Changed all NIST references to use SECP.
* Updated release notes
Balakrishna Bhamidipati (1):
cryptodev: support ECPM
Sunila Sahu (3):
crypto/octeontx: add ECPM support
crypto/octeontx2: add ECPM support
app/test: add ECPM tests
app/test/test_cryptodev_asym.c | 176 ++++++++++
app/test/test_cryptodev_asym_util.h | 11 +
app/test/test_cryptodev_ecpm_test_vectors.h | 353 +++++++++++++++++++++
doc/guides/cryptodevs/features/default.ini | 1 +
doc/guides/cryptodevs/features/octeontx.ini | 1 +
doc/guides/cryptodevs/features/octeontx2.ini | 1 +
doc/guides/rel_notes/release_20_02.rst | 5 +
drivers/common/cpt/cpt_mcode_defines.h | 2 +
drivers/common/cpt/cpt_ucode_asym.h | 85 +++++
.../crypto/octeontx/otx_cryptodev_capabilities.c | 10 +
drivers/crypto/octeontx/otx_cryptodev_ops.c | 23 ++
.../crypto/octeontx2/otx2_cryptodev_capabilities.c | 10 +
drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 22 ++
lib/librte_cryptodev/rte_crypto_asym.h | 17 +
lib/librte_cryptodev/rte_cryptodev.c | 1 +
15 files changed, 718 insertions(+)
create mode 100644 app/test/test_cryptodev_ecpm_test_vectors.h
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH v2 1/4] cryptodev: support ECPM
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
@ 2020-01-15 12:56 ` Anoob Joseph
2020-01-15 15:49 ` Akhil Goyal
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 2/4] crypto/octeontx: add ECPM support Anoob Joseph
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Anoob Joseph @ 2020-01-15 12:56 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Balakrishna Bhamidipati, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, Sunila Sahu, dev,
Anoob Joseph
From: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Asymmetric crypto library is extended to add ECPM (Elliptic Curve Point
Multiplication). The required xform type and op parameters are
introduced.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
doc/guides/cryptodevs/features/default.ini | 1 +
doc/guides/rel_notes/release_20_02.rst | 5 +++++
lib/librte_cryptodev/rte_crypto_asym.h | 17 +++++++++++++++++
lib/librte_cryptodev/rte_cryptodev.c | 1 +
4 files changed, 24 insertions(+)
diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index 2f6c785..f639a88 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -109,3 +109,4 @@ Modular Exponentiation =
Modular Inversion =
Diffie-hellman =
ECDSA =
+ECPM =
diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 2e97c60..4baec2b 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -61,6 +61,11 @@ New Features
Added ECDSA(Elliptic Curve Digital Signature Algorithm) support to asymmetric
crypto library specifications.
+* **Added support for ECPM.**
+
+ Added ECPM(Elliptic Curve Point Multiplication) support to asymmetric
+ crypto library specifications.
+
Removed Items
-------------
diff --git a/lib/librte_cryptodev/rte_crypto_asym.h b/lib/librte_cryptodev/rte_crypto_asym.h
index e17614e..9c866f5 100644
--- a/lib/librte_cryptodev/rte_crypto_asym.h
+++ b/lib/librte_cryptodev/rte_crypto_asym.h
@@ -92,6 +92,8 @@ enum rte_crypto_asym_xform_type {
/**< Elliptic Curve Digital Signature Algorithm
* Perform Signature Generation and Verification.
*/
+ RTE_CRYPTO_ASYM_XFORM_ECPM,
+ /**< Elliptic Curve Point Multiplication */
RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
/**< End of list */
};
@@ -599,6 +601,20 @@ struct rte_crypto_ecdsa_op_param {
};
/**
+ * Structure for EC point multiplication operation param
+ */
+struct rte_crypto_ecpm_op_param {
+ struct rte_crypto_ec_point p;
+ /**< x and y coordinates of input point */
+
+ struct rte_crypto_ec_point r;
+ /**< x and y coordinates of resultant point */
+
+ rte_crypto_param scalar;
+ /**< Scalar to multiply the input point */
+};
+
+/**
* Asymmetric Cryptographic Operation.
*
* Structure describing asymmetric crypto operation params.
@@ -621,6 +637,7 @@ struct rte_crypto_asym_op {
struct rte_crypto_dh_op_param dh;
struct rte_crypto_dsa_op_param dsa;
struct rte_crypto_ecdsa_op_param ecdsa;
+ struct rte_crypto_ecpm_op_param ecpm;
};
};
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 0d6babb..ab4b231 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -174,6 +174,7 @@ const char *rte_crypto_asym_xform_strings[] = {
[RTE_CRYPTO_ASYM_XFORM_DH] = "dh",
[RTE_CRYPTO_ASYM_XFORM_DSA] = "dsa",
[RTE_CRYPTO_ASYM_XFORM_ECDSA] = "ecdsa",
+ [RTE_CRYPTO_ASYM_XFORM_ECPM] = "ecpm",
};
/**
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH v2 2/4] crypto/octeontx: add ECPM support
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 1/4] cryptodev: support ECPM Anoob Joseph
@ 2020-01-15 12:56 ` Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 3/4] crypto/octeontx2: " Anoob Joseph
` (2 subsequent siblings)
4 siblings, 0 replies; 14+ messages in thread
From: Anoob Joseph @ 2020-01-15 12:56 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Sunila Sahu, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, dev, Anoob Joseph,
Balakrishna Bhamidipati
From: Sunila Sahu <ssahu@marvell.com>
Add support for asymmetric opertion EC Point Multiplication,
in crypto_octeontx PMD.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
doc/guides/cryptodevs/features/octeontx.ini | 1 +
drivers/common/cpt/cpt_mcode_defines.h | 2 +
drivers/common/cpt/cpt_ucode_asym.h | 85 ++++++++++++++++++++++
.../crypto/octeontx/otx_cryptodev_capabilities.c | 10 +++
drivers/crypto/octeontx/otx_cryptodev_ops.c | 23 ++++++
5 files changed, 121 insertions(+)
diff --git a/doc/guides/cryptodevs/features/octeontx.ini b/doc/guides/cryptodevs/features/octeontx.ini
index 544bb46..f0ed3ed 100644
--- a/doc/guides/cryptodevs/features/octeontx.ini
+++ b/doc/guides/cryptodevs/features/octeontx.ini
@@ -73,3 +73,4 @@ Modular Exponentiation = Y
Modular Inversion =
Diffie-hellman =
ECDSA = Y
+ECPM = Y
diff --git a/drivers/common/cpt/cpt_mcode_defines.h b/drivers/common/cpt/cpt_mcode_defines.h
index 64d3e8c..d830bef 100644
--- a/drivers/common/cpt/cpt_mcode_defines.h
+++ b/drivers/common/cpt/cpt_mcode_defines.h
@@ -24,6 +24,7 @@
/* AE opcodes */
#define CPT_MAJOR_OP_MODEX 0x03
#define CPT_MAJOR_OP_ECDSA 0x04
+#define CPT_MAJOR_OP_ECC 0x05
#define CPT_MINOR_OP_MODEX 0x01
#define CPT_MINOR_OP_PKCS_ENC 0x02
#define CPT_MINOR_OP_PKCS_ENC_CRT 0x03
@@ -32,6 +33,7 @@
#define CPT_MINOR_OP_MODEX_CRT 0x06
#define CPT_MINOR_OP_ECDSA_SIGN 0x01
#define CPT_MINOR_OP_ECDSA_VERIFY 0x02
+#define CPT_MINOR_OP_ECC_UMP 0x03
#define CPT_BLOCK_TYPE1 0
#define CPT_BLOCK_TYPE2 1
diff --git a/drivers/common/cpt/cpt_ucode_asym.h b/drivers/common/cpt/cpt_ucode_asym.h
index 0caa313..881959e 100644
--- a/drivers/common/cpt/cpt_ucode_asym.h
+++ b/drivers/common/cpt/cpt_ucode_asym.h
@@ -172,6 +172,8 @@ cpt_fill_asym_session_parameters(struct cpt_asym_sess_misc *sess,
ret = cpt_fill_modex_params(sess, xform);
break;
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
+ /* Fall through */
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
ret = cpt_fill_ec_params(sess, xform);
break;
default:
@@ -199,6 +201,8 @@ cpt_free_asym_session_parameters(struct cpt_asym_sess_misc *sess)
rte_free(mod->modulus.data);
break;
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
+ /* Fall through */
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
break;
default:
CPT_LOG_DP_ERR("Invalid transform type");
@@ -828,4 +832,85 @@ cpt_enqueue_ecdsa_op(struct rte_crypto_op *op,
return 0;
}
+static __rte_always_inline int
+cpt_ecpm_prep(struct rte_crypto_ecpm_op_param *ecpm,
+ struct asym_op_params *asym_params,
+ uint8_t curveid)
+{
+ struct cpt_request_info *req = asym_params->req;
+ phys_addr_t mphys = asym_params->meta_buf;
+ uint16_t x1_len = ecpm->p.x.length;
+ uint16_t y1_len = ecpm->p.y.length;
+ uint16_t scalar_align, p_align;
+ uint16_t dlen, rlen, prime_len;
+ uint16_t x1_offset, y1_offset;
+ vq_cmd_word0_t vq_cmd_w0;
+ opcode_info_t opcode;
+ buf_ptr_t caddr;
+ uint8_t *dptr;
+
+ prime_len = ec_grp[curveid].prime.length;
+
+ /* Input buffer */
+ dptr = RTE_PTR_ADD(req, sizeof(struct cpt_request_info));
+
+ p_align = ROUNDUP8(prime_len);
+ scalar_align = ROUNDUP8(ecpm->scalar.length);
+
+ /*
+ * Set dlen = sum(ROUNDUP8(input point(x and y coordinates), prime,
+ * scalar length),
+ * Please note point length is equivalent to prime of the curve
+ */
+ dlen = 3 * p_align + scalar_align;
+
+ x1_offset = prime_len - x1_len;
+ y1_offset = prime_len - y1_len;
+
+ memset(dptr, 0, dlen);
+
+ /* Copy input point, scalar, prime */
+ memcpy(dptr + x1_offset, ecpm->p.x.data, x1_len);
+ dptr += p_align;
+ memcpy(dptr + y1_offset, ecpm->p.y.data, y1_len);
+ dptr += p_align;
+ memcpy(dptr, ecpm->scalar.data, ecpm->scalar.length);
+ dptr += scalar_align;
+ memcpy(dptr, ec_grp[curveid].prime.data, ec_grp[curveid].prime.length);
+ dptr += p_align;
+
+ /* Setup opcodes */
+ opcode.s.major = CPT_MAJOR_OP_ECC;
+ opcode.s.minor = CPT_MINOR_OP_ECC_UMP;
+
+ /* GP op header */
+ vq_cmd_w0.s.opcode = opcode.flags;
+ vq_cmd_w0.s.param1 = curveid;
+ vq_cmd_w0.s.param2 = ecpm->scalar.length;
+ vq_cmd_w0.s.dlen = dlen;
+ vq_cmd_w0.u64 = vq_cmd_w0.u64;
+
+ /* Filling cpt_request_info structure */
+ req->ist.ei0 = vq_cmd_w0.u64;
+ req->ist.ei1 = mphys;
+ req->ist.ei2 = mphys + dlen;
+
+ /* Result buffer will store output point where length of
+ * each coordinate will be of prime length, thus set
+ * rlen to twice of prime length.
+ */
+ rlen = p_align << 1;
+ req->rptr = dptr;
+
+ /* alternate_caddr to write completion status by the microcode */
+ req->alternate_caddr = (uint64_t *)(dptr + rlen);
+ *req->alternate_caddr = ~((uint64_t)COMPLETION_CODE_INIT);
+
+ /* Preparing completion addr, +1 for completion code */
+ caddr.vaddr = dptr + rlen + 1;
+ caddr.dma_addr = mphys + dlen + rlen + 1;
+
+ cpt_fill_req_comp_addr(req, caddr);
+ return 0;
+}
#endif /* _CPT_UCODE_ASYM_H_ */
diff --git a/drivers/crypto/octeontx/otx_cryptodev_capabilities.c b/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
index 6418ad2..1174ee4 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
@@ -641,6 +641,16 @@ static const struct rte_cryptodev_capabilities otx_asym_capabilities[] = {
},
}
},
+ { /* ECPM */
+ .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
+ {.asym = {
+ .xform_capa = {
+ .xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM,
+ .op_types = 0
+ }
+ },
+ }
+ },
/* End of asymmetric capabilities */
RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index f97ce3a..d7f3d08 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -443,6 +443,13 @@ otx_cpt_enq_single_asym(struct cpt_instance *instance,
if (unlikely(ret))
goto req_fail;
break;
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
+ ret = cpt_ecpm_prep(&asym_op->ecpm, ¶ms,
+ sess->ec_ctx.curveid);
+ if (unlikely(ret))
+ goto req_fail;
+ break;
+
default:
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
ret = -EINVAL;
@@ -704,6 +711,19 @@ otx_cpt_asym_dequeue_ecdsa_op(struct rte_crypto_ecdsa_op_param *ecdsa,
ecdsa->s.length = prime_len;
}
+static __rte_always_inline void
+otx_cpt_asym_dequeue_ecpm_op(struct rte_crypto_ecpm_op_param *ecpm,
+ struct cpt_request_info *req,
+ struct cpt_asym_ec_ctx *ec)
+{
+ int prime_len = ec_grp[ec->curveid].prime.length;
+
+ memcpy(ecpm->r.x.data, req->rptr, prime_len);
+ memcpy(ecpm->r.y.data, req->rptr + ROUNDUP8(prime_len), prime_len);
+ ecpm->r.x.length = prime_len;
+ ecpm->r.y.length = prime_len;
+}
+
static __rte_always_inline void __hot
otx_cpt_asym_post_process(struct rte_crypto_op *cop,
struct cpt_request_info *req)
@@ -726,6 +746,9 @@ otx_cpt_asym_post_process(struct rte_crypto_op *cop,
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
otx_cpt_asym_dequeue_ecdsa_op(&op->ecdsa, req, &sess->ec_ctx);
break;
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
+ otx_cpt_asym_dequeue_ecpm_op(&op->ecpm, req, &sess->ec_ctx);
+ break;
default:
CPT_LOG_DP_DEBUG("Invalid crypto xform type");
cop->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH v2 3/4] crypto/octeontx2: add ECPM support
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 1/4] cryptodev: support ECPM Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 2/4] crypto/octeontx: add ECPM support Anoob Joseph
@ 2020-01-15 12:56 ` Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 4/4] app/test: add ECPM tests Anoob Joseph
2020-01-15 15:49 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Akhil Goyal
4 siblings, 0 replies; 14+ messages in thread
From: Anoob Joseph @ 2020-01-15 12:56 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Sunila Sahu, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, dev, Anoob Joseph,
Balakrishna Bhamidipati
From: Sunila Sahu <ssahu@marvell.com>
Add support asymmetric operation EC Point MUltiplication,
in crypto_octeontx2 PMD.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
doc/guides/cryptodevs/features/octeontx2.ini | 1 +
.../crypto/octeontx2/otx2_cryptodev_capabilities.c | 10 ++++++++++
drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 22 ++++++++++++++++++++++
3 files changed, 33 insertions(+)
diff --git a/doc/guides/cryptodevs/features/octeontx2.ini b/doc/guides/cryptodevs/features/octeontx2.ini
index dd6369b..4693458 100644
--- a/doc/guides/cryptodevs/features/octeontx2.ini
+++ b/doc/guides/cryptodevs/features/octeontx2.ini
@@ -73,3 +73,4 @@ Modular Exponentiation = Y
Modular Inversion =
Diffie-hellman =
ECDSA = Y
+ECPM = Y
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
index f2079e2..83f885c 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
@@ -639,6 +639,16 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = {
},
}
},
+ { /* ECPM */
+ .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
+ {.asym = {
+ .xform_capa = {
+ .xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM,
+ .op_types = 0
+ }
+ },
+ }
+ },
/* End of asymmetric capabilities */
RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 17c755d..ec0e58d 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -447,6 +447,12 @@ otx2_cpt_enqueue_asym(struct otx2_cpt_qp *qp,
if (unlikely(ret))
goto req_fail;
break;
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
+ ret = cpt_ecpm_prep(&asym_op->ecpm, ¶ms,
+ sess->ec_ctx.curveid);
+ if (unlikely(ret))
+ goto req_fail;
+ break;
default:
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
ret = -EINVAL;
@@ -665,6 +671,19 @@ otx2_cpt_asym_dequeue_ecdsa_op(struct rte_crypto_ecdsa_op_param *ecdsa,
ecdsa->s.length = prime_len;
}
+static __rte_always_inline void
+otx2_cpt_asym_dequeue_ecpm_op(struct rte_crypto_ecpm_op_param *ecpm,
+ struct cpt_request_info *req,
+ struct cpt_asym_ec_ctx *ec)
+{
+ int prime_len = ec_grp[ec->curveid].prime.length;
+
+ memcpy(ecpm->r.x.data, req->rptr, prime_len);
+ memcpy(ecpm->r.y.data, req->rptr + ROUNDUP8(prime_len), prime_len);
+ ecpm->r.x.length = prime_len;
+ ecpm->r.y.length = prime_len;
+}
+
static void
otx2_cpt_asym_post_process(struct rte_crypto_op *cop,
struct cpt_request_info *req)
@@ -687,6 +706,9 @@ otx2_cpt_asym_post_process(struct rte_crypto_op *cop,
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
otx2_cpt_asym_dequeue_ecdsa_op(&op->ecdsa, req, &sess->ec_ctx);
break;
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
+ otx2_cpt_asym_dequeue_ecpm_op(&op->ecpm, req, &sess->ec_ctx);
+ break;
default:
CPT_LOG_DP_DEBUG("Invalid crypto xform type");
cop->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH v2 4/4] app/test: add ECPM tests
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
` (2 preceding siblings ...)
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 3/4] crypto/octeontx2: " Anoob Joseph
@ 2020-01-15 12:56 ` Anoob Joseph
2020-01-15 15:49 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Akhil Goyal
4 siblings, 0 replies; 14+ messages in thread
From: Anoob Joseph @ 2020-01-15 12:56 UTC (permalink / raw)
To: Akhil Goyal, Declan Doherty, Pablo de Lara
Cc: Sunila Sahu, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, dev, Anoob Joseph
From: Sunila Sahu <ssahu@marvell.com>
Add test vectors and verify routines for asymmetric operation, EC Point
Multiplication.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
app/test/test_cryptodev_asym.c | 176 ++++++++++++++
app/test/test_cryptodev_asym_util.h | 11 +
app/test/test_cryptodev_ecpm_test_vectors.h | 353 ++++++++++++++++++++++++++++
3 files changed, 540 insertions(+)
create mode 100644 app/test/test_cryptodev_ecpm_test_vectors.h
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 08479bb..b8e0500 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -19,6 +19,7 @@
#include "test_cryptodev_dh_test_vectors.h"
#include "test_cryptodev_dsa_test_vectors.h"
#include "test_cryptodev_ecdsa_test_vectors.h"
+#include "test_cryptodev_ecpm_test_vectors.h"
#include "test_cryptodev_mod_test_vectors.h"
#include "test_cryptodev_rsa_test_vectors.h"
#include "test_cryptodev_asym_util.h"
@@ -1044,6 +1045,7 @@ static inline void print_asym_capa(
capa->modlen.increment);
break;
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
default:
break;
}
@@ -2108,6 +2110,179 @@ test_ecdsa_sign_verify_all_curve(void)
return overall_status;
}
+static int
+test_ecpm(enum curve curve_id)
+{
+ struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct rte_mempool *sess_mpool = ts_params->session_mpool;
+ struct rte_mempool *op_mpool = ts_params->op_mpool;
+ struct crypto_testsuite_ecpm_params input_params;
+ struct rte_cryptodev_asym_session *sess = NULL;
+ uint8_t dev_id = ts_params->valid_devs[0];
+ struct rte_crypto_op *result_op = NULL;
+ uint8_t output_buf_x[TEST_DATA_SIZE];
+ uint8_t output_buf_y[TEST_DATA_SIZE];
+ struct rte_crypto_asym_xform xform;
+ struct rte_crypto_asym_op *asym_op;
+ struct rte_cryptodev_info dev_info;
+ struct rte_crypto_op *op = NULL;
+ int status = TEST_SUCCESS, ret;
+
+ switch (curve_id) {
+ case SECP192R1:
+ input_params = ecpm_param_secp192r1;
+ break;
+ case SECP224R1:
+ input_params = ecpm_param_secp224r1;
+ break;
+ case SECP256R1:
+ input_params = ecpm_param_secp256r1;
+ break;
+ case SECP384R1:
+ input_params = ecpm_param_secp384r1;
+ break;
+ case SECP521R1:
+ input_params = ecpm_param_secp521r1;
+ break;
+ default:
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Unsupported curve id\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ rte_cryptodev_info_get(dev_id, &dev_info);
+
+ sess = rte_cryptodev_asym_session_create(sess_mpool);
+ if (sess == NULL) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Session creation failed\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Setup crypto op data structure */
+ op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
+ if (op == NULL) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Failed to allocate asymmetric crypto "
+ "operation struct\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+ asym_op = op->asym;
+
+ /* Setup asym xform */
+ xform.next = NULL;
+ xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
+ xform.ec.curve_id = input_params.curve;
+
+ if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
+ sess_mpool) < 0) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Unable to config asym session\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Attach asymmetric crypto session to crypto operations */
+ rte_crypto_op_attach_asym_session(op, sess);
+
+ /* Populate op with operational details */
+ op->asym->ecpm.p.x.data = input_params.gen_x.data;
+ op->asym->ecpm.p.x.length = input_params.gen_x.length;
+ op->asym->ecpm.p.y.data = input_params.gen_y.data;
+ op->asym->ecpm.p.y.length = input_params.gen_y.length;
+ op->asym->ecpm.scalar.data = input_params.privkey.data;
+ op->asym->ecpm.scalar.length = input_params.privkey.length;
+
+ /* Init out buf */
+ op->asym->ecpm.r.x.data = output_buf_x;
+ op->asym->ecpm.r.y.data = output_buf_y;
+
+ RTE_LOG(DEBUG, USER1, "Process ASYM operation\n");
+
+ /* Process crypto operation */
+ if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Error sending packet for operation\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) == 0)
+ rte_pause();
+
+ if (result_op == NULL) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Failed to process asym crypto op\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ if (result_op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "Failed to process asym crypto op\n");
+ status = TEST_FAILED;
+ goto exit;
+ }
+
+ asym_op = result_op->asym;
+
+ debug_hexdump(stdout, "r x:",
+ asym_op->ecpm.r.x.data, asym_op->ecpm.r.x.length);
+ debug_hexdump(stdout, "r y:",
+ asym_op->ecpm.r.y.data, asym_op->ecpm.r.y.length);
+
+ ret = verify_ecpm(input_params.pubkey_x.data,
+ input_params.pubkey_y.data, result_op);
+ if (ret) {
+ status = TEST_FAILED;
+ RTE_LOG(ERR, USER1,
+ "line %u FAILED: %s", __LINE__,
+ "EC Point Multiplication failed.\n");
+ goto exit;
+ }
+
+exit:
+ if (sess != NULL) {
+ rte_cryptodev_asym_session_clear(dev_id, sess);
+ rte_cryptodev_asym_session_free(sess);
+ }
+ if (op != NULL)
+ rte_crypto_op_free(op);
+ return status;
+}
+
+static int
+test_ecpm_all_curve(void)
+{
+ int status, overall_status = TEST_SUCCESS;
+ enum curve curve_id;
+ int test_index = 0;
+ const char *msg;
+
+ for (curve_id = SECP192R1; curve_id < END_OF_CURVE_LIST; curve_id++) {
+ status = test_ecpm(curve_id);
+ if (status == TEST_SUCCESS) {
+ msg = "succeeded";
+ } else {
+ msg = "failed";
+ overall_status = status;
+ }
+ printf(" %u) TestCase EC Point Mul Curve %s %s\n",
+ test_index ++, curve[curve_id], msg);
+ }
+ return overall_status;
+}
+
static struct unit_test_suite cryptodev_openssl_asym_testsuite = {
.suite_name = "Crypto Device OPENSSL ASYM Unit Test Suite",
.setup = testsuite_setup,
@@ -2148,6 +2323,7 @@ static struct unit_test_suite cryptodev_octeontx_asym_testsuite = {
TEST_CASE_ST(ut_setup, ut_teardown, test_mod_exp),
TEST_CASE_ST(ut_setup, ut_teardown,
test_ecdsa_sign_verify_all_curve),
+ TEST_CASE_ST(ut_setup, ut_teardown, test_ecpm_all_curve),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
diff --git a/app/test/test_cryptodev_asym_util.h b/app/test/test_cryptodev_asym_util.h
index bddeda0..83dc265 100644
--- a/app/test/test_cryptodev_asym_util.h
+++ b/app/test/test_cryptodev_asym_util.h
@@ -46,4 +46,15 @@ static inline int verify_ecdsa_sign(uint8_t *sign_r,
return 0;
}
+static inline int verify_ecpm(uint8_t *result_x, uint8_t *result_y,
+ struct rte_crypto_op *result_op)
+{
+ if (memcmp(result_x, result_op->asym->ecpm.r.x.data,
+ result_op->asym->ecpm.r.x.length) ||
+ memcmp(result_y, result_op->asym->ecpm.r.y.data,
+ result_op->asym->ecpm.r.y.length))
+ return -1;
+
+ return 0;
+}
#endif /* TEST_CRYPTODEV_ASYM_TEST_UTIL_H__ */
diff --git a/app/test/test_cryptodev_ecpm_test_vectors.h b/app/test/test_cryptodev_ecpm_test_vectors.h
new file mode 100644
index 0000000..ade106c
--- /dev/null
+++ b/app/test/test_cryptodev_ecpm_test_vectors.h
@@ -0,0 +1,353 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef __TEST_CRYPTODEV_ECPM_TEST_VECTORS_H__
+#define __TEST_CRYPTODEV_ECPM_TEST_VECTORS_H__
+
+#include "rte_crypto_asym.h"
+
+struct crypto_testsuite_ecpm_params {
+ rte_crypto_param gen_x;
+ rte_crypto_param gen_y;
+ rte_crypto_param privkey;
+ rte_crypto_param pubkey_x;
+ rte_crypto_param pubkey_y;
+ int curve;
+};
+
+/* SECP192R1 (P-192 NIST) test vectors */
+
+static uint8_t gen_x_secp192r1[] = {
+ 0x18, 0x8d, 0xa8, 0x0e, 0xb0, 0x30, 0x90, 0xf6,
+ 0x7c, 0xbf, 0x20, 0xeb, 0x43, 0xa1, 0x88, 0x00,
+ 0xf4, 0xff, 0x0a, 0xfd, 0x82, 0xff, 0x10, 0x12
+};
+
+static uint8_t gen_y_secp192r1[] = {
+ 0x07, 0x19, 0x2b, 0x95, 0xff, 0xc8, 0xda, 0x78,
+ 0x63, 0x10, 0x11, 0xed, 0x6b, 0x24, 0xcd, 0xd5,
+ 0x73, 0xf9, 0x77, 0xa1, 0x1e, 0x79, 0x48, 0x11
+};
+
+static uint8_t privkey_secp192r1[] = {
+ 0x24, 0xed, 0xd2, 0x2f, 0x7d, 0xdd, 0x6f, 0xa5,
+ 0xbc, 0x61, 0xfc, 0x06, 0x53, 0x47, 0x9a, 0xa4,
+ 0x08, 0x09, 0xef, 0x86, 0x5c, 0xf2, 0x7a, 0x47
+};
+static uint8_t pubkey_x_secp192r1[] = {
+ 0x9b, 0xf1, 0x2d, 0x71, 0x74, 0xb7, 0x70, 0x8a,
+ 0x07, 0x6a, 0x38, 0xbc, 0x80, 0xaa, 0x28, 0x66,
+ 0x2f, 0x25, 0x1e, 0x2e, 0xd8, 0xd4, 0x14, 0xdc
+};
+
+static uint8_t pubkey_y_secp192r1[] = {
+ 0x48, 0x54, 0xc8, 0xd0, 0x7d, 0xfc, 0x08, 0x82,
+ 0x4e, 0x9e, 0x47, 0x1c, 0xa2, 0xfe, 0xdc, 0xfc,
+ 0xff, 0x3d, 0xdc, 0xb0, 0x11, 0x57, 0x34, 0x98
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_secp192r1 = {
+ .gen_x = {
+ .data = gen_x_secp192r1,
+ .length = sizeof(gen_x_secp192r1),
+ },
+ .gen_y = {
+ .data = gen_y_secp192r1,
+ .length = sizeof(gen_y_secp192r1),
+ },
+ .privkey = {
+ .data = privkey_secp192r1,
+ .length = sizeof(privkey_secp192r1),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_secp192r1,
+ .length = sizeof(pubkey_x_secp192r1),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_secp192r1,
+ .length = sizeof(pubkey_y_secp192r1),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_SECP192R1
+};
+
+/* SECP224R1 (P-224 NIST) test vectors */
+
+static uint8_t gen_x_secp224r1[] = {
+ 0xb7, 0x0e, 0x0c, 0xbd, 0x6b, 0xb4, 0xbf, 0x7f,
+ 0x32, 0x13, 0x90, 0xb9, 0x4a, 0x03, 0xc1, 0xd3,
+ 0x56, 0xc2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xd6,
+ 0x11, 0x5c, 0x1d, 0x21
+};
+
+static uint8_t gen_y_secp224r1[] = {
+ 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb,
+ 0x4c, 0x22, 0xdf, 0xe6, 0xcd, 0x43, 0x75, 0xa0,
+ 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99,
+ 0x85, 0x00, 0x7e, 0x34
+};
+
+static uint8_t privkey_secp224r1[] = {
+ 0x88, 0x8f, 0xc9, 0x92, 0x89, 0x3b, 0xdd, 0x8a,
+ 0xa0, 0x2c, 0x80, 0x76, 0x88, 0x32, 0x60, 0x5d,
+ 0x02, 0x0b, 0x81, 0xae, 0x0b, 0x25, 0x47, 0x41,
+ 0x54, 0xec, 0x89, 0xaa
+};
+
+static uint8_t pubkey_x_secp224r1[] = {
+ 0x4c, 0x74, 0x1e, 0x4d, 0x20, 0x10, 0x36, 0x70,
+ 0xb7, 0x16, 0x1a, 0xe7, 0x22, 0x71, 0x08, 0x21,
+ 0x55, 0x83, 0x84, 0x18, 0x08, 0x43, 0x35, 0x33,
+ 0x8a, 0xc3, 0x8f, 0xa4
+};
+
+static uint8_t pubkey_y_secp224r1[] = {
+ 0xdb, 0x79, 0x19, 0x15, 0x1a, 0xc2, 0x85, 0x87,
+ 0xb7, 0x2b, 0xad, 0x7a, 0xb1, 0x80, 0xec, 0x8e,
+ 0x95, 0xab, 0x9e, 0x2c, 0x8d, 0x81, 0xd9, 0xb9,
+ 0xd7, 0xe2, 0xe3, 0x83
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_secp224r1 = {
+ .gen_x = {
+ .data = gen_x_secp224r1,
+ .length = sizeof(gen_x_secp224r1),
+ },
+ .gen_y = {
+ .data = gen_y_secp224r1,
+ .length = sizeof(gen_y_secp224r1),
+ },
+ .privkey = {
+ .data = privkey_secp224r1,
+ .length = sizeof(privkey_secp224r1),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_secp224r1,
+ .length = sizeof(pubkey_x_secp224r1),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_secp224r1,
+ .length = sizeof(pubkey_y_secp224r1),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_SECP224R1
+};
+
+/* SECP256R1 (P-256 NIST) test vectors */
+
+static uint8_t gen_x_secp256r1[] = {
+ 0x6b, 0x17, 0xd1, 0xf2, 0xe1, 0x2c, 0x42, 0x47,
+ 0xf8, 0xbc, 0xe6, 0xe5, 0x63, 0xa4, 0x40, 0xf2,
+ 0x77, 0x03, 0x7d, 0x81, 0x2d, 0xeb, 0x33, 0xa0,
+ 0xf4, 0xa1, 0x39, 0x45, 0xd8, 0x98, 0xc2, 0x96
+};
+
+static uint8_t gen_y_secp256r1[] = {
+ 0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f, 0x9b,
+ 0x8e, 0xe7, 0xeb, 0x4a, 0x7c, 0x0f, 0x9e, 0x16,
+ 0x2b, 0xce, 0x33, 0x57, 0x6b, 0x31, 0x5e, 0xce,
+ 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 0xf5
+};
+
+static uint8_t pubkey_x_secp256r1[] = {
+ 0x06, 0x27, 0x5d, 0x38, 0x7b, 0x8f, 0xcd, 0x29,
+ 0x12, 0x02, 0xa5, 0xad, 0x72, 0x35, 0x55, 0xd4,
+ 0xe1, 0xca, 0xd6, 0x32, 0x91, 0xe7, 0x8c, 0xb7,
+ 0xf9, 0x85, 0xfe, 0xb5, 0xca, 0x61, 0xfd, 0xa7,
+};
+
+static uint8_t pubkey_y_secp256r1[] = {
+ 0x6d, 0x28, 0x17, 0x9c, 0x88, 0x2a, 0x06, 0x8c,
+ 0x85, 0x52, 0x44, 0xc1, 0x2f, 0xf6, 0x45, 0x80,
+ 0x63, 0x1c, 0x52, 0xe4, 0xa5, 0xf8, 0x21, 0x43,
+ 0xec, 0xeb, 0xe2, 0xbb, 0x39, 0xff, 0x1f, 0xd8
+};
+
+static uint8_t privkey_secp256r1[] = {
+ 0x36, 0xf7, 0xe3, 0x07, 0x84, 0xfa, 0xb5, 0x8d,
+ 0x8d, 0x1d, 0x00, 0x21, 0x8b, 0x59, 0xd1, 0x70,
+ 0x14, 0x94, 0x86, 0x69, 0xec, 0xd3, 0x99, 0xc8,
+ 0x7a, 0xf0, 0x2d, 0x05, 0xbf, 0x16, 0xed, 0x36
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_secp256r1 = {
+ .gen_x = {
+ .data = gen_x_secp256r1,
+ .length = sizeof(gen_x_secp256r1),
+ },
+ .gen_y = {
+ .data = gen_y_secp256r1,
+ .length = sizeof(gen_y_secp256r1),
+ },
+ .privkey = {
+ .data = privkey_secp256r1,
+ .length = sizeof(privkey_secp256r1),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_secp256r1,
+ .length = sizeof(pubkey_x_secp256r1),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_secp256r1,
+ .length = sizeof(pubkey_y_secp256r1),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_SECP256R1
+};
+
+/* SECP384R1 (P-384 NIST) test vectors */
+
+static uint8_t gen_x_secp384r1[] = {
+ 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
+};
+
+static uint8_t gen_y_secp384r1[] = {
+ 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
+};
+
+static uint8_t privkey_secp384r1[] = {
+ 0xc6, 0x02, 0xbc, 0x74, 0xa3, 0x45, 0x92, 0xc3,
+ 0x11, 0xa6, 0x56, 0x96, 0x61, 0xe0, 0x83, 0x2c,
+ 0x84, 0xf7, 0x20, 0x72, 0x74, 0x67, 0x6c, 0xc4,
+ 0x2a, 0x89, 0xf0, 0x58, 0x16, 0x26, 0x30, 0x18,
+ 0x4b, 0x52, 0xf0, 0xd9, 0x9b, 0x85, 0x5a, 0x77,
+ 0x83, 0xc9, 0x87, 0x47, 0x6d, 0x7f, 0x9e, 0x6b
+};
+
+static uint8_t pubkey_x_secp384r1[] = {
+ 0x04, 0x00, 0x19, 0x3b, 0x21, 0xf0, 0x7c, 0xd0,
+ 0x59, 0x82, 0x6e, 0x94, 0x53, 0xd3, 0xe9, 0x6d,
+ 0xd1, 0x45, 0x04, 0x1c, 0x97, 0xd4, 0x9f, 0xf6,
+ 0xb7, 0x04, 0x7f, 0x86, 0xbb, 0x0b, 0x04, 0x39,
+ 0xe9, 0x09, 0x27, 0x4c, 0xb9, 0xc2, 0x82, 0xbf,
+ 0xab, 0x88, 0x67, 0x4c, 0x07, 0x65, 0xbc, 0x75
+};
+
+static uint8_t pubkey_y_secp384r1[] = {
+ 0xf7, 0x0d, 0x89, 0xc5, 0x2a, 0xcb, 0xc7, 0x04,
+ 0x68, 0xd2, 0xc5, 0xae, 0x75, 0xc7, 0x6d, 0x7f,
+ 0x69, 0xb7, 0x6a, 0xf6, 0x2d, 0xcf, 0x95, 0xe9,
+ 0x9e, 0xba, 0x5d, 0xd1, 0x1a, 0xdf, 0x8f, 0x42,
+ 0xec, 0x9a, 0x42, 0x5b, 0x0c, 0x5e, 0xc9, 0x8e,
+ 0x2f, 0x23, 0x4a, 0x92, 0x6b, 0x82, 0xa1, 0x47
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_secp384r1 = {
+ .gen_x = {
+ .data = gen_x_secp384r1,
+ .length = sizeof(gen_x_secp384r1),
+ },
+ .gen_y = {
+ .data = gen_y_secp384r1,
+ .length = sizeof(gen_y_secp384r1),
+ },
+ .privkey = {
+ .data = privkey_secp384r1,
+ .length = sizeof(privkey_secp384r1),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_secp384r1,
+ .length = sizeof(pubkey_x_secp384r1),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_secp384r1,
+ .length = sizeof(pubkey_y_secp384r1),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_SECP384R1
+};
+
+/* SECP521R1 (P-521 NIST) test vectors */
+
+static uint8_t gen_x_secp521r1[] = {
+ 0xc6, 0x85, 0x8e, 0x06, 0xb7, 0x04, 0x04,
+ 0xe9, 0xcd, 0x9e, 0x3e, 0xcb, 0x66, 0x23, 0x95,
+ 0xb4, 0x42, 0x9c, 0x64, 0x81, 0x39, 0x05, 0x3f,
+ 0xb5, 0x21, 0xf8, 0x28, 0xaf, 0x60, 0x6b, 0x4d,
+ 0x3d, 0xba, 0xa1, 0x4b, 0x5e, 0x77, 0xef, 0xe7,
+ 0x59, 0x28, 0xfe, 0x1d, 0xc1, 0x27, 0xa2, 0xff,
+ 0xa8, 0xde, 0x33, 0x48, 0xb3, 0xc1, 0x85, 0x6a,
+ 0x42, 0x9b, 0xf9, 0x7e, 0x7e, 0x31, 0xc2, 0xe5,
+ 0xbd, 0x66
+};
+
+static uint8_t gen_y_secp521r1[] = {
+ 0x01, 0x18, 0x39, 0x29, 0x6a, 0x78, 0x9a, 0x3b,
+ 0xc0, 0x04, 0x5c, 0x8a, 0x5f, 0xb4, 0x2c, 0x7d,
+ 0x1b, 0xd9, 0x98, 0xf5, 0x44, 0x49, 0x57, 0x9b,
+ 0x44, 0x68, 0x17, 0xaf, 0xbd, 0x17, 0x27, 0x3e,
+ 0x66, 0x2c, 0x97, 0xee, 0x72, 0x99, 0x5e, 0xf4,
+ 0x26, 0x40, 0xc5, 0x50, 0xb9, 0x01, 0x3f, 0xad,
+ 0x07, 0x61, 0x35, 0x3c, 0x70, 0x86, 0xa2, 0x72,
+ 0xc2, 0x40, 0x88, 0xbe, 0x94, 0x76, 0x9f, 0xd1,
+ 0x66, 0x50
+};
+
+static uint8_t privkey_secp521r1[] = {
+ 0x01, 0xe8, 0xc0, 0x59, 0x96, 0xb8, 0x5e, 0x6f,
+ 0x3f, 0x87, 0x57, 0x12, 0xa0, 0x9c, 0x1b, 0x40,
+ 0x67, 0x2b, 0x5e, 0x7a, 0x78, 0xd5, 0x85, 0x2d,
+ 0xe0, 0x15, 0x85, 0xc5, 0xfb, 0x99, 0x0b, 0xf3,
+ 0x81, 0x2c, 0x32, 0x45, 0x53, 0x4a, 0x71, 0x43,
+ 0x89, 0xae, 0x90, 0x14, 0xd6, 0x77, 0xa4, 0x49,
+ 0xef, 0xd6, 0x58, 0x25, 0x4e, 0x61, 0x0d, 0xa8,
+ 0xe6, 0xca, 0xd3, 0x34, 0x14, 0xb9, 0xd3, 0x3e,
+ 0x0d, 0x7a
+};
+
+static uint8_t pubkey_x_secp521r1[] = {
+ 0x00, 0x7d, 0x04, 0x2c, 0xa1, 0x94, 0x08, 0x52,
+ 0x4e, 0x68, 0xb9, 0x81, 0xf1, 0x41, 0x93, 0x51,
+ 0xe3, 0xb8, 0x47, 0x36, 0xc7, 0x7f, 0xe5, 0x8f,
+ 0xee, 0x7d, 0x11, 0x31, 0x7d, 0xf2, 0xe8, 0x50,
+ 0xd9, 0x60, 0xc7, 0xdd, 0x10, 0xd1, 0x0b, 0xa7,
+ 0x14, 0xc8, 0xa6, 0x09, 0xd1, 0x63, 0x50, 0x2b,
+ 0x79, 0xd6, 0x82, 0xe8, 0xbb, 0xec, 0xd4, 0xf5,
+ 0x25, 0x91, 0xd2, 0x74, 0x85, 0x33, 0xe4, 0x5a,
+ 0x86, 0x7a
+};
+
+static uint8_t pubkey_y_secp521r1[] = {
+ 0x01, 0x97, 0xac, 0x64, 0x16, 0x11, 0x1c, 0xcf,
+ 0x98, 0x7d, 0x29, 0x04, 0x59, 0xeb, 0xc8, 0xad,
+ 0x9e, 0xc5, 0x6e, 0x49, 0x05, 0x9c, 0x99, 0x21,
+ 0x55, 0x53, 0x9a, 0x36, 0xa6, 0x26, 0x63, 0x1f,
+ 0x4a, 0x2d, 0x89, 0x16, 0x4b, 0x98, 0x51, 0x54,
+ 0xf2, 0xdd, 0xdc, 0x02, 0x81, 0xee, 0x5b, 0x51,
+ 0x78, 0x27, 0x1f, 0x3a, 0x76, 0xa0, 0x91, 0x4c,
+ 0x3f, 0xcd, 0x1f, 0x97, 0xbe, 0x8e, 0x83, 0x76,
+ 0xef, 0xb3
+};
+
+struct crypto_testsuite_ecpm_params ecpm_param_secp521r1 = {
+ .gen_x = {
+ .data = gen_x_secp521r1,
+ .length = sizeof(gen_x_secp521r1),
+ },
+ .gen_y = {
+ .data = gen_y_secp521r1,
+ .length = sizeof(gen_y_secp521r1),
+ },
+ .privkey = {
+ .data = privkey_secp521r1,
+ .length = sizeof(privkey_secp521r1),
+ },
+ .pubkey_x = {
+ .data = pubkey_x_secp521r1,
+ .length = sizeof(pubkey_x_secp521r1),
+ },
+ .pubkey_y = {
+ .data = pubkey_y_secp521r1,
+ .length = sizeof(pubkey_y_secp521r1),
+ },
+ .curve = RTE_CRYPTO_EC_GROUP_SECP521R1
+};
+
+#endif /* __TEST_CRYPTODEV_ECPM_TEST_VECTORS_H__ */
--
2.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/4] add ECPM support
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
` (3 preceding siblings ...)
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 4/4] app/test: add ECPM tests Anoob Joseph
@ 2020-01-15 15:49 ` Akhil Goyal
4 siblings, 0 replies; 14+ messages in thread
From: Akhil Goyal @ 2020-01-15 15:49 UTC (permalink / raw)
To: Anoob Joseph, Declan Doherty, Pablo de Lara
Cc: Fiona Trahe, Arek Kusztal, Jerin Jacob, Narayana Prasad,
Shally Verma, Ankur Dwivedi, Sunila Sahu, dev
> This series adds support for ECPM (Elliptic Curve Point Multiplication)
> asymmetric operations. Library changes and PMD changes for
> crypto_octeontx & crypto_octeontx2 is added. The final patch adds
> the required test vectors and verification routines.
>
> v2:
> * Made all references to point multiplication operation as ECPM.
> * Changed all NIST references to use SECP.
> * Updated release notes
>
> Balakrishna Bhamidipati (1):
> cryptodev: support ECPM
>
> Sunila Sahu (3):
> crypto/octeontx: add ECPM support
> crypto/octeontx2: add ECPM support
> app/test: add ECPM tests
>
> app/test/test_cryptodev_asym.c | 176 ++++++++++
> app/test/test_cryptodev_asym_util.h | 11 +
> app/test/test_cryptodev_ecpm_test_vectors.h | 353
> +++++++++++++++++++++
> doc/guides/cryptodevs/features/default.ini | 1 +
> doc/guides/cryptodevs/features/octeontx.ini | 1 +
> doc/guides/cryptodevs/features/octeontx2.ini | 1 +
> doc/guides/rel_notes/release_20_02.rst | 5 +
> drivers/common/cpt/cpt_mcode_defines.h | 2 +
> drivers/common/cpt/cpt_ucode_asym.h | 85 +++++
> .../crypto/octeontx/otx_cryptodev_capabilities.c | 10 +
> drivers/crypto/octeontx/otx_cryptodev_ops.c | 23 ++
> .../crypto/octeontx2/otx2_cryptodev_capabilities.c | 10 +
> drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 22 ++
> lib/librte_cryptodev/rte_crypto_asym.h | 17 +
> lib/librte_cryptodev/rte_cryptodev.c | 1 +
> 15 files changed, 718 insertions(+)
> create mode 100644 app/test/test_cryptodev_ecpm_test_vectors.h
>
Series Applied to dpdk-next-crypto
Thanks,
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] cryptodev: support ECPM
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 1/4] cryptodev: support ECPM Anoob Joseph
@ 2020-01-15 15:49 ` Akhil Goyal
0 siblings, 0 replies; 14+ messages in thread
From: Akhil Goyal @ 2020-01-15 15:49 UTC (permalink / raw)
To: Anoob Joseph, Declan Doherty, Pablo de Lara
Cc: Balakrishna Bhamidipati, Fiona Trahe, Arek Kusztal, Jerin Jacob,
Narayana Prasad, Shally Verma, Ankur Dwivedi, Sunila Sahu, dev
> From: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
>
> Asymmetric crypto library is extended to add ECPM (Elliptic Curve Point
> Multiplication). The required xform type and op parameters are
> introduced.
>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
> Signed-off-by: Sunila Sahu <ssahu@marvell.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2020-01-15 15:49 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 15:37 [dpdk-dev] [PATCH 0/4] add ECPM support Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication Anoob Joseph
2020-01-13 12:43 ` Akhil Goyal
2020-01-14 6:44 ` Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 2/4] crypto/octeontx: add EC Point Mul support Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 3/4] crypto/octeontx2: " Anoob Joseph
2019-12-05 15:38 ` [dpdk-dev] [PATCH 4/4] app/test: add EC point multiplication test Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 1/4] cryptodev: support ECPM Anoob Joseph
2020-01-15 15:49 ` Akhil Goyal
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 2/4] crypto/octeontx: add ECPM support Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 3/4] crypto/octeontx2: " Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 4/4] app/test: add ECPM tests Anoob Joseph
2020-01-15 15:49 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).