mbedtls/include/psa
Gilles Peskine f5d7eef11f PSA operation structures: move less-used fields to the end
Move fields around to have fewer accesses outside the 128-element Thumb
direct access window.

In psa_hkdf_key_derivation_t, move the large fields (output_block, prk,
hmac) after the state bit-fields. Experimentally, it's slightly better
to put hmac last.

In aead_operation_t, tag_length was outside the window. The details depend
on the sizes of contexts included in ctx. Make the large ctx be the last
field.

In mbedtls_psa_hmac_operation_t, the opad field is outside the window when
SHA-512 is enabled. Moving opad before hash_ctx only saves 4 bytes and made
the structure clumsy, so I left it alone.

Results (arm-none-eabi-gcc 7.3.1, build_arm_none_eabi_gcc_m0plus build):
library/psa_crypto.o: 16246 -> 16166 (diff: 80)
library/psa_crypto_aead.o: 952 -> 928 (diff: 24)

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-11-16 15:00:17 +01:00
..
crypto.h Add missing PSA_ALG_IS_SIGN_HASH macro. 2021-11-03 12:38:57 +01:00
crypto_builtin_composites.h Move is_sign and mac_size checking back to PSA core scope 2021-05-11 18:56:01 +02:00
crypto_builtin_primitives.h Give a better name for struct member 2021-06-30 10:31:18 +02:00
crypto_compat.h Fix typos in C header files 2021-05-12 10:39:58 +02:00
crypto_config.h Implement PSA_WANT_KEY_TYPE_ARIA 2021-10-08 18:28:15 +02:00
crypto_driver_common.h Remove old-style accelerator and entropy driver interfaces 2020-11-30 17:37:14 +01:00
crypto_driver_contexts_composites.h Add boilerplate for dispatching MAC operations 2021-05-11 18:56:01 +02:00
crypto_driver_contexts_primitives.h Remove inclusion of top-level crypto.h from the driver context header 2021-05-11 18:56:01 +02:00
crypto_extra.h Reword the builtin key language on persistency declaration 2021-04-16 11:25:18 +02:00
crypto_platform.h Move the inclusion of crypto_spe.h to psa/crypto_platform.h 2021-06-23 14:45:17 +02:00
crypto_se_driver.h Fix typos in C header files 2021-05-12 10:39:58 +02:00
crypto_sizes.h Add missing PSA_HASH_BLOCK_LENGTH macro. 2021-11-03 12:38:57 +01:00
crypto_struct.h PSA operation structures: move less-used fields to the end 2021-11-16 15:00:17 +01:00
crypto_types.h psa: Make sure MBEDTLS_PSA_CRYPTO_CLIENT is defined 2021-02-09 15:36:08 +01:00
crypto_values.h Reorder macro definitions 2021-11-03 12:44:08 +01:00