patch 'test/crypto: validate modex from first non-zero' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Mon Aug 12 14:48:17 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7978b75d1babcaae9b6c9633b6915dfaba2c6138
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 7978b75d1babcaae9b6c9633b6915dfaba2c6138 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Wed, 26 Jun 2024 15:33:40 +0530
Subject: [PATCH] test/crypto: validate modex from first non-zero
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 2162d32c1c3b3495b6f0b053e6e9c61092b5704a ]
At present, there is no specification of whether modex op output
can carry leading zeroes without changing the value. OpenSSL strips
leading zeroes, but other hardware need not be. Hence, when output
is compared against expected result, validation could start from
first non-zero.
Fixes: 1ffefe00f184 ("test/crypto: add modexp and modinv functions")
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
---
app/test/test_cryptodev_asym.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 2c745a7f7c..fec53f87db 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -3200,6 +3200,27 @@ static int send_one(void)
return TEST_SUCCESS;
}
+static int
+modular_cmpeq(const uint8_t *a, const uint8_t *b, size_t len)
+{
+ const uint8_t *new_a = a, *new_b = b;
+ size_t i, j;
+
+ /* Strip leading NUL bytes */
+ for (i = 0; i < len; i++)
+ if (a[i] != 0)
+ new_a = &a[i];
+
+ for (j = 0; j < len; j++)
+ if (b[j] != 0)
+ new_b = &b[i];
+
+ if (i != j || memcmp(new_a, new_b, len - i))
+ return 1;
+
+ return 0;
+}
+
static int
modular_exponentiation(const void *test_data)
{
@@ -3234,9 +3255,9 @@ modular_exponentiation(const void *test_data)
TEST_ASSERT_SUCCESS(send_one(),
"Failed to process crypto op");
- TEST_ASSERT_BUFFERS_ARE_EQUAL(vector->reminder.data,
+ TEST_ASSERT_SUCCESS(modular_cmpeq(vector->reminder.data,
self->result_op->asym->modex.result.data,
- self->result_op->asym->modex.result.length,
+ self->result_op->asym->modex.result.length),
"operation verification failed\n");
return TEST_SUCCESS;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-12 20:44:03.254848141 +0800
+++ 0020-test-crypto-validate-modex-from-first-non-zero.patch 2024-08-12 20:44:01.925069261 +0800
@@ -1 +1 @@
-From 2162d32c1c3b3495b6f0b053e6e9c61092b5704a Mon Sep 17 00:00:00 2001
+From 7978b75d1babcaae9b6c9633b6915dfaba2c6138 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 2162d32c1c3b3495b6f0b053e6e9c61092b5704a ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list