Generalize SHA256 code to allow tinycrypt support
When building with ECDSA P-256 as the signature algorithm, we are still
bringing in SHA256 and some ASN.1 code from mbed TLS. Fix part of this
by wrapping the hash functions with general routines (inline functions)
allowing to select between mbed TLS and Tinycrypt for the
implementation.
Update the Zephyr config files so that the Tinycrypt version is used
when building the ECDSA P-256 signing variant.
diff --git a/boot/zephyr/include/config-asn1.h b/boot/zephyr/include/config-asn1.h
index e772ceb..25d33fb 100644
--- a/boot/zephyr/include/config-asn1.h
+++ b/boot/zephyr/include/config-asn1.h
@@ -40,7 +40,7 @@
// #define MBEDTLS_BIGNUM_C
// #define MBEDTLS_MD_C
// #define MBEDTLS_OID_C
-#define MBEDTLS_SHA256_C
+// #define MBEDTLS_SHA256_C
#include "mbedtls/check_config.h"