mbedtls/programs/ssl
Hanno Becker 1292c35c03 Add config.h option to hardcode choice of single MD algorithm
This commit introduces the configuration option

  MBEDTLS_MD_SINGLE_HASH

which can be used to hardcode support for a single digest algorithm
at compile-time, at the benefit of reduced code-size.

To use, it needs to be defined to evaluate to a macro of the form
MBEDTLS_MD_INFO_{DIGEST}, and macros MBEDTLS_MD_INFO_{DIGEST}_FIELD
must be defined, giving rise to the various aspects (name, type,
size, ...) of the chosen digest algorithm. MBEDTLS_MD_INFO_SHA256
provides an example, but other algorithms can be added if needed.

At the moment, the effect of using MBEDTLS_MD_SINGLE_HASH is that
the implementation of the MD API (e.g. mbedtls_md_update()) need no
longer to through the abstraction of the mbedtls_md_info structures
by calling their corresponding function pointers fields (akin to
virtual functions in C++), but the directly call the corresponding
core digest function (such as mbedtls_sha256_update()).

Therefore, MBEDTLS_MD_SINGLE_HASH so far removes the second layer
of indirection in the chain

  User calls MD API -> MD API calls underlying digest impl'n
                    -> Core digest impl'n does the actual work,

but the first indirection remains, as the MD API remains untouched
and cannot yet be inlined. Studying to what extend inlining the
shortened MD API implementations would lead to further code-savings
is left for a later commit.
2019-09-09 09:45:57 +01:00
..
CMakeLists.txt Improve cmake inclusion of query_config.c when building apps 2019-02-07 10:32:31 +00:00
dtls_client.c Make function mbedtls_ssl_set_hostname(...) as optional 2019-08-27 10:47:08 +03:00
dtls_server.c Enforce NULL context for hardcoded RNG 2019-08-12 17:05:03 +01:00
mini_client.c Make function mbedtls_ssl_set_hostname(...) as optional 2019-08-27 10:47:08 +03:00
query_config.c Add config.h option to hardcode choice of single MD algorithm 2019-09-09 09:45:57 +01:00
ssl_client1.c Make function mbedtls_ssl_set_hostname(...) as optional 2019-08-27 10:47:08 +03:00
ssl_client2.c Fix unused variable warnings in ssl_client2/ssl_server2 2019-09-03 08:59:36 +01:00
ssl_fork_server.c Enforce NULL context for hardcoded RNG 2019-08-12 17:05:03 +01:00
ssl_mail_client.c Make function mbedtls_ssl_set_hostname(...) as optional 2019-08-27 10:47:08 +03:00
ssl_pthread_server.c Enforce NULL context for hardcoded RNG 2019-08-12 17:05:03 +01:00
ssl_server2.c Fixup: Add missing TinyCrypt guards 2019-09-04 16:17:45 +01:00
ssl_server.c Enforce NULL context for hardcoded RNG 2019-08-12 17:05:03 +01:00