mbedtls/library
Hanno Becker c4e4210aab Introduce md_internal.h
Recall that in the default configuration, Mbed TLS provides access
digest implementations through two layers of indirection:

1) Call of MD API (e.g. mbedtls_md_update())
2) Call of function pointer from MD info structure
3) Actual digest implementation (e.g. mbedtls_sha256_update()).

Ideally, if only a single digest is enabled - say SHA-256 - then calling
mbedtls_md_update() should _directly_ jump to mbedtls_sha256_update(),
with both layers of indirection removed. So far, however, setting
MBEDTLS_MD_SINGLE_HASH will only remove the second - function pointer -
layer of indirection, while keeping the non-inlined stub implementations
of e.g. mbedtls_md_update() around.

This commit is a step towards allowing to define implementations of
the MD API as `static inline` in case we know that they are so small
that they should be defined in md.h and not in md.c.

In a nutshell, the approach is as follows: For an MD API function
mbedtls_md_xxx() that should be inlin-able, introduce its implementation
as a `static inline` wrapper `mbedtls_md_xxx_internal()` in md.h,
and then define mbedtls_md_xxx() either in md.h or in md.c, by just
calling mbedtls_md_xxx_internal().

Moving the implementations of those MD API functions that should be
inlinable to md.h requires the presence of both the MD info struct
and all specific digest wrapper functions in md.h, and this is what
this commit ensures, by moving them from md.c into a new internal
header file md_internal.h. Implementing the aforementioned wrappers for
those MD API that should be inlinable is left for subsequent commits.
2019-09-09 09:45:57 +01:00
..
.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 Fixup certs.c: Remove redundant TinyCrypt guard 2019-09-04 16:19:49 +01:00
chacha20.c
chachapoly.c
cipher_wrap.c
cipher.c
cmac.c
CMakeLists.txt Inline md_wrap.c in md.c 2019-09-09 09:45:57 +01:00
ctr_drbg.c
debug.c
des.c
dhm.c
ecdh.c
ecdsa.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
ecjpake.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
ecp_curves.c
ecp.c
entropy_poll.c
entropy.c
error.c
gcm.c
havege.c
hkdf.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
hmac_drbg.c Introduce getter for MD handle from MD context 2019-09-09 09:45:57 +01:00
Makefile Inline md_wrap.c in md.c 2019-09-09 09:45:57 +01:00
md2.c
md4.c
md5.c
md.c Introduce md_internal.h 2019-09-09 09:45:57 +01:00
memory_buffer_alloc.c
net_sockets.c
nist_kw.c
oid.c Fixup: Add missing TinyCrypt guards 2019-09-04 16:17:45 +01:00
padlock.c
pem.c
pk_wrap.c Fixup TinyCrypt PK wrap: Check TinyCrypt signature return code 2019-09-04 16:19:49 +01:00
pk.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
pkcs5.c Introduce getter for MD handle from MD context 2019-09-09 09:45:57 +01:00
pkcs11.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
pkcs12.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
pkparse.c Fixup TinyCrypt PK parse: Correct function name in comment 2019-09-04 16:19:49 +01:00
pkwrite.c Fixup: Add missing TinyCrypt guards 2019-09-04 16:17:45 +01:00
platform_util.c
platform.c
poly1305.c
ripemd160.c
rsa_internal.c
rsa.c Introduce getter for MD handle from MD context 2019-09-09 09:45:57 +01:00
sha1.c
sha256.c Completely ignore is224 if SHA-224 is disabled 2019-09-09 10:21:30 +02:00
sha512.c
ssl_cache.c Remove compression field from SSL session if compression disabled 2019-08-01 10:11:20 +02:00
ssl_ciphersuites.c Fixup: Add missing TinyCrypt guards 2019-09-04 16:17:45 +01:00
ssl_cli.c TinyCrypt ECDHE-PSK: Implement ClientKeyExchange writing 2019-09-04 16:19:49 +01:00
ssl_cookie.c Remove dependency of ssl_cookie on SHA-224 2019-09-09 10:21:30 +02:00
ssl_srv.c TinyCrypt ECDHE-PSK: Implement CliKeyExchange parsing 2019-09-04 16:19:49 +01:00
ssl_ticket.c
ssl_tls.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
threading.c
timing.c
version_features.c Add MBEDTLS_SHA256_NO_SHA244 option (unimplemented) 2019-09-09 09:06:56 +02:00
version.c
x509_create.c
x509_crl.c
x509_crt.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
x509_csr.c
x509.c Introduce MD handle type 2019-09-09 09:45:57 +01:00
x509write_crt.c
x509write_csr.c
xtea.c