[v2,2/2] cryptodev: add dh padding options

Message ID 20220413140327.12915-3-arkadiuszx.kusztal@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series cryptodev: add dh verify option |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues

Commit Message

Arkadiusz Kusztal April 13, 2022, 2:03 p.m. UTC
  Diffie-Hellman padding is used in certain protocols,
in others, leading zero bytes need to be stripped.
Even same protocol may use a different approach - most
glaring example is TLS1.2 - TLS1.3.
To make the user life easier, and to avoid additional copy
on certain occasions, driver should be able to return both.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 lib/cryptodev/rte_crypto_asym.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
  

Comments

Akhil Goyal May 16, 2022, 6:51 p.m. UTC | #1
> Diffie-Hellman padding is used in certain protocols,
> in others, leading zero bytes need to be stripped.
> Even same protocol may use a different approach - most
> glaring example is TLS1.2 - TLS1.3.
> To make the user life easier, and to avoid additional copy
> on certain occasions, driver should be able to return both.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
>  lib/cryptodev/rte_crypto_asym.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
> index c4f4afa07f..e757663e8e 100644
> --- a/lib/cryptodev/rte_crypto_asym.h
> +++ b/lib/cryptodev/rte_crypto_asym.h
> @@ -440,7 +440,15 @@ struct rte_crypto_dh_op_param {
>  	  * Full verification   |    0    | steps of point verification (full validation),
>  	  *                     |         | otherwise three (partial validation - default).
>  	  *--------------------------------------------------------------------------------
> -	  * Reserved            |   1-15  | Reserved
> +	  *                     |         | If set to 1 - public key will be returned
> +	  * Public key padding  |    1    | without leading zero bytes, otherwise it
> will be
> +	  *                     |         | padded to the left with zero bytes (default)
> +	  *--------------------------------------------------------------------------------
> +	  *                     |         | If set to 1 - shared key will be returned
> +	  * Shared key padding  |    2    | without leading zero bytes, otherwise it
> will be
> +	  *                     |         | padded to the left with zero bytes (default)
> +	  *--------------------------------------------------------------------------------
> +	  * Reserved            |   3-15  | Reserved
>  	  */
Same comment here as patch 1 of the series.
Define macros.
  

Patch

diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
index c4f4afa07f..e757663e8e 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -440,7 +440,15 @@  struct rte_crypto_dh_op_param {
 	  * Full verification   |    0    | steps of point verification (full validation),
 	  *                     |         | otherwise three (partial validation - default).
 	  *--------------------------------------------------------------------------------
-	  * Reserved            |   1-15  | Reserved
+	  *                     |         | If set to 1 - public key will be returned
+	  * Public key padding  |    1    | without leading zero bytes, otherwise it will be
+	  *                     |         | padded to the left with zero bytes (default)
+	  *--------------------------------------------------------------------------------
+	  *                     |         | If set to 1 - shared key will be returned
+	  * Shared key padding  |    2    | without leading zero bytes, otherwise it will be
+	  *                     |         | padded to the left with zero bytes (default)
+	  *--------------------------------------------------------------------------------
+	  * Reserved            |   3-15  | Reserved
 	  */
 
 };