Merge remote-tracking branch 'origin/pr/565' into baremetal
diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h
index 413713c..30e25bf 100644
--- a/include/mbedtls/check_config.h
+++ b/include/mbedtls/check_config.h
@@ -87,8 +87,8 @@
 #error "MBEDTLS_CMAC_C defined, but not all prerequisites"
 #endif
 
-#if defined(MBEDTLS_USE_UECC) && defined(MBEDTLS_NO_64BIT_MULTIPLICATION)
-#error "MBEDTLS_USE_UECC defined, but it cannot be defined with MBEDTLS_NO_64BIT_MULTIPLICATION"
+#if defined(MBEDTLS_USE_TINYCRYPT) && defined(MBEDTLS_NO_64BIT_MULTIPLICATION)
+#error "MBEDTLS_USE_TINYCRYPT defined, but it cannot be defined with MBEDTLS_NO_64BIT_MULTIPLICATION"
 #endif
 
 #if defined(MBEDTLS_NIST_KW_C) && \
diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h
index 24501ab..4805537 100644
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -2279,18 +2279,20 @@
 #define MBEDTLS_ECP_C
 
 /**
- * \def MBEDTLS_USE_UECC
+ * \def MBEDTLS_USE_TINYCRYPT
  *
- * Enable the tinycrypt ECC library.
+ * Enable the TinyCrypt ECC library. This module provides alternative ECC
+ * handling functions replacing the native Mbed TLS ECP module.
+ *
+ * TinyCrypt is a project independent from Mbed TLS, licensed under 3-clause
+ * BSD, and can be found at https://github.com/intel/tinycrypt - this option
+ * only enables the ECC modules from TinyCrypt.
  *
  * Module:  tinycrypt/ecc.c
  *          tinycrypt/ecc_dh.c
  *          tinycrypt/ecc_dsa.c
- *
- * This module provides alternative ECC handling functions replacing
- * native MBEDTLS ECP module.
  */
-//#define MBEDTLS_USE_UECC
+//#define MBEDTLS_USE_TINYCRYPT
 
 /**
  * \def MBEDTLS_ENTROPY_C
diff --git a/include/tinycrypt/ecc.h b/include/tinycrypt/ecc.h
index ede7544..37a7ef1 100644
--- a/include/tinycrypt/ecc.h
+++ b/include/tinycrypt/ecc.h
@@ -68,7 +68,7 @@
  *
  */
 
-#if defined(MBEDTLS_USE_UECC)
+#if defined(MBEDTLS_USE_TINYCRYPT)
 #ifndef __TC_UECC_H__
 #define __TC_UECC_H__
 
@@ -544,4 +544,4 @@
 #endif
 
 #endif /* __TC_UECC_H__ */
-#endif /* MBEDTLS_USE_UECC */
+#endif /* MBEDTLS_USE_TINYCRYPT */
diff --git a/include/tinycrypt/ecc_dh.h b/include/tinycrypt/ecc_dh.h
index 18a4fd2..c680a77 100644
--- a/include/tinycrypt/ecc_dh.h
+++ b/include/tinycrypt/ecc_dh.h
@@ -66,7 +66,7 @@
  *  Security: The curve NIST p-256 provides approximately 128 bits of security.
  */
 
-#if defined(MBEDTLS_USE_UECC)
+#if defined(MBEDTLS_USE_TINYCRYPT)
 #ifndef __TC_ECC_DH_H__
 #define __TC_ECC_DH_H__
 
@@ -130,4 +130,4 @@
 #endif
 
 #endif /* __TC_ECC_DH_H__ */
-#endif /* MBEDTLS_USE_UECC */
+#endif /* MBEDTLS_USE_TINYCRYPT */
diff --git a/include/tinycrypt/ecc_dsa.h b/include/tinycrypt/ecc_dsa.h
index 8065340..cc5eebc 100644
--- a/include/tinycrypt/ecc_dsa.h
+++ b/include/tinycrypt/ecc_dsa.h
@@ -75,7 +75,7 @@
  *          the signer's public key and the signature values (r and s).
  */
 
-#if defined(MBEDTLS_USE_UECC)
+#if defined(MBEDTLS_USE_TINYCRYPT)
 #ifndef __TC_ECC_DSA_H__
 #define __TC_ECC_DSA_H__
 
@@ -138,4 +138,4 @@
 #endif
 
 #endif /* __TC_ECC_DSA_H__ */
-#endif /* MBEDTLS_USE_UECC */
+#endif /* MBEDTLS_USE_TINYCRYPT */
diff --git a/library/version_features.c b/library/version_features.c
index 74a0a0e..a675bb6 100644
--- a/library/version_features.c
+++ b/library/version_features.c
@@ -615,9 +615,9 @@
 #if defined(MBEDTLS_ECP_C)
     "MBEDTLS_ECP_C",
 #endif /* MBEDTLS_ECP_C */
-#if defined(MBEDTLS_USE_UECC)
-    "MBEDTLS_USE_UECC",
-#endif /* MBEDTLS_USE_UECC */
+#if defined(MBEDTLS_USE_TINYCRYPT)
+    "MBEDTLS_USE_TINYCRYPT",
+#endif /* MBEDTLS_USE_TINYCRYPT */
 #if defined(MBEDTLS_ENTROPY_C)
     "MBEDTLS_ENTROPY_C",
 #endif /* MBEDTLS_ENTROPY_C */
diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c
index 6c76f47..57bf2e7 100644
--- a/programs/ssl/query_config.c
+++ b/programs/ssl/query_config.c
@@ -1682,13 +1682,13 @@
     }
 #endif /* MBEDTLS_ECP_C */
 
-#if defined(MBEDTLS_USE_UECC)
-    if( strcmp( "MBEDTLS_USE_UECC", config ) == 0 )
+#if defined(MBEDTLS_USE_TINYCRYPT)
+    if( strcmp( "MBEDTLS_USE_TINYCRYPT", config ) == 0 )
     {
-        MACRO_EXPANSION_TO_STR( MBEDTLS_USE_UECC );
+        MACRO_EXPANSION_TO_STR( MBEDTLS_USE_TINYCRYPT );
         return( 0 );
     }
-#endif /* MBEDTLS_USE_UECC */
+#endif /* MBEDTLS_USE_TINYCRYPT */
 
 #if defined(MBEDTLS_ENTROPY_C)
     if( strcmp( "MBEDTLS_ENTROPY_C", config ) == 0 )
diff --git a/scripts/config.pl b/scripts/config.pl
index d5c2ed8..86af553 100755
--- a/scripts/config.pl
+++ b/scripts/config.pl
@@ -98,7 +98,7 @@
 MBEDTLS_PKCS11_C
 MBEDTLS_NO_UDBL_DIVISION
 MBEDTLS_NO_64BIT_MULTIPLICATION
-MBEDTLS_USE_UECC
+MBEDTLS_USE_TINYCRYPT
 _ALT\s*$
 );
 
diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh
index 7bff5bc..72e7c3e 100755
--- a/tests/scripts/all.sh
+++ b/tests/scripts/all.sh
@@ -1047,16 +1047,16 @@
     make test
 }
 
-component_build_uecc_cmake () {
-    msg "build: uecc native, cmake"
-    scripts/config.pl set MBEDTLS_USE_UECC
+component_build_tinycrypt_cmake () {
+    msg "build: tinycrypt native, cmake"
+    scripts/config.pl set MBEDTLS_USE_TINYCRYPT
     CC=gcc cmake .
     make
 }
 
-component_build_uecc_make () {
-    msg "build: uecc native, make"
-    scripts/config.pl set MBEDTLS_USE_UECC
+component_build_tinycrypt_make () {
+    msg "build: tinycrypt native, make"
+    scripts/config.pl set MBEDTLS_USE_TINYCRYPT
     make CC=gcc CFLAGS='-Werror -O1'
 }
 
@@ -1155,10 +1155,10 @@
     armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a"
 }
 
-component_build_armcc_uecc_baremetal () {
-    msg "build: ARM Compiler 5, make with uecc and baremetal"
+component_build_armcc_tinycrypt_baremetal () {
+    msg "build: ARM Compiler 5, make with tinycrypt and baremetal"
     scripts/config.pl baremetal
-    scripts/config.pl set MBEDTLS_USE_UECC
+    scripts/config.pl set MBEDTLS_USE_TINYCRYPT
 
     make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib
     make clean
diff --git a/tinycrypt/ecc.c b/tinycrypt/ecc.c
index 090f691..2e694cc 100644
--- a/tinycrypt/ecc.c
+++ b/tinycrypt/ecc.c
@@ -52,7 +52,7 @@
  *  POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if defined(MBEDTLS_USE_UECC)
+#if defined(MBEDTLS_USE_TINYCRYPT)
 #include <tinycrypt/ecc.h>
 #include <string.h>
 
@@ -938,6 +938,6 @@
 	return 1;
 }
 #else
-typedef int mbedtls_dummy_uecc_def;
-#endif /* MBEDTLS_USE_UECC */
+typedef int mbedtls_dummy_tinycrypt_def;
+#endif /* MBEDTLS_USE_TINYCRYPT */
 
diff --git a/tinycrypt/ecc_dh.c b/tinycrypt/ecc_dh.c
index 5d0a52f..28dfdf9 100644
--- a/tinycrypt/ecc_dh.c
+++ b/tinycrypt/ecc_dh.c
@@ -54,7 +54,7 @@
  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  *  POSSIBILITY OF SUCH DAMAGE.
  */
-#if defined(MBEDTLS_USE_UECC)
+#if defined(MBEDTLS_USE_TINYCRYPT)
 #include <tinycrypt/ecc.h>
 #include <tinycrypt/ecc_dh.h>
 #include <string.h>
@@ -197,5 +197,5 @@
 	return r;
 }
 #else
-typedef int mbedtls_dummy_uecc_def;
-#endif /* MBEDTLS_USE_UECC */
+typedef int mbedtls_dummy_tinycrypt_def;
+#endif /* MBEDTLS_USE_TINYCRYPT */
diff --git a/tinycrypt/ecc_dsa.c b/tinycrypt/ecc_dsa.c
index ff8a78a..048fa61 100644
--- a/tinycrypt/ecc_dsa.c
+++ b/tinycrypt/ecc_dsa.c
@@ -53,7 +53,7 @@
  *  POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if defined(MBEDTLS_USE_UECC)
+#if defined(MBEDTLS_USE_TINYCRYPT)
 #include <tinycrypt/ecc.h>
 #include <tinycrypt/ecc_dsa.h>
 
@@ -293,5 +293,5 @@
 	return (int)(uECC_vli_equal(rx, r, num_words) == 0);
 }
 #else
-typedef int mbedtls_dummy_uecc_def;
-#endif /* MBEDTLS_USE_UECC */
+typedef int mbedtls_dummy_tinycrypt_def;
+#endif /* MBEDTLS_USE_TINYCRYPT */