Skip to content

Commit b77bd78

Browse files
authored
Merge pull request #8664 from douzzer/20250411-more-libwolfssl_sources_h-2
20250411-more-libwolfssl_sources_h-2
2 parents 5f106ad + e7577bc commit b77bd78

11 files changed

Lines changed: 22 additions & 58 deletions

File tree

wolfcrypt/src/port/kcapi/kcapi_aes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#if !defined(NO_AES) && defined(WOLFSSL_KCAPI_AES)
2525

26+
#include <errno.h>
27+
2628
#if defined(HAVE_FIPS) && \
2729
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
2830

wolfcrypt/src/port/liboqs/liboqs.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
23+
2224
/*
2325
2426
DESCRIPTION
@@ -27,15 +29,6 @@ implementations for Post-Quantum cryptography algorithms.
2729
2830
*/
2931

30-
#ifdef HAVE_CONFIG_H
31-
#include <config.h>
32-
#endif
33-
34-
#include <wolfssl/wolfcrypt/settings.h>
35-
#include <wolfssl/wolfcrypt/types.h>
36-
#include <wolfssl/wolfcrypt/logging.h>
37-
#include <wolfssl/wolfcrypt/error-crypt.h>
38-
3932
#include <wolfssl/wolfcrypt/port/liboqs/liboqs.h>
4033

4134
#if defined(HAVE_LIBOQS)

wolfcrypt/src/port/riscv/riscv-64-aes.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,14 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22-
#ifdef HAVE_CONFIG_H
23-
#include <config.h>
24-
#endif
22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
2523

26-
#include <wolfssl/wolfcrypt/settings.h>
2724
#include <wolfssl/wolfcrypt/port/riscv/riscv-64-asm.h>
28-
#include <wolfssl/wolfcrypt/error-crypt.h>
2925

3026
#if !defined(NO_AES)
3127

3228
#include <wolfssl/wolfcrypt/aes.h>
3329

34-
#include <wolfssl/wolfcrypt/logging.h>
35-
3630
#ifdef NO_INLINE
3731
#include <wolfssl/wolfcrypt/misc.h>
3832
#else

wolfcrypt/src/port/riscv/riscv-64-chacha.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,19 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
23+
2224
/* The paper NEON crypto by Daniel J. Bernstein and Peter Schwabe was used to
2325
* optimize for ARM:
2426
* https://cryptojedi.org/papers/veccrypto-20120320.pdf
2527
*/
2628

27-
#ifdef HAVE_CONFIG_H
28-
#include <config.h>
29-
#endif
30-
31-
#include <wolfssl/wolfcrypt/settings.h>
3229
#include <wolfssl/wolfcrypt/port/riscv/riscv-64-asm.h>
3330

3431
#ifdef WOLFSSL_RISCV_ASM
3532
#ifdef HAVE_CHACHA
3633

3734
#include <wolfssl/wolfcrypt/chacha.h>
38-
#include <wolfssl/wolfcrypt/error-crypt.h>
39-
#include <wolfssl/wolfcrypt/logging.h>
4035
#include <wolfssl/wolfcrypt/cpuid.h>
4136
#ifdef NO_INLINE
4237
#include <wolfssl/wolfcrypt/misc.h>

wolfcrypt/src/port/riscv/riscv-64-poly1305.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,19 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
23+
2224
/*
23-
* Based off the public domain implementations by Andrew Moon
25+
* Based on the public domain implementations by Andrew Moon
2426
* and Daniel J. Bernstein
2527
*/
2628

27-
#ifdef HAVE_CONFIG_H
28-
#include <config.h>
29-
#endif
30-
31-
#include <wolfssl/wolfcrypt/settings.h>
32-
#include <wolfssl/wolfcrypt/types.h>
3329
#include <wolfssl/wolfcrypt/port/riscv/riscv-64-asm.h>
3430

3531
#ifdef WOLFSSL_RISCV_ASM
3632

3733
#ifdef HAVE_POLY1305
3834
#include <wolfssl/wolfcrypt/poly1305.h>
39-
#include <wolfssl/wolfcrypt/error-crypt.h>
40-
#include <wolfssl/wolfcrypt/logging.h>
4135
#include <wolfssl/wolfcrypt/cpuid.h>
4236
#ifdef NO_INLINE
4337
#include <wolfssl/wolfcrypt/misc.h>

wolfcrypt/src/port/riscv/riscv-64-sha256.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22-
23-
#ifdef HAVE_CONFIG_H
24-
#include <config.h>
25-
#endif
26-
27-
#include <wolfssl/wolfcrypt/settings.h>
22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
2823

2924
#ifdef WOLFSSL_RISCV_ASM
3025
#if !defined(NO_SHA256) || defined(WOLFSSL_SHA224)
@@ -47,8 +42,6 @@
4742
return 0;
4843
}
4944
#endif
50-
#include <wolfssl/wolfcrypt/logging.h>
51-
#include <wolfssl/wolfcrypt/error-crypt.h>
5245

5346
#include <wolfssl/wolfcrypt/port/riscv/riscv-64-asm.h>
5447

wolfcrypt/src/port/riscv/riscv-64-sha3.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
2223

23-
#ifdef HAVE_CONFIG_H
24-
#include <config.h>
25-
#endif
26-
27-
#include <wolfssl/wolfcrypt/settings.h>
2824
#include <wolfssl/wolfcrypt/port/riscv/riscv-64-asm.h>
2925

3026
#ifdef WOLFSSL_RISCV_ASM

wolfcrypt/src/port/riscv/riscv-64-sha512.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22-
23-
#ifdef HAVE_CONFIG_H
24-
#include <config.h>
25-
#endif
26-
27-
#include <wolfssl/wolfcrypt/settings.h>
22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
2823

2924
#ifdef WOLFSSL_RISCV_ASM
3025
#if !defined(NO_SHA512) || defined(WOLFSSL_SHA384)
@@ -47,8 +42,6 @@
4742
return 0;
4843
}
4944
#endif
50-
#include <wolfssl/wolfcrypt/logging.h>
51-
#include <wolfssl/wolfcrypt/error-crypt.h>
5245

5346
#include <wolfssl/wolfcrypt/port/riscv/riscv-64-asm.h>
5447

wolfcrypt/test/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6363,7 +6363,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hash_test(void)
63636363
}
63646364

63656365
if (ret != 0) {
6366-
ERROR_OUT(WC_TEST_RET_ENC_I(BAD_FUNC_ARG), out);
6366+
ERROR_OUT(WC_TEST_RET_ENC_EC(BAD_FUNC_ARG), out);
63676367
}
63686368
#endif
63696369
ret = wc_HashInit(hash, typesGood[i]);

wolfssl/wolfcrypt/libwolfssl_sources.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@
2929
#define LIBWOLFSSL_SOURCES_H
3030

3131
#if defined(TEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE) && \
32-
defined(WOLF_CRYPT_SETTINGS_H)
32+
defined(WOLF_CRYPT_SETTINGS_H) && \
33+
!defined(LIBWOLFSSL_SOURCES_ASM_H)
3334
#error settings.h included before libwolfssl_sources.h.
3435
#endif
3536

3637
#ifndef BUILDING_WOLFSSL
3738
#define BUILDING_WOLFSSL
3839
#endif
3940

40-
#ifdef HAVE_CONFIG_H
41+
#if defined(HAVE_CONFIG_H) && !defined(WC_CONFIG_H_INCLUDED)
4142
#include <config.h>
43+
#define WC_CONFIG_H_INCLUDED
4244
#endif
4345

4446
#include <wolfssl/wolfcrypt/types.h>

0 commit comments

Comments
 (0)