mbedtls/library
Gilles Peskine 55490d4e1f mbedtls_ssl_handshake_params: use bytes for some small values
Replace bitfields mbedtls_ssl_handshake_params by bytes. This saves some
code size, and since the bitfields weren't group, this doesn't increase the
RAM usage.

Replace several ints that only store values in the range 0..255 by uint8_t.
This can increase or decrease the code size depending on the architecture
and on how the field is used. I chose changes that save code size on Arm
Thumb builds and will save more after field reordering.

Leave the bitfields in struct mbedtls_ssl_hs_buffer alone: replacing them by
uint8_t slightly increases the code size.

Results (arm-none-eabi-gcc 7.3.1, build_arm_none_eabi_gcc_m0plus build):
library/ssl_cli.o: 19759 -> 19763 (diff: -4)
library/ssl_srv.o: 20790 -> 20754 (diff: 36)
library/ssl_tls13_keys.o: 5153 -> 5133 (diff: 20)

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-11-29 12:01:39 +01:00
..
.gitignore Ignore generated source files that are no longer checked in 2021-05-20 10:37:22 +02:00
aes.c Catch failures of AES or DES operations 2021-09-27 16:22:08 +02:00
aesni.c Move aesni.h to library 2021-03-10 12:52:37 +00:00
aesni.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
aria.c Replace 3 byte shift with appropriate macro 2021-08-19 09:55:42 +01:00
asn1parse.c Add missing const attribute to asn1 api 2021-01-26 13:57:46 +01:00
asn1write.c Replace MBEDTLS_CHAR_x with MBEDTLS_BYTE_x 2021-08-19 09:56:47 +01:00
base64.c Fix copypasta in comment 2021-10-25 22:15:20 +02:00
base64_invasive.h Fix copypasta in #endif comment 2021-11-03 18:27:22 +01:00
bignum.c Rename internal header constant_time.h to constant_time_internal.h 2021-10-20 12:15:20 +02:00
bn_mul.h Fix aarch64 assembly for bignum multiplication 2021-09-22 18:31:35 +01:00
camellia.c Add Character byte reading macros 2021-08-19 09:55:41 +01:00
ccm.c Ignore plaintext length for CCM*-no-tag. 2021-10-21 11:33:37 +02:00
chacha20.c Replace instances of byte reading macros with PUT 2021-08-19 09:56:47 +01:00
chachapoly.c Replace instances of byte reading macros with PUT 2021-08-19 09:56:47 +01:00
check_crypto_config.h psa: config: Add CAMELLIA to the list of possible CMAC ciphers 2021-03-25 14:25:46 +01:00
cipher.c Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
cipher_wrap.c Use separate MBEDTLS_MODE for the CCM*. 2021-10-27 10:42:31 +02:00
cipher_wrap.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
cmac.c Allow skipping 3DES in CMAC self-test when ALT implemented 2021-03-02 10:18:08 +01:00
CMakeLists.txt Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
common.h fix wrong para name in doxygen comments 2021-10-28 10:26:13 +08:00
constant_time.c Fix documentation and comments 2021-11-03 16:13:32 +01:00
constant_time_internal.h Fix documentation and comments 2021-11-03 16:13:32 +01:00
ctr_drbg.c Tidy up grouped MBEDTLS_BYTE_x macros 2021-08-23 11:52:28 +01:00
debug.c Add missing parentheses 2021-06-17 21:46:29 +02:00
des.c Catch failures of AES or DES operations 2021-09-27 16:22:08 +02:00
dhm.c Use byte reading macros in places not using a byte mask 2021-08-19 09:56:47 +01:00
ecdh.c Address various issues 2021-10-25 10:41:29 +08:00
ecdh_misc.h Address various issues 2021-10-25 10:41:29 +08:00
ecdsa.c Add output size parameter to signature functions 2021-06-25 00:46:22 +02:00
ecjpake.c Tidy up grouped MBEDTLS_BYTE_x macros 2021-08-23 11:52:28 +01:00
ecp.c Revert "tls13: add ecdh_read_public" 2021-09-27 16:34:58 +08:00
ecp_curves.c Add prefix to BYTES_TO_T_UINT_* 2021-06-25 12:46:40 +01:00
ecp_internal_alt.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
ecp_invasive.h Move mbedtls_mpi_random to the bignum module 2021-06-03 18:10:04 +02:00
entropy.c Merge pull request #4640 from TRodziewicz/move_part_of_timing_module_out_of_the_library_and_to_test 2021-06-18 16:35:58 +01:00
entropy_poll.c Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
entropy_poll.h Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
gcm.c Merge pull request #5213 from tom-cosgrove-arm/pr_4950 2021-11-22 22:22:37 +01:00
hkdf.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
hmac_drbg.c Rename the _ret() functions 2021-06-08 16:45:41 +02:00
Makefile Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
md.c Remove MD2, MD4, RC4, Blowfish and XTEA 2021-06-16 10:34:25 +02:00
md5.c GET macros use a target variable 2021-08-19 09:31:55 +01:00
md_wrap.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
memory_buffer_alloc.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
mps_common.h Capitalise MPS trace macros 2021-04-07 12:45:35 +01:00
mps_error.h Fix Doxygen headers for MPS files 2021-03-29 14:20:18 +01:00
mps_reader.c Capitalise MPS trace macros 2021-04-07 12:45:35 +01:00
mps_reader.h Fix Doxygen headers for MPS files 2021-03-29 14:20:18 +01:00
mps_trace.c Capitalise MPS trace macros 2021-04-07 12:45:35 +01:00
mps_trace.h Capitalise MPS trace macros 2021-04-07 12:45:35 +01:00
net_sockets.c Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
nist_kw.c Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
oid.c Remove MD2, MD4, RC4, Blowfish and XTEA 2021-06-16 10:34:25 +02:00
padlock.c Move padlock.h to library 2021-03-10 12:52:37 +00:00
padlock.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
pem.c Rename the _ret() functions 2021-06-08 16:45:41 +02:00
pk.c Add output size parameter to signature functions 2021-06-25 00:46:22 +02:00
pk_wrap.c Fix the build with MBEDTLS_ECP_RESTARTABLE enabled 2021-06-25 00:46:22 +02:00
pk_wrap.h Merge pull request #4694 from gilles-peskine-arm/out_size-3.0 2021-06-29 09:43:17 +02:00
pkcs5.c Apply MBEDTLS_ERROR_ADD to library 2021-04-15 11:19:47 +01:00
pkcs12.c Use byte reading macros in places not using a byte mask 2021-08-19 09:56:47 +01:00
pkparse.c Remove compiler warning if only MBEDTLS_PK_PARSE_C is defined 2021-08-31 13:05:12 +02:00
pkwrite.c Merge branch 'development_3.0' into remove_depr_error_codes 2021-04-21 12:31:43 +02:00
platform.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
platform_util.c Correction to callback declaration and usage 2021-07-13 12:23:12 +02:00
poly1305.c Replace instances of byte reading macros with PUT 2021-08-19 09:57:41 +01:00
psa_crypto.c PSA global data: move fields around to save code size 2021-11-26 12:46:28 +01:00
psa_crypto_aead.c Fix PSA AEAD GCM's update output buffer length verification. 2021-10-04 13:54:55 +02:00
psa_crypto_aead.h Restore internal driver for aead_set_lengths 2021-09-28 11:16:27 +01:00
psa_crypto_cipher.c Merge pull request #5076 from mstarzyk-mobica/psa_ccm_no_tag 2021-11-10 10:18:55 +01:00
psa_crypto_cipher.h Remove invalid buffer overflow check 2021-06-29 19:55:24 +02:00
psa_crypto_client.c Move the inclusion of crypto_spe.h to psa/crypto_platform.h 2021-06-17 11:43:58 +02:00
psa_crypto_core.h Code style improvements 2021-09-08 22:04:13 +05:30
psa_crypto_driver_wrappers.c Restore internal driver for aead_set_lengths 2021-09-28 11:16:27 +01:00
psa_crypto_driver_wrappers.h Merge remote-tracking branch 'upstream/development' into psa-m-aead-merge 2021-09-24 11:18:13 +01:00
psa_crypto_ecp.c Add test driver support for opaque key import 2021-09-08 22:03:54 +05:30
psa_crypto_ecp.h Add test driver support for opaque key import 2021-09-08 22:03:54 +05:30
psa_crypto_hash.c Remove MD2, MD4, RC4, Blowfish and XTEA 2021-06-16 10:34:25 +02:00
psa_crypto_hash.h Merge branch 'development' into development_3.0 2021-04-19 10:51:59 +02:00
psa_crypto_invasive.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
psa_crypto_its.h Update documentation 2020-11-25 13:10:50 +01:00
psa_crypto_mac.c Use the new macro PSA_HASH_BLOCK_LENGTH 2021-11-03 15:47:03 +01:00
psa_crypto_mac.h Move is_sign and mac_size checking back to PSA core scope 2021-05-10 11:29:13 +02:00
psa_crypto_random_impl.h Work around MSVC bug with duplicate static declarations 2021-02-16 18:55:05 +01:00
psa_crypto_rsa.c Readability improvements 2021-10-08 16:28:32 +02:00
psa_crypto_rsa.h Add test driver support for opaque key import 2021-09-08 22:03:54 +05:30
psa_crypto_se.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
psa_crypto_se.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
psa_crypto_slot_management.c Merge pull request #4878 from SiliconLabs/remove_dependency_4877 2021-09-20 22:20:16 +02:00
psa_crypto_slot_management.h psa: Fix error code when creating/registering a key with invalid id 2021-04-01 14:05:41 +02:00
psa_crypto_storage.c GET macros use a target variable 2021-08-19 09:31:55 +01:00
psa_crypto_storage.h Rename PSA_KEY_SLOT_COUNT to MBEDTLS_PSA_KEY_SLOT_COUNT 2021-02-15 14:26:44 +01:00
psa_its_file.c Replace instances of byte reading macros with PUT 2021-08-19 09:57:41 +01:00
ripemd160.c GET macros use a target variable 2021-08-19 09:31:55 +01:00
rsa.c Rename internal header constant_time.h to constant_time_internal.h 2021-10-20 12:15:20 +02:00
rsa_alt_helpers.c Rename rsa_internal.* to rsa_alt_helpers.* 2021-03-10 12:52:37 +00:00
rsa_alt_helpers.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
sha1.c GET macros use a target variable 2021-08-19 09:31:55 +01:00
sha256.c GET macros use a target variable 2021-08-19 09:31:55 +01:00
sha512.c Add UINT64 GET and PUT macros 2021-08-19 09:56:47 +01:00
ssl_cache.c Fix search for outdated entries in SSL session cache 2021-05-14 14:55:15 +01:00
ssl_ciphersuites.c Replace SHA512_C with SHA384_C 2021-08-25 18:13:48 +08:00
ssl_cli.c Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
ssl_cookie.c Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
ssl_misc.h mbedtls_ssl_handshake_params: use bytes for some small values 2021-11-29 12:01:39 +01:00
ssl_msg.c Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
ssl_srv.c Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
ssl_ticket.c Remove redundant null check 2021-08-31 22:54:27 +02:00
ssl_tls.c Merge pull request #4866 from gabor-mezei-arm/3649_move_constant_time_functions_into_separate_module 2021-11-24 19:33:00 +01:00
ssl_tls13_client.c Implement handshake wrapup 2021-11-17 16:03:06 +08:00
ssl_tls13_generic.c Merge pull request #4866 from gabor-mezei-arm/3649_move_constant_time_functions_into_separate_module 2021-11-24 19:33:00 +01:00
ssl_tls13_keys.c Rebase and change code 2021-11-15 03:37:11 +00:00
ssl_tls13_keys.h Remove useless blank line 2021-11-11 06:46:35 +00:00
ssl_tls13_server.c fix unused-variable fail without MBEDTLS_DEBUG_C 2021-09-27 16:25:05 +08:00
threading.c Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
timing.c Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
version.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
x509.c Merge pull request #3777 from hanno-arm/x509-info-optimization_rebased 2021-04-28 17:31:55 +01:00
x509_create.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
x509_crl.c Merge pull request #3777 from hanno-arm/x509-info-optimization_rebased 2021-04-28 17:31:55 +01:00
x509_crt.c Merge pull request #4671 from mpg/x509-crt-profile-public 2021-06-23 16:06:12 +01:00
x509_csr.c Merge pull request #3777 from hanno-arm/x509-info-optimization_rebased 2021-04-28 17:31:55 +01:00
x509write_crt.c Replace instances of byte reading macros with PUT 2021-08-19 09:57:41 +01:00
x509write_csr.c Add output size parameter to signature functions 2021-06-25 00:46:22 +02:00