From 2d8a1824071275770218116e041355c8243c1405 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 8 Nov 2021 22:20:03 +0100 Subject: [PATCH] PSA global data: move fields around to save code size Move fields around to have fewer accesses outside the 128-element Thumb direct access window. Make the same change as in 2.27+, for the same small benefit. Results (arm-none-eabi-gcc 7.3.1, build_arm_none_eabi_gcc_m0plus build): library/psa_crypto.o: 16434 -> 16414 (diff: 20) Signed-off-by: Gilles Peskine --- library/psa_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 0a04ba1061..c74cb3cac8 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -103,9 +103,9 @@ static int key_type_is_raw_bytes( psa_key_type_t type ) typedef struct { - mbedtls_psa_random_context_t rng; unsigned initialized : 1; unsigned rng_state : 2; + mbedtls_psa_random_context_t rng; } psa_global_data_t; static psa_global_data_t global_data;