Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog.d/aesce-include.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix
* Fix compilation errors in `aesce.c` in some Visual Studio builds.
Fixes Mbed-TLS/TF-PSA-Crypto#548.
7 changes: 4 additions & 3 deletions library/aesce.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/

#include "common.h"

#if defined(MBEDTLS_AESCE_C)

#if defined(__clang__) && (__clang_major__ >= 4)

/* Ideally, we would simply use MBEDTLS_ARCH_IS_ARMV8_A in the following #if,
Expand Down Expand Up @@ -39,9 +43,6 @@
#endif /* defined(__clang__) && (__clang_major__ >= 4) */

#include <string.h>
#include "common.h"

#if defined(MBEDTLS_AESCE_C)

#include "aesce.h"

Expand Down
3 changes: 1 addition & 2 deletions library/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/

#include <limits.h>

#include "common.h"

#if defined(MBEDTLS_BASE64_C)
Expand All @@ -16,6 +14,7 @@
#include "constant_time_internal.h"
#include "mbedtls/error.h"

#include <limits.h>
#include <stdint.h>

#if defined(MBEDTLS_SELF_TEST)
Expand Down
5 changes: 2 additions & 3 deletions library/constant_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
* might be translated to branches by some compilers on some platforms.
*/

#include <stdint.h>
#include <limits.h>

#include "common.h"
#include "constant_time_internal.h"
#include "mbedtls/constant_time.h"
#include "mbedtls/error.h"
#include "mbedtls/platform_util.h"

#include <limits.h>
#include <stdint.h>
#include <string.h>

#if !defined(MBEDTLS_CT_ASM)
Expand Down
18 changes: 9 additions & 9 deletions library/sha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
* http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
*/

/* Ensure that SIG_SETMASK is defined when -std=c99 is used. */
#if !defined(_GNU_SOURCE)
#define _GNU_SOURCE
#endif

#include "common.h"

#if defined(MBEDTLS_SHA256_C) || defined(MBEDTLS_SHA224_C)

#if defined(__clang__) && (__clang_major__ >= 4)

/* Ideally, we would simply use MBEDTLS_ARCH_IS_ARMV8_A in the following #if,
Expand Down Expand Up @@ -43,15 +52,6 @@

#endif /* defined(__clang__) && (__clang_major__ >= 4) */

/* Ensure that SIG_SETMASK is defined when -std=c99 is used. */
#if !defined(_GNU_SOURCE)
#define _GNU_SOURCE
#endif

#include "common.h"

#if defined(MBEDTLS_SHA256_C) || defined(MBEDTLS_SHA224_C)

#include "mbedtls/sha256.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
Expand Down
8 changes: 4 additions & 4 deletions library/sha512.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
* http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
*/

#include "common.h"

#if defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_SHA384_C)

#if defined(__aarch64__) && !defined(__ARM_FEATURE_SHA512) && \
defined(__clang__) && __clang_major__ >= 7
/* TODO: Re-consider above after https://reviews.llvm.org/D131064 merged.
Expand All @@ -26,10 +30,6 @@
#define MBEDTLS_ENABLE_ARM_SHA3_EXTENSIONS_COMPILER_FLAG
#endif

#include "common.h"

#if defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_SHA384_C)

#include "mbedtls/sha512.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
Expand Down