DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
@ 2024-07-22 14:55 Gowrishankar Muthukrishnan
  2024-07-24  5:10 ` Anoob Joseph
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Gowrishankar Muthukrishnan @ 2024-07-22 14:55 UTC (permalink / raw)
  To: dev, Anoob Joseph, bruce.richardson, ciara.power, jerinj,
	fanzhang.oss, arkadiuszx.kusztal, kai.ji, jack.bond-preston,
	david.marchand, hemant.agrawal, pablo.de.lara.guarch,
	fiona.trahe, declan.doherty, matan, ruifeng.wang,
	abhinandan.gujjar, maxime.coquelin, chenbox,
	sunilprakashrao.uttarwar, andrew.boyer, ajit.khaparde,
	raveendra.padasalagi, vikas.gupta, zhangfei.gao, g.singh,
	jianjay.zhou, lee.daly
  Cc: Gowrishankar Muthukrishnan

Announce cryptodev changes to offload RSA asymmetric operation in
VirtIO PMD.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
--
RFC:
  https://patches.dpdk.org/project/dpdk/patch/20230928095300.1353-2-gmuthukrishn@marvell.com/
  https://patches.dpdk.org/project/dpdk/patch/20230928095300.1353-3-gmuthukrishn@marvell.com/
---
 doc/guides/rel_notes/deprecation.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 6948641ff6..26fec84aba 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -147,3 +147,14 @@ Deprecation Notices
   will be deprecated and subsequently removed in DPDK 24.11 release.
   Before this, the new port library API (functions rte_swx_port_*)
   will gradually transition from experimental to stable status.
+
+* cryptodev: The struct rte_crypto_rsa_padding will be moved from
+  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform struct,
+  breaking ABI. The new location is recommended to comply with
+  virtio-crypto specification. Applications and drivers using
+  this struct will be updated.
+
+* cryptodev: The rte_crypto_rsa_xform struct member to hold private key
+  in either exponent or quintuple format is changed from union to struct
+  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix A.1.2).
+  This change will not break existing applications.
-- 
2.21.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-22 14:55 [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO Gowrishankar Muthukrishnan
@ 2024-07-24  5:10 ` Anoob Joseph
  2024-07-24  6:49 ` [EXTERNAL] " Akhil Goyal
  2024-07-25  9:48 ` Kusztal, ArkadiuszX
  2 siblings, 0 replies; 11+ messages in thread
From: Anoob Joseph @ 2024-07-24  5:10 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan, dev, bruce.richardson, ciara.power,
	Jerin Jacob, fanzhang.oss, arkadiuszx.kusztal, kai.ji,
	jack.bond-preston, david.marchand, hemant.agrawal,
	pablo.de.lara.guarch, fiona.trahe, declan.doherty, matan,
	ruifeng.wang, abhinandan.gujjar, maxime.coquelin, chenbox,
	sunilprakashrao.uttarwar, andrew.boyer, ajit.khaparde,
	raveendra.padasalagi, vikas.gupta, zhangfei.gao, g.singh,
	jianjay.zhou, lee.daly
  Cc: Gowrishankar Muthukrishnan

> Subject: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
> 
> Announce cryptodev changes to offload RSA asymmetric operation in VirtIO
> PMD.
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>

Acked-by: Anoob Joseph <anoobj@marvell.com>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [EXTERNAL] [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-22 14:55 [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO Gowrishankar Muthukrishnan
  2024-07-24  5:10 ` Anoob Joseph
@ 2024-07-24  6:49 ` Akhil Goyal
  2024-07-25  9:48 ` Kusztal, ArkadiuszX
  2 siblings, 0 replies; 11+ messages in thread
From: Akhil Goyal @ 2024-07-24  6:49 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan, dev, Anoob Joseph, bruce.richardson,
	ciara.power, Jerin Jacob, fanzhang.oss, arkadiuszx.kusztal,
	kai.ji, jack.bond-preston, david.marchand, hemant.agrawal,
	pablo.de.lara.guarch, fiona.trahe, declan.doherty, matan,
	ruifeng.wang, abhinandan.gujjar, maxime.coquelin, chenbox,
	sunilprakashrao.uttarwar, andrew.boyer, ajit.khaparde,
	raveendra.padasalagi, vikas.gupta, zhangfei.gao, g.singh,
	jianjay.zhou, lee.daly
  Cc: Gowrishankar Muthukrishnan

> Announce cryptodev changes to offload RSA asymmetric operation in
> VirtIO PMD.
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> --
> RFC:
>   https://patches.dpdk.org/project/dpdk/patch/20230928095300.1353-2-gmuthukrishn@marvell.com/
>   https://patches.dpdk.org/project/dpdk/patch/20230928095300.1353-3-gmuthukrishn@marvell.com/
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>

>  doc/guides/rel_notes/deprecation.rst | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> index 6948641ff6..26fec84aba 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -147,3 +147,14 @@ Deprecation Notices
>    will be deprecated and subsequently removed in DPDK 24.11 release.
>    Before this, the new port library API (functions rte_swx_port_*)
>    will gradually transition from experimental to stable status.
> +
> +* cryptodev: The struct rte_crypto_rsa_padding will be moved from
> +  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform struct,
> +  breaking ABI. The new location is recommended to comply with
> +  virtio-crypto specification. Applications and drivers using
> +  this struct will be updated.
> +
> +* cryptodev: The rte_crypto_rsa_xform struct member to hold private key
> +  in either exponent or quintuple format is changed from union to struct
> +  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix A.1.2).
> +  This change will not break existing applications.
> --
> 2.21.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-22 14:55 [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO Gowrishankar Muthukrishnan
  2024-07-24  5:10 ` Anoob Joseph
  2024-07-24  6:49 ` [EXTERNAL] " Akhil Goyal
@ 2024-07-25  9:48 ` Kusztal, ArkadiuszX
  2024-07-25 15:53   ` Gowrishankar Muthukrishnan
  2024-07-25 16:00   ` Gowrishankar Muthukrishnan
  2 siblings, 2 replies; 11+ messages in thread
From: Kusztal, ArkadiuszX @ 2024-07-25  9:48 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan, dev, Anoob Joseph, Richardson, Bruce,
	ciara.power, jerinj, fanzhang.oss, Ji, Kai, jack.bond-preston,
	Marchand, David, hemant.agrawal, De Lara Guarch, Pablo, Trahe,
	Fiona, Doherty, Declan, matan, ruifeng.wang, Gujjar,
	Abhinandan S, maxime.coquelin, chenbox, sunilprakashrao.uttarwar,
	andrew.boyer, ajit.khaparde, raveendra.padasalagi, vikas.gupta,
	zhangfei.gao, g.singh, jianjay.zhou, Daly, Lee

Hi Gowrishankar,

> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Sent: Monday, July 22, 2024 4:56 PM
> To: dev@dpdk.org; Anoob Joseph <anoobj@marvell.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; ciara.power@intel.com; jerinj@marvell.com;
> fanzhang.oss@gmail.com; Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>;
> Ji, Kai <kai.ji@intel.com>; jack.bond-preston@foss.arm.com; Marchand, David
> <david.marchand@redhat.com>; hemant.agrawal@nxp.com; De Lara Guarch,
> Pablo <pablo.de.lara.guarch@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Doherty, Declan <declan.doherty@intel.com>;
> matan@nvidia.com; ruifeng.wang@arm.com; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; maxime.coquelin@redhat.com;
> chenbox@nvidia.com; sunilprakashrao.uttarwar@amd.com;
> andrew.boyer@amd.com; ajit.khaparde@broadcom.com;
> raveendra.padasalagi@broadcom.com; vikas.gupta@broadcom.com;
> zhangfei.gao@linaro.org; g.singh@nxp.com; jianjay.zhou@huawei.com; Daly,
> Lee <lee.daly@intel.com>
> Cc: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Subject: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
> 
> Announce cryptodev changes to offload RSA asymmetric operation in VirtIO
> PMD.
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> --
> RFC:
>   https://patches.dpdk.org/project/dpdk/patch/20230928095300.1353-2-
> gmuthukrishn@marvell.com/
>   https://patches.dpdk.org/project/dpdk/patch/20230928095300.1353-3-
> gmuthukrishn@marvell.com/
> ---
>  doc/guides/rel_notes/deprecation.rst | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> index 6948641ff6..26fec84aba 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -147,3 +147,14 @@ Deprecation Notices
>    will be deprecated and subsequently removed in DPDK 24.11 release.
>    Before this, the new port library API (functions rte_swx_port_*)
>    will gradually transition from experimental to stable status.
> +
> +* cryptodev: The struct rte_crypto_rsa_padding will be moved from
> +  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform struct,
> +  breaking ABI. The new location is recommended to comply with
> +  virtio-crypto specification. Applications and drivers using
> +  this struct will be updated.
> +

The problem here, I see is that there is one private key but multiple combinations of padding.
Therefore, for every padding variation, we need to copy the same private key anew, duplicating it in memory.
The only reason for me to keep a session-like struct in asymmetric crypto was exactly this.

> +* cryptodev: The rte_crypto_rsa_xform struct member to hold private key
> +  in either exponent or quintuple format is changed from union to
> +struct
> +  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix A.1.2).
> +  This change will not break existing applications.
This one I agree. RFC 8017 obsoletes RFC 3447.
> --
> 2.21.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-25  9:48 ` Kusztal, ArkadiuszX
@ 2024-07-25 15:53   ` Gowrishankar Muthukrishnan
  2024-07-30 14:39     ` Gowrishankar Muthukrishnan
  2024-07-25 16:00   ` Gowrishankar Muthukrishnan
  1 sibling, 1 reply; 11+ messages in thread
From: Gowrishankar Muthukrishnan @ 2024-07-25 15:53 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, dev, Anoob Joseph, Richardson, Bruce,
	ciara.power, Jerin Jacob, fanzhang.oss, Ji, Kai,
	jack.bond-preston, Marchand, David, hemant.agrawal,
	De Lara Guarch, Pablo, Trahe, Fiona, Doherty, Declan, matan,
	ruifeng.wang, Gujjar, Abhinandan S, maxime.coquelin, chenbox,
	sunilprakashrao.uttarwar, andrew.boyer, ajit.khaparde,
	raveendra.padasalagi, vikas.gupta, zhangfei.gao, g.singh,
	jianjay.zhou, Daly, Lee

[-- Attachment #1: Type: text/plain, Size: 1788 bytes --]

> +* cryptodev: The struct rte_crypto_rsa_padding will be moved from

> +  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform struct,

> +  breaking ABI. The new location is recommended to comply with

> +  virtio-crypto specification. Applications and drivers using

> +  this struct will be updated.

> +



The problem here, I see is that there is one private key but multiple combinations of padding.

Therefore, for every padding variation, we need to copy the same private key anew, duplicating it in memory.

The only reason for me to keep a session-like struct in asymmetric crypto was exactly this.



Each padding scheme in RSA has its own pros and cons (in terms of implementations as well).

When we share the same private key for Sign (and its public key in case of Encryption) between

multiple crypto ops (varying by padding schemes among cops), a vulnerable attack against one scheme

could potentially open door to used private key in the session and hence take advantage

on other crypto operations.



I think, this could be one reason for why VirtIO spec mandates padding info as session parameter.

Hence, more than duplicating in memory, private and public keys are secured and in catastrophe,

only that session could be destroyed.



Thanks,

Gowrishankar



Though padding schemes could be same



> +* cryptodev: The rte_crypto_rsa_xform struct member to hold private key

> +  in either exponent or quintuple format is changed from union to

> +struct

> +  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix A.1.2).

> +  This change will not break existing applications.

This one I agree. RFC 8017 obsoletes RFC 3447.



Thanks,

Gowrishankar

> --

> 2.21.0



[-- Attachment #2: Type: text/html, Size: 7504 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-25  9:48 ` Kusztal, ArkadiuszX
  2024-07-25 15:53   ` Gowrishankar Muthukrishnan
@ 2024-07-25 16:00   ` Gowrishankar Muthukrishnan
  1 sibling, 0 replies; 11+ messages in thread
From: Gowrishankar Muthukrishnan @ 2024-07-25 16:00 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, dev, Anoob Joseph, Richardson, Bruce,
	ciara.power, Jerin Jacob, fanzhang.oss, Ji, Kai,
	jack.bond-preston, Marchand, David, hemant.agrawal,
	De Lara Guarch, Pablo, Trahe, Fiona, Doherty, Declan, matan,
	ruifeng.wang, Gujjar, Abhinandan S, maxime.coquelin, chenbox,
	sunilprakashrao.uttarwar, andrew.boyer, ajit.khaparde,
	raveendra.padasalagi, vikas.gupta, zhangfei.gao, g.singh,
	jianjay.zhou, Daly, Lee

[-- Attachment #1: Type: text/plain, Size: 1783 bytes --]

Hi ArkadiuszX,


> +

> +* cryptodev: The struct rte_crypto_rsa_padding will be moved from

> +  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform struct,

> +  breaking ABI. The new location is recommended to comply with

> +  virtio-crypto specification. Applications and drivers using

> +  this struct will be updated.

> +



The problem here, I see is that there is one private key but multiple combinations of padding.

Therefore, for every padding variation, we need to copy the same private key anew, duplicating it in memory.

The only reason for me to keep a session-like struct in asymmetric crypto was exactly this.





Each padding scheme in RSA has its own pros and cons (in terms of implementations as well).

When we share the same private key for Sign (and its public key in case of Encryption) between

multiple crypto ops (varying by padding schemes among cops), a vulnerable attack against one scheme

could potentially open door to used private key in the session and hence take advantage

on other crypto operations.



I think, this could be one reason for why VirtIO spec mandates padding info as session parameter.

Hence, more than duplicating in memory, private and public keys are secured and in catastrophe,

only that session could be destroyed.



Please share your thoughts.



> +* cryptodev: The rte_crypto_rsa_xform struct member to hold private key

> +  in either exponent or quintuple format is changed from union to

> +struct

> +  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix A.1.2).

> +  This change will not break existing applications.

This one I agree. RFC 8017 obsoletes RFC 3447.



Thanks,

Gowrishankar



> --

> 2.21.0



[-- Attachment #2: Type: text/html, Size: 7769 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-25 15:53   ` Gowrishankar Muthukrishnan
@ 2024-07-30 14:39     ` Gowrishankar Muthukrishnan
  2024-07-31 12:51       ` Thomas Monjalon
  0 siblings, 1 reply; 11+ messages in thread
From: Gowrishankar Muthukrishnan @ 2024-07-30 14:39 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan, Kusztal, ArkadiuszX, dev,
	Anoob Joseph, Richardson, Bruce, ciara.power, Jerin Jacob,
	fanzhang.oss, Ji, Kai, jack.bond-preston, Marchand, David,
	hemant.agrawal, De Lara Guarch, Pablo, Trahe, Fiona, Doherty,
	Declan, matan, ruifeng.wang, Gujjar, Abhinandan S,
	maxime.coquelin, chenbox, sunilprakashrao.uttarwar, andrew.boyer,
	ajit.khaparde, raveendra.padasalagi, vikas.gupta, zhangfei.gao,
	g.singh, jianjay.zhou, Daly, Lee

[-- Attachment #1: Type: text/plain, Size: 2294 bytes --]

Hi,
We need to fix padding info in DPDK as per VirtIO specification in order to support RSA in virtio devices. VirtIO-crypto specification and DPDK specification differs in the way padding is handled.
With current DPDK & virtio specification, it is impossible to support RSA in virtio-crypto. If you think DPDK spec should not be modified, we will try to amend the virtIO spec to match DPDK, but since we do not know if the virtIO community would accept, can we merge the deprecation notice?

Thanks,
Gowrishankar

ZjQcmQRYFpfptBannerEnd

>>> +* cryptodev: The struct rte_crypto_rsa_padding will be moved from

>>> +  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform struct,

>>> +  breaking ABI. The new location is recommended to comply with

>>> +  virtio-crypto specification. Applications and drivers using

>>> +  this struct will be updated.

>>> +



>> The problem here, I see is that there is one private key but multiple combinations of padding.

>> Therefore, for every padding variation, we need to copy the same private key anew, duplicating it in memory.

>> The only reason for me to keep a session-like struct in asymmetric crypto was exactly this.



> Each padding scheme in RSA has its own pros and cons (in terms of implementations as well).

> When we share the same private key for Sign (and its public key in case of Encryption) between

> multiple crypto ops (varying by padding schemes among cops), a vulnerable attack against one scheme

> could potentially open door to used private key in the session and hence take advantage

> on other crypto operations.



> I think, this could be one reason for why VirtIO spec mandates padding info as session parameter.

> Hence, more than duplicating in memory, private and public keys are secured and in catastrophe,

> only that session could be destroyed.



>>> +* cryptodev: The rte_crypto_rsa_xform struct member to hold private key

>>> +  in either exponent or quintuple format is changed from union to

>>> +struct

>>> +  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix A.1.2).

>>> +  This change will not break existing applications.

>>This one I agree. RFC 8017 obsoletes RFC 3447.



> Thanks,

> Gowrishankar



[-- Attachment #2: Type: text/html, Size: 8293 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-30 14:39     ` Gowrishankar Muthukrishnan
@ 2024-07-31 12:51       ` Thomas Monjalon
  2024-07-31 14:26         ` Thomas Monjalon
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2024-07-31 12:51 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan
  Cc: Kusztal, ArkadiuszX, dev, Anoob Joseph, Richardson, Bruce,
	ciara.power, Jerin Jacob, fanzhang.oss, Ji, Kai,
	jack.bond-preston, Marchand, David, hemant.agrawal,
	De Lara Guarch, Pablo, Trahe, Fiona, Doherty, Declan, matan,
	ruifeng.wang, Gujjar, Abhinandan S, maxime.coquelin, chenbox,
	sunilprakashrao.uttarwar, andrew.boyer, ajit.khaparde,
	raveendra.padasalagi, vikas.gupta, zhangfei.gao, g.singh,
	jianjay.zhou, Daly, Lee

30/07/2024 16:39, Gowrishankar Muthukrishnan:
> Hi,
> We need to fix padding info in DPDK as per VirtIO specification in order to support RSA in virtio devices. VirtIO-crypto specification and DPDK specification differs in the way padding is handled.
> With current DPDK & virtio specification, it is impossible to support RSA in virtio-crypto. If you think DPDK spec should not be modified, we will try to amend the virtIO spec to match DPDK, but since we do not know if the virtIO community would accept, can we merge the deprecation notice?

There is a long list of Cc but I see no support outside of Marvell.



> >>> +* cryptodev: The struct rte_crypto_rsa_padding will be moved from
> >>> +  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform struct,
> >>> +  breaking ABI. The new location is recommended to comply with
> >>> +  virtio-crypto specification. Applications and drivers using
> >>> +  this struct will be updated.
> >>> +
> 
> 
> >> The problem here, I see is that there is one private key but multiple combinations of padding.
> >> Therefore, for every padding variation, we need to copy the same private key anew, duplicating it in memory.
> >> The only reason for me to keep a session-like struct in asymmetric crypto was exactly this.
> > 
> > Each padding scheme in RSA has its own pros and cons (in terms of implementations as well).
> > When we share the same private key for Sign (and its public key in case of Encryption) between
> > multiple crypto ops (varying by padding schemes among cops), a vulnerable attack against one scheme
> > could potentially open door to used private key in the session and hence take advantage
> > on other crypto operations.
> > 
> > I think, this could be one reason for why VirtIO spec mandates padding info as session parameter.
> > Hence, more than duplicating in memory, private and public keys are secured and in catastrophe,
> > only that session could be destroyed.
> 
> 
> >>> +* cryptodev: The rte_crypto_rsa_xform struct member to hold private key
> >>> +  in either exponent or quintuple format is changed from union to
> >>> +struct
> >>> +  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix A.1.2).
> >>> +  This change will not break existing applications.
> > >
> > > This one I agree. RFC 8017 obsoletes RFC 3447.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-31 12:51       ` Thomas Monjalon
@ 2024-07-31 14:26         ` Thomas Monjalon
  2024-08-07 13:31           ` Kusztal, ArkadiuszX
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2024-07-31 14:26 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan
  Cc: dev, Kusztal, ArkadiuszX, dev, Anoob Joseph, Richardson, Bruce,
	ciara.power, Jerin Jacob, fanzhang.oss, Ji, Kai,
	jack.bond-preston, Marchand, David, hemant.agrawal,
	De Lara Guarch, Pablo, Trahe, Fiona, Doherty, Declan, matan,
	ruifeng.wang, Gujjar, Abhinandan S, maxime.coquelin, chenbox,
	sunilprakashrao.uttarwar, andrew.boyer, ajit.khaparde,
	raveendra.padasalagi, vikas.gupta, zhangfei.gao, g.singh,
	jianjay.zhou, Daly, Lee

I'm not sure why we don't have a consensus on an idea proposed as RFC in September 2023.

Because there is not enough involvement outside of the Marvell team,
I will keep a vague announce for the first item:

cryptodev: Some changes may happen to manage RSA padding for virtio-crypto.

The second item is applied verbatim, thanks.


31/07/2024 14:51, Thomas Monjalon:
> 30/07/2024 16:39, Gowrishankar Muthukrishnan:
> > Hi,
> > We need to fix padding info in DPDK as per VirtIO specification in order to support RSA in virtio devices. VirtIO-crypto specification and DPDK specification differs in the way padding is handled.
> > With current DPDK & virtio specification, it is impossible to support RSA in virtio-crypto. If you think DPDK spec should not be modified, we will try to amend the virtIO spec to match DPDK, but since we do not know if the virtIO community would accept, can we merge the deprecation notice?
> 
> There is a long list of Cc but I see no support outside of Marvell.
> 
> 
> 
> > >>> +* cryptodev: The struct rte_crypto_rsa_padding will be moved from
> > >>> +  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform struct,
> > >>> +  breaking ABI. The new location is recommended to comply with
> > >>> +  virtio-crypto specification. Applications and drivers using
> > >>> +  this struct will be updated.
> > >>> +
> > 
> > 
> > >> The problem here, I see is that there is one private key but multiple combinations of padding.
> > >> Therefore, for every padding variation, we need to copy the same private key anew, duplicating it in memory.
> > >> The only reason for me to keep a session-like struct in asymmetric crypto was exactly this.
> > > 
> > > Each padding scheme in RSA has its own pros and cons (in terms of implementations as well).
> > > When we share the same private key for Sign (and its public key in case of Encryption) between
> > > multiple crypto ops (varying by padding schemes among cops), a vulnerable attack against one scheme
> > > could potentially open door to used private key in the session and hence take advantage
> > > on other crypto operations.
> > > 
> > > I think, this could be one reason for why VirtIO spec mandates padding info as session parameter.
> > > Hence, more than duplicating in memory, private and public keys are secured and in catastrophe,
> > > only that session could be destroyed.
> > 
> > 
> > >>> +* cryptodev: The rte_crypto_rsa_xform struct member to hold private key
> > >>> +  in either exponent or quintuple format is changed from union to
> > >>> +struct
> > >>> +  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix A.1.2).
> > >>> +  This change will not break existing applications.
> > > >
> > > > This one I agree. RFC 8017 obsoletes RFC 3447.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-07-31 14:26         ` Thomas Monjalon
@ 2024-08-07 13:31           ` Kusztal, ArkadiuszX
  2024-08-18  4:36             ` Gowrishankar Muthukrishnan
  0 siblings, 1 reply; 11+ messages in thread
From: Kusztal, ArkadiuszX @ 2024-08-07 13:31 UTC (permalink / raw)
  To: Thomas Monjalon, Gowrishankar Muthukrishnan
  Cc: dev, dev, Anoob Joseph, Richardson, Bruce, ciara.power,
	Jerin Jacob, fanzhang.oss, Ji,  Kai, jack.bond-preston, Marchand,
	David, hemant.agrawal, De Lara Guarch, Pablo, Trahe, Fiona,
	Doherty, Declan, matan, ruifeng.wang, Gujjar, Abhinandan S,
	maxime.coquelin, chenbox, sunilprakashrao.uttarwar, andrew.boyer,
	ajit.khaparde, raveendra.padasalagi, vikas.gupta, zhangfei.gao,
	g.singh, jianjay.zhou, Daly, Lee



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, July 31, 2024 4:27 PM
> To: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Cc: dev@dpdk.org; Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>;
> dev@dpdk.org; Anoob Joseph <anoobj@marvell.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; ciara.power@intel.com; Jerin Jacob
> <jerinj@marvell.com>; fanzhang.oss@gmail.com; Ji, Kai <kai.ji@intel.com>;
> jack.bond-preston@foss.arm.com; Marchand, David
> <david.marchand@redhat.com>; hemant.agrawal@nxp.com; De Lara Guarch,
> Pablo <pablo.de.lara.guarch@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Doherty, Declan <declan.doherty@intel.com>;
> matan@nvidia.com; ruifeng.wang@arm.com; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; maxime.coquelin@redhat.com;
> chenbox@nvidia.com; sunilprakashrao.uttarwar@amd.com;
> andrew.boyer@amd.com; ajit.khaparde@broadcom.com;
> raveendra.padasalagi@broadcom.com; vikas.gupta@broadcom.com;
> zhangfei.gao@linaro.org; g.singh@nxp.com; jianjay.zhou@huawei.com; Daly,
> Lee <lee.daly@intel.com>
> Subject: Re: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
> 
> I'm not sure why we don't have a consensus on an idea proposed as RFC in
> September 2023.
> 
> Because there is not enough involvement outside of the Marvell team, I will
> keep a vague announce for the first item:
> 
> cryptodev: Some changes may happen to manage RSA padding for virtio-crypto.
> 
> The second item is applied verbatim, thanks.
> 
> 
> 31/07/2024 14:51, Thomas Monjalon:
> > 30/07/2024 16:39, Gowrishankar Muthukrishnan:
> > > Hi,
> > > We need to fix padding info in DPDK as per VirtIO specification in order to
> support RSA in virtio devices. VirtIO-crypto specification and DPDK specification
> differs in the way padding is handled.
> > > With current DPDK & virtio specification, it is impossible to support RSA in
> virtio-crypto. If you think DPDK spec should not be modified, we will try to
> amend the virtIO spec to match DPDK, but since we do not know if the virtIO
> community would accept, can we merge the deprecation notice?
> >
> > There is a long list of Cc but I see no support outside of Marvell.
> >
> >
> >
> > > >>> +* cryptodev: The struct rte_crypto_rsa_padding will be moved
> > > >>> +from
> > > >>> +  rte_crypto_rsa_op_param struct to rte_crypto_rsa_xform
> > > >>> +struct,
> > > >>> +  breaking ABI. The new location is recommended to comply with
> > > >>> +  virtio-crypto specification. Applications and drivers using
> > > >>> +  this struct will be updated.
> > > >>> +
> > >
> > >
> > > >> The problem here, I see is that there is one private key but multiple
> combinations of padding.
> > > >> Therefore, for every padding variation, we need to copy the same private
> key anew, duplicating it in memory.
> > > >> The only reason for me to keep a session-like struct in asymmetric crypto
> was exactly this.
> > > >
> > > > Each padding scheme in RSA has its own pros and cons (in terms of
> implementations as well).
> > > > When we share the same private key for Sign (and its public key in
> > > > case of Encryption) between multiple crypto ops (varying by
> > > > padding schemes among cops), a vulnerable attack against one
> > > > scheme could potentially open door to used private key in the session and
> hence take advantage on other crypto operations.
> > > >
> > > > I think, this could be one reason for why VirtIO spec mandates padding info
> as session parameter.
> > > > Hence, more than duplicating in memory, private and public keys
> > > > are secured and in catastrophe, only that session could be destroyed.

Hi Gowrishankar,

Sorry for the delayed response.

I do not have any particular security issues in mind here, and if PMD need to copy keys internally, for alignment or padding purposes, redundancy problems can be overcome. My concern was, that it is the more natural way of handling the API; we have one key, multiple padding schemes, so we reflect this logic in the API.

Both options are widely used; libcrypto, for example is setting padding within session, other languages like Go, Rust are setting it as an argument to the method of the key struct.

If this is that problematic with VirtIO compatibility, I say this change is okay.

> > >
> > >
> > > >>> +* cryptodev: The rte_crypto_rsa_xform struct member to hold
> > > >>> +private key
> > > >>> +  in either exponent or quintuple format is changed from union
> > > >>> +to struct
> > > >>> +  data type. This change is to support ASN.1 syntax (RFC 3447 Appendix
> A.1.2).
> > > >>> +  This change will not break existing applications.
> > > > >
> > > > > This one I agree. RFC 8017 obsoletes RFC 3447.
> 
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO
  2024-08-07 13:31           ` Kusztal, ArkadiuszX
@ 2024-08-18  4:36             ` Gowrishankar Muthukrishnan
  0 siblings, 0 replies; 11+ messages in thread
From: Gowrishankar Muthukrishnan @ 2024-08-18  4:36 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, Thomas Monjalon
  Cc: dev, dev, Anoob Joseph, Richardson, Bruce, ciara.power,
	Jerin Jacob, fanzhang.oss, Ji, Kai, jack.bond-preston, Marchand,
	David, hemant.agrawal, De Lara Guarch, Pablo, Trahe, Fiona,
	Doherty, Declan, matan, ruifeng.wang, Gujjar, Abhinandan S,
	maxime.coquelin, chenbox, sunilprakashrao.uttarwar, andrew.boyer,
	ajit.khaparde, raveendra.padasalagi, vikas.gupta, zhangfei.gao,
	g.singh, jianjay.zhou, Daly, Lee

Hi Arek,

> I do not have any particular security issues in mind here, and if PMD need to
> copy keys internally, for alignment or padding purposes, redundancy problems
> can be overcome. My concern was, that it is the more natural way of handling
> the API; we have one key, multiple padding schemes, so we reflect this logic in
> the API.
> 
> Both options are widely used; libcrypto, for example is setting padding within
> session, other languages like Go, Rust are setting it as an argument to the
> method of the key struct.
> 
> If this is that problematic with VirtIO compatibility, I say this change is okay.
> 

Thank you for your input. I understand your concern. We ensure the impact 
Is nominal and make changes if needed.

Thanks,

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-08-18  4:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-22 14:55 [PATCH] doc: announce cryptodev changes to offload RSA in VirtIO Gowrishankar Muthukrishnan
2024-07-24  5:10 ` Anoob Joseph
2024-07-24  6:49 ` [EXTERNAL] " Akhil Goyal
2024-07-25  9:48 ` Kusztal, ArkadiuszX
2024-07-25 15:53   ` Gowrishankar Muthukrishnan
2024-07-30 14:39     ` Gowrishankar Muthukrishnan
2024-07-31 12:51       ` Thomas Monjalon
2024-07-31 14:26         ` Thomas Monjalon
2024-08-07 13:31           ` Kusztal, ArkadiuszX
2024-08-18  4:36             ` Gowrishankar Muthukrishnan
2024-07-25 16:00   ` Gowrishankar Muthukrishnan

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).