Skip to content

Commit aafbdc8

Browse files
committed
[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.
1 parent b0228d0 commit aafbdc8

File tree

16 files changed

+0
-42
lines changed

16 files changed

+0
-42
lines changed

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/aes/aes_alt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include "mbedtls/aes.h"
2727

28-
#if defined(MBEDTLS_AES_C)
2928
#if defined(MBEDTLS_AES_ALT)
3029
// Regular implementation
3130
//
@@ -259,6 +258,5 @@ void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
259258

260259

261260
#endif /* MBEDTLS_AES_ALT */
262-
#endif /* MBEDTLS_AES_C */
263261

264262
#endif /* aes_alt.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/des/des_alt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "mbedtls/des.h"
2121

22-
#if defined(MBEDTLS_DES_C)
2322
#if defined(MBEDTLS_DES_ALT)
2423

2524
#include <stddef.h>
@@ -271,6 +270,5 @@ void mbedtls_des_setkey( uint32_t SK[32],
271270
#endif
272271

273272
#endif /* MBEDTLS_DES_ALT */
274-
#endif /* MBEDTLS_DES_C */
275273

276274
#endif /* des_alt.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include "mbedtls/sha1.h"
2020

21-
#if defined(MBEDTLS_SHA1_C)
2221
#if defined(MBEDTLS_SHA1_ALT)
2322

2423
#include "sha_alt_hw.h"
@@ -95,6 +94,5 @@ void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[6
9594
#endif
9695

9796
#endif /* MBEDTLS_SHA1_ALT */
98-
#endif /* MBEDTLS_SHA1_C */
9997

10098
#endif /* sha1_alt.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha1_alt_sw.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#ifndef MBEDTLS_SHA1_ALT_SW_H
2424
#define MBEDTLS_SHA1_ALT_SW_H
2525

26-
#if defined(MBEDTLS_SHA1_C)
2726
#if defined(MBEDTLS_SHA1_ALT)
2827

2928
#include <stddef.h>
@@ -98,6 +97,5 @@ void mbedtls_sha1_sw_process( mbedtls_sha1_sw_context *ctx, const unsigned char
9897
#endif
9998

10099
#endif /* MBEDTLS_SHA1_ALT */
101-
#endif /* MBEDTLS_SHA1_C */
102100

103101
#endif /* sha1_alt_sw.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include "mbedtls/sha256.h"
2020

21-
#if defined(MBEDTLS_SHA256_C)
2221
#if defined(MBEDTLS_SHA256_ALT)
2322

2423
#include "sha_alt_hw.h"
@@ -97,6 +96,5 @@ void mbedtls_sha256_process( mbedtls_sha256_context *ctx, const unsigned char da
9796
#endif
9897

9998
#endif /* MBEDTLS_SHA256_ALT */
100-
#endif /* MBEDTLS_SHA256_C */
10199

102100
#endif /* sha256_alt.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha256_alt_sw.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#ifndef MBEDTLS_SHA256_ALT_SW_H
2424
#define MBEDTLS_SHA256_ALT_SW_H
2525

26-
#if defined(MBEDTLS_SHA256_C)
2726
#if defined(MBEDTLS_SHA256_ALT)
2827

2928
#include <stddef.h>
@@ -101,6 +100,5 @@ void mbedtls_sha256_sw_process( mbedtls_sha256_sw_context *ctx, const unsigned c
101100
#endif
102101

103102
#endif /* MBEDTLS_SHA256_ALT */
104-
#endif /* MBEDTLS_SHA256_C */
105103

106104
#endif /* sha256_alt_sw.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include "mbedtls/sha512.h"
2020

21-
#if defined(MBEDTLS_SHA512_C)
2221
#if defined(MBEDTLS_SHA512_ALT)
2322

2423
#include "sha_alt_hw.h"
@@ -97,6 +96,5 @@ void mbedtls_sha512_process( mbedtls_sha512_context *ctx, const unsigned char da
9796
#endif
9897

9998
#endif /* MBEDTLS_SHA512_ALT */
100-
#endif /* MBEDTLS_SHA512_C */
10199

102100
#endif /* sha512_alt.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt_sw.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#ifndef MBEDTLS_SHA512_ALT_SW_H
2424
#define MBEDTLS_SHA512_ALT_SW_H
2525

26-
#if defined(MBEDTLS_SHA512_C)
2726
#if defined(MBEDTLS_SHA512_ALT)
2827

2928
#include <stddef.h>
@@ -101,6 +100,5 @@ void mbedtls_sha512_sw_process( mbedtls_sha512_sw_context *ctx, const unsigned c
101100
#endif
102101

103102
#endif /* MBEDTLS_SHA512_ALT */
104-
#endif /* MBEDTLS_SHA512_C */
105103

106104
#endif /* sha512_alt_sw.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#ifndef MBEDTLS_SHA_ALT_HW_H
1717
#define MBEDTLS_SHA_ALT_HW_H
1818

19-
#if defined(MBEDTLS_SHA1_C) || defined(MBEDTLS_SHA256_C) || defined(MBEDTLS_SHA512_C)
2019
#if defined(MBEDTLS_SHA1_ALT) || defined(MBEDTLS_SHA256_ALT) || defined(MBEDTLS_SHA512_ALT)
2120

2221
#include <stddef.h>
@@ -44,7 +43,6 @@ void crypto_sha_update(crypto_sha_context *ctx, const unsigned char *input, size
4443
void crypto_sha_update_nobuf(crypto_sha_context *ctx, const unsigned char *input, size_t ilen, int islast);
4544
void crypto_sha_getinternstate(unsigned char output[], size_t olen);
4645

47-
#if defined(MBEDTLS_SHA1_C)
4846
#if defined(MBEDTLS_SHA1_ALT)
4947

5048
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] )
5755
void mbedtls_sha1_hw_process( crypto_sha_context *ctx, const unsigned char data[64] );
5856

5957
#endif /* MBEDTLS_SHA1_ALT */
60-
#endif /* MBEDTLS_SHA1_C */
6158

62-
#if defined(MBEDTLS_SHA256_C)
6359
#if defined(MBEDTLS_SHA256_ALT)
6460

6561
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]
7369
void mbedtls_sha256_hw_process( crypto_sha_context *ctx, const unsigned char data[64] );
7470

7571
#endif /* MBEDTLS_SHA256_ALT */
76-
#endif /* MBEDTLS_SHA256_C */
7772

78-
#if defined(MBEDTLS_SHA512_C)
7973
#if defined(MBEDTLS_SHA512_ALT)
8074

8175
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]
8983
void mbedtls_sha512_hw_process( crypto_sha_context *ctx, const unsigned char data[128] );
9084

9185
#endif /* MBEDTLS_SHA512_ALT */
92-
#endif /* MBEDTLS_SHA512_C */
9386

9487
#ifdef __cplusplus
9588
}
9689
#endif
9790

9891
#endif /* MBEDTLS_SHA1_ALT || MBEDTLS_SHA256_ALT || MBEDTLS_SHA512_ALT */
99-
#endif /* MBEDTLS_SHA1_C || MBEDTLS_SHA256_C || MBEDTLS_SHA512_C*/
10092

10193
#endif /* sha_alt.h */

features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/aes/aes_alt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include "mbedtls/aes.h"
2727

28-
#if defined(MBEDTLS_AES_C)
2928
#if defined(MBEDTLS_AES_ALT)
3029
// Regular implementation
3130
//
@@ -259,6 +258,5 @@ void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
259258

260259

261260
#endif /* MBEDTLS_AES_ALT */
262-
#endif /* MBEDTLS_AES_C */
263261

264262
#endif /* aes_alt.h */

0 commit comments

Comments
 (0)