mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 23:55:44 +01:00
1292c35c03
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. |
||
---|---|---|
.. | ||
.gitignore | ||
aes.c | ||
aesni.c | ||
arc4.c | ||
aria.c | ||
asn1parse.c | ||
asn1write.c | ||
base64.c | ||
bignum.c | ||
blowfish.c | ||
camellia.c | ||
ccm.c | ||
certs.c | ||
chacha20.c | ||
chachapoly.c | ||
cipher_wrap.c | ||
cipher.c | ||
cmac.c | ||
CMakeLists.txt | ||
ctr_drbg.c | ||
debug.c | ||
des.c | ||
dhm.c | ||
ecdh.c | ||
ecdsa.c | ||
ecjpake.c | ||
ecp_curves.c | ||
ecp.c | ||
entropy_poll.c | ||
entropy.c | ||
error.c | ||
gcm.c | ||
havege.c | ||
hkdf.c | ||
hmac_drbg.c | ||
Makefile | ||
md2.c | ||
md4.c | ||
md5.c | ||
md.c | ||
memory_buffer_alloc.c | ||
net_sockets.c | ||
nist_kw.c | ||
oid.c | ||
padlock.c | ||
pem.c | ||
pk_wrap.c | ||
pk.c | ||
pkcs5.c | ||
pkcs11.c | ||
pkcs12.c | ||
pkparse.c | ||
pkwrite.c | ||
platform_util.c | ||
platform.c | ||
poly1305.c | ||
ripemd160.c | ||
rsa_internal.c | ||
rsa.c | ||
sha1.c | ||
sha256.c | ||
sha512.c | ||
ssl_cache.c | ||
ssl_ciphersuites.c | ||
ssl_cli.c | ||
ssl_cookie.c | ||
ssl_srv.c | ||
ssl_ticket.c | ||
ssl_tls.c | ||
threading.c | ||
timing.c | ||
version_features.c | ||
version.c | ||
x509_create.c | ||
x509_crl.c | ||
x509_crt.c | ||
x509_csr.c | ||
x509.c | ||
x509write_crt.c | ||
x509write_csr.c | ||
xtea.c |