From aafbdc8d389f3a202cbf6b33b559f1f856c48756 Mon Sep 17 00:00:00 2001 From: ccli8 Date: Mon, 6 Nov 2017 11:37:29 +0800 Subject: [PATCH] [NUC472/M487] Fix compile error with disabled crypto For example, even though MBEDTLS_SHA512_C is disabled (via #undef MBEDTLS_SHA512_C), mbedtls_sha512_context is still necessary due to referenced in sha512.h. --- .../targets/TARGET_NUVOTON/TARGET_M480/aes/aes_alt.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_M480/des/des_alt.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt_sw.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt.h | 2 -- .../TARGET_NUVOTON/TARGET_M480/sha/sha256_alt_sw.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h | 2 -- .../TARGET_NUVOTON/TARGET_M480/sha/sha512_alt_sw.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h | 8 -------- .../targets/TARGET_NUVOTON/TARGET_NUC472/aes/aes_alt.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_NUC472/des/des_alt.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt.h | 2 -- .../TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt_sw.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt.h | 2 -- .../TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt_sw.h | 2 -- .../targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h | 6 ------ 16 files changed, 42 deletions(-) diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/aes/aes_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/aes/aes_alt.h index e907fd62e3..23625b5b67 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/aes/aes_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/aes/aes_alt.h @@ -25,7 +25,6 @@ #include "mbedtls/aes.h" -#if defined(MBEDTLS_AES_C) #if defined(MBEDTLS_AES_ALT) // Regular implementation // @@ -259,6 +258,5 @@ void mbedtls_aes_decrypt( mbedtls_aes_context *ctx, #endif /* MBEDTLS_AES_ALT */ -#endif /* MBEDTLS_AES_C */ #endif /* aes_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/des/des_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/des/des_alt.h index 9fda2763a1..09b693c524 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/des/des_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/des/des_alt.h @@ -19,7 +19,6 @@ #include "mbedtls/des.h" -#if defined(MBEDTLS_DES_C) #if defined(MBEDTLS_DES_ALT) #include @@ -271,6 +270,5 @@ void mbedtls_des_setkey( uint32_t SK[32], #endif #endif /* MBEDTLS_DES_ALT */ -#endif /* MBEDTLS_DES_C */ #endif /* des_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt.h index 9471b628ba..9e1fa6a73d 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt.h @@ -18,7 +18,6 @@ #include "mbedtls/sha1.h" -#if defined(MBEDTLS_SHA1_C) #if defined(MBEDTLS_SHA1_ALT) #include "sha_alt_hw.h" @@ -95,6 +94,5 @@ void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[6 #endif #endif /* MBEDTLS_SHA1_ALT */ -#endif /* MBEDTLS_SHA1_C */ #endif /* sha1_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt_sw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt_sw.h index 416779ed3c..5ba3aa853d 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt_sw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt_sw.h @@ -23,7 +23,6 @@ #ifndef MBEDTLS_SHA1_ALT_SW_H #define MBEDTLS_SHA1_ALT_SW_H -#if defined(MBEDTLS_SHA1_C) #if defined(MBEDTLS_SHA1_ALT) #include @@ -98,6 +97,5 @@ void mbedtls_sha1_sw_process( mbedtls_sha1_sw_context *ctx, const unsigned char #endif #endif /* MBEDTLS_SHA1_ALT */ -#endif /* MBEDTLS_SHA1_C */ #endif /* sha1_alt_sw.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt.h index eedca82eea..53ca35ffd3 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt.h @@ -18,7 +18,6 @@ #include "mbedtls/sha256.h" -#if defined(MBEDTLS_SHA256_C) #if defined(MBEDTLS_SHA256_ALT) #include "sha_alt_hw.h" @@ -97,6 +96,5 @@ void mbedtls_sha256_process( mbedtls_sha256_context *ctx, const unsigned char da #endif #endif /* MBEDTLS_SHA256_ALT */ -#endif /* MBEDTLS_SHA256_C */ #endif /* sha256_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt_sw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt_sw.h index c10b08144e..6c292b7516 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt_sw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt_sw.h @@ -23,7 +23,6 @@ #ifndef MBEDTLS_SHA256_ALT_SW_H #define MBEDTLS_SHA256_ALT_SW_H -#if defined(MBEDTLS_SHA256_C) #if defined(MBEDTLS_SHA256_ALT) #include @@ -101,6 +100,5 @@ void mbedtls_sha256_sw_process( mbedtls_sha256_sw_context *ctx, const unsigned c #endif #endif /* MBEDTLS_SHA256_ALT */ -#endif /* MBEDTLS_SHA256_C */ #endif /* sha256_alt_sw.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h index f4c6f75b37..a028beeeb0 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h @@ -18,7 +18,6 @@ #include "mbedtls/sha512.h" -#if defined(MBEDTLS_SHA512_C) #if defined(MBEDTLS_SHA512_ALT) #include "sha_alt_hw.h" @@ -97,6 +96,5 @@ void mbedtls_sha512_process( mbedtls_sha512_context *ctx, const unsigned char da #endif #endif /* MBEDTLS_SHA512_ALT */ -#endif /* MBEDTLS_SHA512_C */ #endif /* sha512_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt_sw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt_sw.h index 485d01105b..6c0aed4056 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt_sw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt_sw.h @@ -23,7 +23,6 @@ #ifndef MBEDTLS_SHA512_ALT_SW_H #define MBEDTLS_SHA512_ALT_SW_H -#if defined(MBEDTLS_SHA512_C) #if defined(MBEDTLS_SHA512_ALT) #include @@ -101,6 +100,5 @@ void mbedtls_sha512_sw_process( mbedtls_sha512_sw_context *ctx, const unsigned c #endif #endif /* MBEDTLS_SHA512_ALT */ -#endif /* MBEDTLS_SHA512_C */ #endif /* sha512_alt_sw.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h index bc833c2e5d..e8cad3b2de 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h @@ -16,7 +16,6 @@ #ifndef MBEDTLS_SHA_ALT_HW_H #define MBEDTLS_SHA_ALT_HW_H -#if defined(MBEDTLS_SHA1_C) || defined(MBEDTLS_SHA256_C) || defined(MBEDTLS_SHA512_C) #if defined(MBEDTLS_SHA1_ALT) || defined(MBEDTLS_SHA256_ALT) || defined(MBEDTLS_SHA512_ALT) #include @@ -44,7 +43,6 @@ void crypto_sha_update(crypto_sha_context *ctx, const unsigned char *input, size void crypto_sha_update_nobuf(crypto_sha_context *ctx, const unsigned char *input, size_t ilen, int islast); void crypto_sha_getinternstate(unsigned char output[], size_t olen); -#if defined(MBEDTLS_SHA1_C) #if defined(MBEDTLS_SHA1_ALT) void mbedtls_sha1_hw_init( crypto_sha_context *ctx ); @@ -57,9 +55,7 @@ void mbedtls_sha1_hw_finish( crypto_sha_context *ctx, unsigned char output[20] ) void mbedtls_sha1_hw_process( crypto_sha_context *ctx, const unsigned char data[64] ); #endif /* MBEDTLS_SHA1_ALT */ -#endif /* MBEDTLS_SHA1_C */ -#if defined(MBEDTLS_SHA256_C) #if defined(MBEDTLS_SHA256_ALT) void mbedtls_sha256_hw_init( crypto_sha_context *ctx ); @@ -73,9 +69,7 @@ void mbedtls_sha256_hw_finish( crypto_sha_context *ctx, unsigned char output[32] void mbedtls_sha256_hw_process( crypto_sha_context *ctx, const unsigned char data[64] ); #endif /* MBEDTLS_SHA256_ALT */ -#endif /* MBEDTLS_SHA256_C */ -#if defined(MBEDTLS_SHA512_C) #if defined(MBEDTLS_SHA512_ALT) void mbedtls_sha512_hw_init( crypto_sha_context *ctx ); @@ -89,13 +83,11 @@ void mbedtls_sha512_hw_finish( crypto_sha_context *ctx, unsigned char output[64] void mbedtls_sha512_hw_process( crypto_sha_context *ctx, const unsigned char data[128] ); #endif /* MBEDTLS_SHA512_ALT */ -#endif /* MBEDTLS_SHA512_C */ #ifdef __cplusplus } #endif #endif /* MBEDTLS_SHA1_ALT || MBEDTLS_SHA256_ALT || MBEDTLS_SHA512_ALT */ -#endif /* MBEDTLS_SHA1_C || MBEDTLS_SHA256_C || MBEDTLS_SHA512_C*/ #endif /* sha_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/aes/aes_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/aes/aes_alt.h index e907fd62e3..23625b5b67 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/aes/aes_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/aes/aes_alt.h @@ -25,7 +25,6 @@ #include "mbedtls/aes.h" -#if defined(MBEDTLS_AES_C) #if defined(MBEDTLS_AES_ALT) // Regular implementation // @@ -259,6 +258,5 @@ void mbedtls_aes_decrypt( mbedtls_aes_context *ctx, #endif /* MBEDTLS_AES_ALT */ -#endif /* MBEDTLS_AES_C */ #endif /* aes_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/des/des_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/des/des_alt.h index 9fda2763a1..09b693c524 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/des/des_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/des/des_alt.h @@ -19,7 +19,6 @@ #include "mbedtls/des.h" -#if defined(MBEDTLS_DES_C) #if defined(MBEDTLS_DES_ALT) #include @@ -271,6 +270,5 @@ void mbedtls_des_setkey( uint32_t SK[32], #endif #endif /* MBEDTLS_DES_ALT */ -#endif /* MBEDTLS_DES_C */ #endif /* des_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt.h index 9471b628ba..9e1fa6a73d 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt.h @@ -18,7 +18,6 @@ #include "mbedtls/sha1.h" -#if defined(MBEDTLS_SHA1_C) #if defined(MBEDTLS_SHA1_ALT) #include "sha_alt_hw.h" @@ -95,6 +94,5 @@ void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[6 #endif #endif /* MBEDTLS_SHA1_ALT */ -#endif /* MBEDTLS_SHA1_C */ #endif /* sha1_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt_sw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt_sw.h index 3be7272be6..7c84756481 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt_sw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha1_alt_sw.h @@ -25,7 +25,6 @@ #include "mbedtls/sha256.h" -#if defined(MBEDTLS_SHA1_C) #if defined(MBEDTLS_SHA1_ALT) #include @@ -100,6 +99,5 @@ void mbedtls_sha1_sw_process( mbedtls_sha1_sw_context *ctx, const unsigned char #endif #endif /* MBEDTLS_SHA1_ALT */ -#endif /* MBEDTLS_SHA1_C */ #endif /* sha1_alt_sw.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt.h index eedca82eea..53ca35ffd3 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt.h @@ -18,7 +18,6 @@ #include "mbedtls/sha256.h" -#if defined(MBEDTLS_SHA256_C) #if defined(MBEDTLS_SHA256_ALT) #include "sha_alt_hw.h" @@ -97,6 +96,5 @@ void mbedtls_sha256_process( mbedtls_sha256_context *ctx, const unsigned char da #endif #endif /* MBEDTLS_SHA256_ALT */ -#endif /* MBEDTLS_SHA256_C */ #endif /* sha256_alt.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt_sw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt_sw.h index feb75a3604..bd96f5cdda 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt_sw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha256_alt_sw.h @@ -25,7 +25,6 @@ #include "mbedtls/sha256.h" -#if defined(MBEDTLS_SHA256_C) #if defined(MBEDTLS_SHA256_ALT) #include @@ -103,6 +102,5 @@ void mbedtls_sha256_sw_process( mbedtls_sha256_sw_context *ctx, const unsigned c #endif #endif /* MBEDTLS_SHA256_ALT */ -#endif /* MBEDTLS_SHA256_C */ #endif /* sha256_alt_sw.h */ diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h index b43ac43e46..c66632b9de 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h @@ -16,7 +16,6 @@ #ifndef MBEDTLS_SHA_ALT_HW_H #define MBEDTLS_SHA_ALT_HW_H -#if defined(MBEDTLS_SHA1_C) || defined(MBEDTLS_SHA256_C) || defined(MBEDTLS_SHA512_C) #if defined(MBEDTLS_SHA1_ALT) || defined(MBEDTLS_SHA256_ALT) || defined(MBEDTLS_SHA512_ALT) #include @@ -44,7 +43,6 @@ void crypto_sha_update(crypto_sha_context *ctx, const unsigned char *input, size void crypto_sha_update_nobuf(crypto_sha_context *ctx, const unsigned char *input, size_t ilen, int islast); void crypto_sha_getinternstate(unsigned char output[], size_t olen); -#if defined(MBEDTLS_SHA1_C) #if defined(MBEDTLS_SHA1_ALT) void mbedtls_sha1_hw_init( crypto_sha_context *ctx ); @@ -57,9 +55,7 @@ void mbedtls_sha1_hw_finish( crypto_sha_context *ctx, unsigned char output[20] ) void mbedtls_sha1_hw_process( crypto_sha_context *ctx, const unsigned char data[64] ); #endif /* MBEDTLS_SHA1_ALT */ -#endif /* MBEDTLS_SHA1_C */ -#if defined(MBEDTLS_SHA256_C) #if defined(MBEDTLS_SHA256_ALT) void mbedtls_sha256_hw_init( crypto_sha_context *ctx ); @@ -73,13 +69,11 @@ void mbedtls_sha256_hw_finish( crypto_sha_context *ctx, unsigned char output[32] void mbedtls_sha256_hw_process( crypto_sha_context *ctx, const unsigned char data[64] ); #endif /* MBEDTLS_SHA256_ALT */ -#endif /* MBEDTLS_SHA256_C */ #ifdef __cplusplus } #endif #endif /* MBEDTLS_SHA1_ALT || MBEDTLS_SHA256_ALT || MBEDTLS_SHA512_ALT */ -#endif /* MBEDTLS_SHA1_C || MBEDTLS_SHA256_C || MBEDTLS_SHA512_C */ #endif /* sha_alt_hw.h */