Introduce MBEDTLS_OPTIMIZE_TINYCRYPT_ASM

Make the ASM optimizations in tinycrypt optional.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h
index 5e2a661..f08aea5 100644
--- a/include/mbedtls/check_config.h
+++ b/include/mbedtls/check_config.h
@@ -130,6 +130,12 @@
 #error "MBEDTLS_USE_TINYCRYPT defined, but not all prerequesites"
 #endif
 
+#if defined(MBEDTLS_OPTIMIZE_TINYCRYPT_ASM) &&           \
+    ( !defined(MBEDTLS_HAVE_ASM) || \
+      !defined(MBEDTLS_USE_TINYCRYPT) )
+#error "MBEDTLS_OPTIMIZE_TINYCRYPT_ASM defined, but not all prerequesites"
+#endif
+
 #if defined(MBEDTLS_NIST_KW_C) && \
     ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) )
 #error "MBEDTLS_NIST_KW_C defined, but not all prerequisites"
diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h
index 06cdde9..3587bba 100644
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -2703,6 +2703,21 @@
 //#define MBEDTLS_USE_TINYCRYPT
 
 /**
+ * \def MBEDTLS_OPTIMIZE_TINYCRYPT_ASM
+ *
+ * Optimize TinyCrypt operations using assembly.
+ * Add T32/A32 assembly for core tinycrypt/microecc routines, for ARMC5 and GCC;
+ * Use fast integer types to avoid frequent narrowing instructions;
+ * Use __builtin_clz and avoid boolean ops.
+ *
+ * Requires: MBEDTLS_USE_TINYCRYPT
+ *           MBEDTLS_HAVE_ASM
+ *
+ * Module:  tinycrypt/ecc.c
+ */
+//#define MBEDTLS_OPTIMIZE_TINYCRYPT_ASM
+
+/**
  * \def MBEDTLS_ENTROPY_C
  *
  * Enable the platform-specific entropy code.