Skip to contentSkip to conversation

examples/fips_validation: prehash input for RSA

PATCH Applied Gowrishankar Muthukrishnan 3 participants 3 messages Oct 29, 2024 – Nov 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/fips_validation: prehash input for RSA

Plain text needs to be prehashed for RSA as well in asymmetric crypto validation.

Fixes 12ede9ac497f ("examples/fips_validation: support EdDSA")
---
 examples/fips_validation/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
examples/fips_validation/main.c +2 -1
index b34015ad9f..f21826e9d7 100644
@@ -1940,7 +1940,8 @@ fips_run_test(void)
 		return fips_run_asym_test();
 	}
 
-	if (info.algo == FIPS_TEST_ALGO_ECDSA) {
+	if (info.algo == FIPS_TEST_ALGO_ECDSA ||
+	    info.algo == FIPS_TEST_ALGO_RSA) {
 		vec.cipher_auth.digest.len =
 			parse_test_sha_hash_size(info.interim_info.ecdsa_data.auth);
 		test_ops.prepare_sym_xform = prepare_sha_xform;
Signature · 1 line
2.37.1
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines

-----Original Message-----
From: Gowrishankar Muthukrishnan <[email protected]>
Sent: Tuesday 29 October 2024 06:01
To: [email protected]; Dooley, Brian <[email protected]>; Gowrishankar Muthukrishnan <[email protected]>
Cc: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>
Subject: [PATCH v1] examples/fips_validation: prehash input for RSA

Plain text needs to be prehashed for RSA as well in asymmetric crypto validation.

Fixes 12ede9ac497f ("examples/fips_validation: support EdDSA")
---
 examples/fips_validation/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/examples/fips_validation/main.c index b34015ad9f..f21826e9d7 100644

examples/fips_validation/main.c +2 -1
@@ -1940,7 +1940,8 @@ fips_run_test(void)
 		return fips_run_asym_test();
 	}
 
-	if (info.algo == FIPS_TEST_ALGO_ECDSA) {
+	if (info.algo == FIPS_TEST_ALGO_ECDSA ||
+	    info.algo == FIPS_TEST_ALGO_RSA) {
 		vec.cipher_auth.digest.len =
 
 	parse_test_sha_hash_size(info.interim_info.ecdsa_data.auth);
Quoted 3 lines

test_ops.prepare_sym_xform = prepare_sha_xform;
--
2.37.1