1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00

MD: isolate strings to separate table

In the long term, we don't really want those strings in the library.
Start with isolating them in a separate table rather than having them in
the main md_info structure.

This way, the table can easily be garbage-collected by the linker if
none of the two functions using it are called.

Also, simplify the implementation of mbedtls_md_info_from_string().

This saves 151 bytes with MD_C, and 141 with MD_LIGHT only.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard
2023-06-20 12:12:22 +02:00
parent cd70070c25
commit ee7a758b85
2 changed files with 62 additions and 77 deletions

View File

@@ -39,9 +39,6 @@ extern "C" {
* Allows message digest functions to be called in a generic way.
*/
struct mbedtls_md_info_t {
/** Name of the message digest */
const char *name;
/** Digest identifier */
mbedtls_md_type_t type;