From eae1dfcc46e3fe03809989637ca2a7cfe1373d32 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Tue, 21 Jun 2022 13:37:06 +0200 Subject: [PATCH] Change to more efficient error injection in ecjpake_do_round() Signed-off-by: Neil Armstrong --- tests/suites/test_suite_psa_crypto.function | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 5261dedb44..c5a8cde6fa 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -775,7 +775,7 @@ static int ecjpake_do_round( psa_algorithm_t alg, unsigned int primitive, if( inject_error == 1 ) { - buffer0[s_x1_pk_off + 12] >>= 4; + buffer0[s_x1_pk_off + 8] >>= 4; buffer0[s_x2_pk_off + 7] <<= 4; expected_status = PSA_ERROR_DATA_INVALID; } @@ -1090,7 +1090,7 @@ static int ecjpake_do_round( psa_algorithm_t alg, unsigned int primitive, if( inject_error == 3 ) { - buffer0[s_x2s_pk_off + 12] >>= 4; + buffer0[s_x2s_pk_off + 12] += 0x33; expected_status = PSA_ERROR_DATA_INVALID; } @@ -1207,7 +1207,7 @@ static int ecjpake_do_round( psa_algorithm_t alg, unsigned int primitive, if( inject_error == 4 ) { - buffer1[c_x2s_pk_off + 12] >>= 4; + buffer1[c_x2s_pk_off + 7] += 0x28; expected_status = PSA_ERROR_DATA_INVALID; }