Consistently use the name tinycrypt over uecc

We called in tinycrypt in the file names, but uecc in config.h, all.sh and
other places, which could be confusing. Just use tinycrypt everywhere because
that's the name of the project and repo where we took the files.

The changes were made using the following commands (with GNU sed and zsh):

sed -i 's/uecc/tinycrypt/g' **/*.[ch] tests/scripts/all.sh
sed -i 's/MBEDTLS_USE_UECC/MBEDTLS_USE_TINYCRYPT/g' **/*.[ch] tests/scripts/all.sh scripts/config.pl
This commit is contained in:
Manuel Pégourié-Gonnard 2019-05-09 11:24:11 +02:00
parent 8751e35751
commit afdc1b5cbd
12 changed files with 36 additions and 36 deletions

View File

@ -87,8 +87,8 @@
#error "MBEDTLS_CMAC_C defined, but not all prerequisites" #error "MBEDTLS_CMAC_C defined, but not all prerequisites"
#endif #endif
#if defined(MBEDTLS_USE_UECC) && defined(MBEDTLS_NO_64BIT_MULTIPLICATION) #if defined(MBEDTLS_USE_TINYCRYPT) && defined(MBEDTLS_NO_64BIT_MULTIPLICATION)
#error "MBEDTLS_USE_UECC defined, but it cannot be defined with MBEDTLS_NO_64BIT_MULTIPLICATION" #error "MBEDTLS_USE_TINYCRYPT defined, but it cannot be defined with MBEDTLS_NO_64BIT_MULTIPLICATION"
#endif #endif
#if defined(MBEDTLS_NIST_KW_C) && \ #if defined(MBEDTLS_NIST_KW_C) && \

View File

@ -2255,7 +2255,7 @@
#define MBEDTLS_ECP_C #define MBEDTLS_ECP_C
/** /**
* \def MBEDTLS_USE_UECC * \def MBEDTLS_USE_TINYCRYPT
* *
* Enable the tinycrypt ECC library. * Enable the tinycrypt ECC library.
* *
@ -2266,7 +2266,7 @@
* This module provides alternative ECC handling functions replacing * This module provides alternative ECC handling functions replacing
* native MBEDTLS ECP module. * native MBEDTLS ECP module.
*/ */
//#define MBEDTLS_USE_UECC //#define MBEDTLS_USE_TINYCRYPT
/** /**
* \def MBEDTLS_ENTROPY_C * \def MBEDTLS_ENTROPY_C

View File

@ -68,7 +68,7 @@
* *
*/ */
#if defined(MBEDTLS_USE_UECC) #if defined(MBEDTLS_USE_TINYCRYPT)
#ifndef __TC_UECC_H__ #ifndef __TC_UECC_H__
#define __TC_UECC_H__ #define __TC_UECC_H__
@ -544,4 +544,4 @@ void uECC_vli_bytesToNative(unsigned int *native, const uint8_t *bytes,
#endif #endif
#endif /* __TC_UECC_H__ */ #endif /* __TC_UECC_H__ */
#endif /* MBEDTLS_USE_UECC */ #endif /* MBEDTLS_USE_TINYCRYPT */

View File

@ -66,7 +66,7 @@
* Security: The curve NIST p-256 provides approximately 128 bits of security. * 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__ #ifndef __TC_ECC_DH_H__
#define __TC_ECC_DH_H__ #define __TC_ECC_DH_H__
@ -130,4 +130,4 @@ int uECC_shared_secret(const uint8_t *p_public_key, const uint8_t *p_private_key
#endif #endif
#endif /* __TC_ECC_DH_H__ */ #endif /* __TC_ECC_DH_H__ */
#endif /* MBEDTLS_USE_UECC */ #endif /* MBEDTLS_USE_TINYCRYPT */

View File

@ -75,7 +75,7 @@
* the signer's public key and the signature values (r and s). * 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__ #ifndef __TC_ECC_DSA_H__
#define __TC_ECC_DSA_H__ #define __TC_ECC_DSA_H__
@ -138,4 +138,4 @@ int uECC_verify(const uint8_t *p_public_key, const uint8_t *p_message_hash,
#endif #endif
#endif /* __TC_ECC_DSA_H__ */ #endif /* __TC_ECC_DSA_H__ */
#endif /* MBEDTLS_USE_UECC */ #endif /* MBEDTLS_USE_TINYCRYPT */

View File

@ -612,9 +612,9 @@ static const char *features[] = {
#if defined(MBEDTLS_ECP_C) #if defined(MBEDTLS_ECP_C)
"MBEDTLS_ECP_C", "MBEDTLS_ECP_C",
#endif /* MBEDTLS_ECP_C */ #endif /* MBEDTLS_ECP_C */
#if defined(MBEDTLS_USE_UECC) #if defined(MBEDTLS_USE_TINYCRYPT)
"MBEDTLS_USE_UECC", "MBEDTLS_USE_TINYCRYPT",
#endif /* MBEDTLS_USE_UECC */ #endif /* MBEDTLS_USE_TINYCRYPT */
#if defined(MBEDTLS_ENTROPY_C) #if defined(MBEDTLS_ENTROPY_C)
"MBEDTLS_ENTROPY_C", "MBEDTLS_ENTROPY_C",
#endif /* MBEDTLS_ENTROPY_C */ #endif /* MBEDTLS_ENTROPY_C */

View File

@ -1674,13 +1674,13 @@ int query_config( const char *config )
} }
#endif /* MBEDTLS_ECP_C */ #endif /* MBEDTLS_ECP_C */
#if defined(MBEDTLS_USE_UECC) #if defined(MBEDTLS_USE_TINYCRYPT)
if( strcmp( "MBEDTLS_USE_UECC", config ) == 0 ) if( strcmp( "MBEDTLS_USE_TINYCRYPT", config ) == 0 )
{ {
MACRO_EXPANSION_TO_STR( MBEDTLS_USE_UECC ); MACRO_EXPANSION_TO_STR( MBEDTLS_USE_TINYCRYPT );
return( 0 ); return( 0 );
} }
#endif /* MBEDTLS_USE_UECC */ #endif /* MBEDTLS_USE_TINYCRYPT */
#if defined(MBEDTLS_ENTROPY_C) #if defined(MBEDTLS_ENTROPY_C)
if( strcmp( "MBEDTLS_ENTROPY_C", config ) == 0 ) if( strcmp( "MBEDTLS_ENTROPY_C", config ) == 0 )

View File

@ -98,7 +98,7 @@ MBEDTLS_ZLIB_SUPPORT
MBEDTLS_PKCS11_C MBEDTLS_PKCS11_C
MBEDTLS_NO_UDBL_DIVISION MBEDTLS_NO_UDBL_DIVISION
MBEDTLS_NO_64BIT_MULTIPLICATION MBEDTLS_NO_64BIT_MULTIPLICATION
MBEDTLS_USE_UECC MBEDTLS_USE_TINYCRYPT
_ALT\s*$ _ALT\s*$
); );

View File

@ -1030,16 +1030,16 @@ component_test_no_64bit_multiplication () {
make test make test
} }
component_build_uecc_cmake () { component_build_tinycrypt_cmake () {
msg "build: uecc native, cmake" msg "build: tinycrypt native, cmake"
scripts/config.pl set MBEDTLS_USE_UECC scripts/config.pl set MBEDTLS_USE_TINYCRYPT
CC=gcc cmake . CC=gcc cmake .
make make
} }
component_build_uecc_make () { component_build_tinycrypt_make () {
msg "build: uecc native, make" msg "build: tinycrypt native, make"
scripts/config.pl set MBEDTLS_USE_UECC scripts/config.pl set MBEDTLS_USE_TINYCRYPT
make CC=gcc CFLAGS='-Werror -O1' make CC=gcc CFLAGS='-Werror -O1'
} }
@ -1138,10 +1138,10 @@ component_build_armcc () {
armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a" armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a"
} }
component_build_armcc_uecc_baremetal () { component_build_armcc_tinycrypt_baremetal () {
msg "build: ARM Compiler 5, make with uecc and baremetal" msg "build: ARM Compiler 5, make with tinycrypt and baremetal"
scripts/config.pl 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 CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib
make clean make clean

View File

@ -52,7 +52,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#if defined(MBEDTLS_USE_UECC) #if defined(MBEDTLS_USE_TINYCRYPT)
#include <tinycrypt/ecc.h> #include <tinycrypt/ecc.h>
#include <string.h> #include <string.h>
@ -938,6 +938,6 @@ int uECC_compute_public_key(const uint8_t *private_key, uint8_t *public_key,
return 1; return 1;
} }
#else #else
typedef int mbedtls_dummy_uecc_def; typedef int mbedtls_dummy_tinycrypt_def;
#endif /* MBEDTLS_USE_UECC */ #endif /* MBEDTLS_USE_TINYCRYPT */

View File

@ -54,7 +54,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#if defined(MBEDTLS_USE_UECC) #if defined(MBEDTLS_USE_TINYCRYPT)
#include <tinycrypt/ecc.h> #include <tinycrypt/ecc.h>
#include <tinycrypt/ecc_dh.h> #include <tinycrypt/ecc_dh.h>
#include <string.h> #include <string.h>
@ -197,5 +197,5 @@ clear_and_out:
return r; return r;
} }
#else #else
typedef int mbedtls_dummy_uecc_def; typedef int mbedtls_dummy_tinycrypt_def;
#endif /* MBEDTLS_USE_UECC */ #endif /* MBEDTLS_USE_TINYCRYPT */

View File

@ -53,7 +53,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#if defined(MBEDTLS_USE_UECC) #if defined(MBEDTLS_USE_TINYCRYPT)
#include <tinycrypt/ecc.h> #include <tinycrypt/ecc.h>
#include <tinycrypt/ecc_dsa.h> #include <tinycrypt/ecc_dsa.h>
@ -293,5 +293,5 @@ int uECC_verify(const uint8_t *public_key, const uint8_t *message_hash,
return (int)(uECC_vli_equal(rx, r, num_words) == 0); return (int)(uECC_vli_equal(rx, r, num_words) == 0);
} }
#else #else
typedef int mbedtls_dummy_uecc_def; typedef int mbedtls_dummy_tinycrypt_def;
#endif /* MBEDTLS_USE_UECC */ #endif /* MBEDTLS_USE_TINYCRYPT */