[v8,16/16] test/crypto: add AES-XTS multi segment OOP tests

Message ID 20210715164126.54073-17-shirik@nvidia.com (mailing list archive)
State Changes Requested, archived
Delegated to: akhil goyal
Headers
Series drivers: introduce mlx5 crypto PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot fail github build: failed
ci/intel-Testing success Testing PASS
ci/Intel-compilation warning apply issues

Commit Message

Shiri Kuzin July 15, 2021, 4:41 p.m. UTC
  The AES-XTS algorithm can supports wrapped key and data-unit.
The encryption/decryption can be done out of place and using multi
segments.

Add multi segment and out of place tests to the recently added AES-XTS
vectors, which support using data-unit and a wrapped key.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 app/test/test_cryptodev_aes_test_vectors.h | 64 ++++++++++++++++++++++
 1 file changed, 64 insertions(+)
  

Comments

Akhil Goyal July 16, 2021, 8:10 p.m. UTC | #1
> The AES-XTS algorithm can supports wrapped key and data-unit.
> The encryption/decryption can be done out of place and using multi
> segments.
> 
> Add multi segment and out of place tests to the recently added AES-XTS
> vectors, which support using data-unit and a wrapped key.
> 
> Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

@Fan/Ciara: Can you test these test app patches on intel platforms and provide
Feedback on these patches.

> ---
>  app/test/test_cryptodev_aes_test_vectors.h | 64 ++++++++++++++++++++++
>  1 file changed, 64 insertions(+)
> 
> diff --git a/app/test/test_cryptodev_aes_test_vectors.h
> b/app/test/test_cryptodev_aes_test_vectors.h
> index dd7ffde685..a797af1b00 100644
> --- a/app/test/test_cryptodev_aes_test_vectors.h
> +++ b/app/test/test_cryptodev_aes_test_vectors.h
> @@ -4687,6 +4687,70 @@ static const struct blockcipher_test_case
> aes_cipheronly_test_cases[] = {
>  		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_4096_du_0,
>  		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
>  	},
> +	{
> +		.test_descr = "AES-256-XTS Encryption (512-byte plaintext"
> +			      " Dataunit 512) Scater gather OOP",

Spell check for scatter at all places.

> +		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_512_du_512,
> +		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
> +		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
> +				BLOCKCIPHER_TEST_FEATURE_SG,
> +	},
> +	{
> +		.test_descr = "AES-256-XTS Decryption (512-byte plaintext"
> +			      " Dataunit 512) Scater gather OOP",
> +		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_512_du_512,
> +		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
> +		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
> +				BLOCKCIPHER_TEST_FEATURE_SG,
> +	},
> +	{
> +		.test_descr = "AES-256-XTS Encryption (512-byte plaintext"
> +			      " Dataunit 0) Scater gather OOP",
> +		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_512_du_0,
> +		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
> +		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
> +				BLOCKCIPHER_TEST_FEATURE_SG,
> +	},
> +	{
> +		.test_descr = "AES-256-XTS Decryption (512-byte plaintext"
> +			      " Dataunit 0) Scater gather OOP",
> +		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_512_du_0,
> +		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
> +		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
> +				BLOCKCIPHER_TEST_FEATURE_SG,
> +	},
> +	{
> +		.test_descr = "AES-256-XTS Encryption (4096-byte plaintext"
> +			      " Dataunit 4096) Scater gather OOP",
> +		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_4096_du_4096,
> +		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
> +		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
> +				BLOCKCIPHER_TEST_FEATURE_SG,
> +	},
> +	{
> +		.test_descr = "AES-256-XTS Decryption (4096-byte plaintext"
> +			      " Dataunit 4096) Scater gather OOP",
> +		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_4096_du_4096,
> +		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
> +		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
> +				BLOCKCIPHER_TEST_FEATURE_SG,
> +	},
> +	{
> +		.test_descr = "AES-256-XTS Encryption (4096-byte plaintext"
> +			      " Dataunit 0) Scater gather OOP",
> +		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_4096_du_0,
> +		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
> +		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
> +				BLOCKCIPHER_TEST_FEATURE_SG,
> +	},
> +	{
> +		.test_descr = "AES-256-XTS Decryption (4096-byte plaintext"
> +			      " Dataunit 0) Scater gather OOP",
> +		.test_data =
> &aes_test_data_xts_wrapped_key_48_pt_4096_du_0,
> +		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
> +		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
> +				BLOCKCIPHER_TEST_FEATURE_SG,
> +	},
>  	{
>  		.test_descr = "cipher-only - NULL algo - x8 - encryption",
>  		.test_data = &null_test_data_chain_x8_multiple,
> --
> 2.27.0
  

Patch

diff --git a/app/test/test_cryptodev_aes_test_vectors.h b/app/test/test_cryptodev_aes_test_vectors.h
index dd7ffde685..a797af1b00 100644
--- a/app/test/test_cryptodev_aes_test_vectors.h
+++ b/app/test/test_cryptodev_aes_test_vectors.h
@@ -4687,6 +4687,70 @@  static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_0,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 	},
+	{
+		.test_descr = "AES-256-XTS Encryption (512-byte plaintext"
+			      " Dataunit 512) Scater gather OOP",
+		.test_data = &aes_test_data_xts_wrapped_key_48_pt_512_du_512,
+		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
+		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
+				BLOCKCIPHER_TEST_FEATURE_SG,
+	},
+	{
+		.test_descr = "AES-256-XTS Decryption (512-byte plaintext"
+			      " Dataunit 512) Scater gather OOP",
+		.test_data = &aes_test_data_xts_wrapped_key_48_pt_512_du_512,
+		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
+		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
+				BLOCKCIPHER_TEST_FEATURE_SG,
+	},
+	{
+		.test_descr = "AES-256-XTS Encryption (512-byte plaintext"
+			      " Dataunit 0) Scater gather OOP",
+		.test_data = &aes_test_data_xts_wrapped_key_48_pt_512_du_0,
+		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
+		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
+				BLOCKCIPHER_TEST_FEATURE_SG,
+	},
+	{
+		.test_descr = "AES-256-XTS Decryption (512-byte plaintext"
+			      " Dataunit 0) Scater gather OOP",
+		.test_data = &aes_test_data_xts_wrapped_key_48_pt_512_du_0,
+		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
+		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
+				BLOCKCIPHER_TEST_FEATURE_SG,
+	},
+	{
+		.test_descr = "AES-256-XTS Encryption (4096-byte plaintext"
+			      " Dataunit 4096) Scater gather OOP",
+		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_4096,
+		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
+		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
+				BLOCKCIPHER_TEST_FEATURE_SG,
+	},
+	{
+		.test_descr = "AES-256-XTS Decryption (4096-byte plaintext"
+			      " Dataunit 4096) Scater gather OOP",
+		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_4096,
+		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
+		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
+				BLOCKCIPHER_TEST_FEATURE_SG,
+	},
+	{
+		.test_descr = "AES-256-XTS Encryption (4096-byte plaintext"
+			      " Dataunit 0) Scater gather OOP",
+		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_0,
+		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
+		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
+				BLOCKCIPHER_TEST_FEATURE_SG,
+	},
+	{
+		.test_descr = "AES-256-XTS Decryption (4096-byte plaintext"
+			      " Dataunit 0) Scater gather OOP",
+		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_0,
+		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
+		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
+				BLOCKCIPHER_TEST_FEATURE_SG,
+	},
 	{
 		.test_descr = "cipher-only - NULL algo - x8 - encryption",
 		.test_data = &null_test_data_chain_x8_multiple,