2015-11-17 08:52:12 -08:00
|
|
|
/* wolfcrypt/test/test.h
|
2014-12-17 15:33:22 -07:00
|
|
|
*
|
2025-01-21 09:55:03 -07:00
|
|
|
* Copyright (C) 2006-2025 wolfSSL Inc.
|
2014-12-17 15:33:22 -07:00
|
|
|
*
|
2016-03-17 16:02:13 -06:00
|
|
|
* This file is part of wolfSSL.
|
2014-12-17 15:33:22 -07:00
|
|
|
*
|
2015-01-06 12:14:15 -07:00
|
|
|
* wolfSSL is free software; you can redistribute it and/or modify
|
2014-12-17 15:33:22 -07:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2025-07-10 16:01:52 -06:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2014-12-17 15:33:22 -07:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
2015-01-06 12:14:15 -07:00
|
|
|
* wolfSSL is distributed in the hope that it will be useful,
|
2014-12-17 15:33:22 -07:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
2016-03-17 16:02:13 -06:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
2014-12-17 15:33:22 -07:00
|
|
|
*/
|
|
|
|
|
|
2016-03-17 16:02:13 -06:00
|
|
|
|
2015-12-17 13:19:17 -07:00
|
|
|
#ifndef WOLFCRYPT_TEST_H
|
|
|
|
|
#define WOLFCRYPT_TEST_H
|
|
|
|
|
|
2023-06-14 15:06:13 -05:00
|
|
|
#include <wolfssl/wolfcrypt/types.h>
|
2014-12-17 15:33:22 -07:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-06-13 18:11:17 -05:00
|
|
|
#ifdef WC_TEST_RET_CUSTOM_TYPE
|
|
|
|
|
typedef WC_TEST_RET_CUSTOM_TYPE wc_test_ret_t;
|
|
|
|
|
#else
|
|
|
|
|
typedef sword32 wc_test_ret_t;
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-06-26 07:32:20 -07:00
|
|
|
#include <wolfssl/wolfcrypt/settings.h>
|
|
|
|
|
|
2024-11-13 17:40:29 -06:00
|
|
|
#include <wolfssl/wolfcrypt/error-crypt.h>
|
|
|
|
|
|
2017-03-31 13:11:23 -07:00
|
|
|
#ifdef HAVE_STACK_SIZE
|
|
|
|
|
THREAD_RETURN WOLFSSL_THREAD wolfcrypt_test(void* args);
|
|
|
|
|
#else
|
2023-06-13 18:11:17 -05:00
|
|
|
wc_test_ret_t wolfcrypt_test(void* args);
|
2017-03-31 13:11:23 -07:00
|
|
|
#endif
|
2022-11-30 10:01:46 -08:00
|
|
|
|
wolfcrypt/src/aes.c: in wc_AesSetKeyLocal(), rework support for WC_FLAG_DONT_USE_AESNI (fixes WC_C_DYNAMIC_FALLBACK).
wolfssl/wolfcrypt/settings.h: in WOLFSSL_LINUXKM section, #ifdef LINUXKM_LKCAPI_REGISTER, #define WOLFSSL_TEST_SUBROUTINE to nothing, and #define WC_TEST_EXPORT_SUBTESTS.
linuxkm/lkcapi_glue.c:
* add check_skcipher_driver_masking() and check_aead_driver_masking(),
* use _masking() checks in all linuxkm_test_*().
* add !WOLFSSL_AESGCM_STREAM implementation of linuxkm_test_aesgcm().
* add implementations of linuxkm_test_aesctr(), linuxkm_test_aesofb(), and linuxkm_test_aesecb()
* remove incomplete+disabled AES-CCM shim implementation.
linuxkm/module_hooks.c: pull in wolfcrypt/test/test.h if LINUXKM_LKCAPI_REGISTER.
linuxkm/Makefile: build wolfcrypt/test/test.o if ENABLED_LINUXKM_LKCAPI_REGISTER.
Makefile.am: add ENABLED_LINUXKM_LKCAPI_REGISTER to exports in BUILD_LINUXKM section.
configure.ac: add AC_SUBST([ENABLED_LINUXKM_LKCAPI_REGISTER]); in ENABLED_LINUXKM_DEFAULTS set up, remove `-DWOLFSSL_TEST_SUBROUTINE=static` from AM_CFLAGS adds; fix whitespace.
.wolfssl_known_macro_extras: add WC_WANT_FLAG_DONT_USE_AESNI.
wolfcrypt/test/test.c: add `|| defined(WC_TEST_EXPORT_SUBTESTS)` to outermost gate, add wc_test_ prefix to render_error_message() and export it,
wolfcrypt/test/test.h: add prototype for wc_test_render_error_message(), and #ifdef WC_TEST_EXPORT_SUBTESTS, add prototypes for all the subtests.
2025-04-01 01:17:10 -05:00
|
|
|
void wc_test_render_error_message(const char* msg, wc_test_ret_t es);
|
|
|
|
|
|
2022-05-04 16:12:59 +02:00
|
|
|
#ifndef NO_MAIN_DRIVER
|
2023-06-13 18:11:17 -05:00
|
|
|
wc_test_ret_t wolfcrypt_test_main(int argc, char** argv);
|
2022-05-04 16:12:59 +02:00
|
|
|
#endif
|
2014-12-17 15:33:22 -07:00
|
|
|
|
2022-11-30 10:01:46 -08:00
|
|
|
#if defined(WOLFSSL_ESPIDF) || defined(_WIN32_WCE)
|
|
|
|
|
int wolf_test_task(void);
|
|
|
|
|
#endif
|
|
|
|
|
|
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 15:02:37 -06:00
|
|
|
#ifndef WC_TEST_RET_HAVE_CUSTOM_MACROS
|
|
|
|
|
|
2023-06-13 18:11:17 -05:00
|
|
|
#define WC_TEST_RET_TAG_NC 0L
|
|
|
|
|
#define WC_TEST_RET_TAG_EC 1L
|
|
|
|
|
#define WC_TEST_RET_TAG_ERRNO 2L
|
|
|
|
|
#define WC_TEST_RET_TAG_I 3L
|
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 15:02:37 -06:00
|
|
|
|
2024-11-13 17:40:29 -06:00
|
|
|
wc_static_assert(-(long)MIN_CODE_E < 0x7ffL);
|
|
|
|
|
|
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 15:02:37 -06:00
|
|
|
#define WC_TEST_RET_ENC(line, i, tag) \
|
2023-07-12 12:11:01 +10:00
|
|
|
((wc_test_ret_t)(-((wc_test_ret_t)(line) + ((wc_test_ret_t)((word32)(i) & 0x7ffL) * 100000L) + ((wc_test_ret_t)(tag) << 29L))))
|
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 15:02:37 -06:00
|
|
|
|
|
|
|
|
#ifndef WC_TEST_RET_LN
|
|
|
|
|
#define WC_TEST_RET_LN __LINE__
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* encode no code */
|
|
|
|
|
#define WC_TEST_RET_ENC_NC WC_TEST_RET_ENC(WC_TEST_RET_LN, 0, WC_TEST_RET_TAG_NC)
|
|
|
|
|
|
|
|
|
|
/* encode positive integer */
|
|
|
|
|
#define WC_TEST_RET_ENC_I(i) WC_TEST_RET_ENC(WC_TEST_RET_LN, i, WC_TEST_RET_TAG_I)
|
|
|
|
|
|
|
|
|
|
/* encode error code (negative integer) */
|
|
|
|
|
#define WC_TEST_RET_ENC_EC(ec) WC_TEST_RET_ENC(WC_TEST_RET_LN, -(ec), WC_TEST_RET_TAG_EC)
|
|
|
|
|
|
|
|
|
|
/* encode system/libc error code */
|
|
|
|
|
#if defined(HAVE_ERRNO_H) && !defined(NO_FILESYSTEM) && \
|
|
|
|
|
!defined(NO_STDIO_FILESYSTEM) && !defined(WOLFSSL_USER_IO)
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#define WC_TEST_RET_ENC_ERRNO WC_TEST_RET_ENC(WC_TEST_RET_LN, errno, WC_TEST_RET_TAG_ERRNO)
|
|
|
|
|
#else
|
|
|
|
|
#define WC_TEST_RET_ENC_ERRNO WC_TEST_RET_ENC_NC
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-06-13 18:11:17 -05:00
|
|
|
#define WC_TEST_RET_DEC_TAG(x) ((-(x)) >> 29L)
|
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 15:02:37 -06:00
|
|
|
|
|
|
|
|
/* decode line number */
|
2023-06-13 18:11:17 -05:00
|
|
|
#define WC_TEST_RET_DEC_LN(x) ((int)(((-(x)) & ~(3L << 29L)) % 100000L))
|
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 15:02:37 -06:00
|
|
|
|
|
|
|
|
/* decode integer or errno */
|
2023-06-13 18:11:17 -05:00
|
|
|
#define WC_TEST_RET_DEC_I(x) ((int)((((-(x)) & ~(3L << 29L)) / 100000L)))
|
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 15:02:37 -06:00
|
|
|
|
|
|
|
|
/* decode error code */
|
2023-06-13 18:11:17 -05:00
|
|
|
#define WC_TEST_RET_DEC_EC(x) ((int)(-WC_TEST_RET_DEC_I(x)))
|
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 15:02:37 -06:00
|
|
|
|
|
|
|
|
#endif /* !WC_TEST_RET_HAVE_CUSTOM_MACROS */
|
|
|
|
|
|
wolfcrypt/src/aes.c: in wc_AesSetKeyLocal(), rework support for WC_FLAG_DONT_USE_AESNI (fixes WC_C_DYNAMIC_FALLBACK).
wolfssl/wolfcrypt/settings.h: in WOLFSSL_LINUXKM section, #ifdef LINUXKM_LKCAPI_REGISTER, #define WOLFSSL_TEST_SUBROUTINE to nothing, and #define WC_TEST_EXPORT_SUBTESTS.
linuxkm/lkcapi_glue.c:
* add check_skcipher_driver_masking() and check_aead_driver_masking(),
* use _masking() checks in all linuxkm_test_*().
* add !WOLFSSL_AESGCM_STREAM implementation of linuxkm_test_aesgcm().
* add implementations of linuxkm_test_aesctr(), linuxkm_test_aesofb(), and linuxkm_test_aesecb()
* remove incomplete+disabled AES-CCM shim implementation.
linuxkm/module_hooks.c: pull in wolfcrypt/test/test.h if LINUXKM_LKCAPI_REGISTER.
linuxkm/Makefile: build wolfcrypt/test/test.o if ENABLED_LINUXKM_LKCAPI_REGISTER.
Makefile.am: add ENABLED_LINUXKM_LKCAPI_REGISTER to exports in BUILD_LINUXKM section.
configure.ac: add AC_SUBST([ENABLED_LINUXKM_LKCAPI_REGISTER]); in ENABLED_LINUXKM_DEFAULTS set up, remove `-DWOLFSSL_TEST_SUBROUTINE=static` from AM_CFLAGS adds; fix whitespace.
.wolfssl_known_macro_extras: add WC_WANT_FLAG_DONT_USE_AESNI.
wolfcrypt/test/test.c: add `|| defined(WC_TEST_EXPORT_SUBTESTS)` to outermost gate, add wc_test_ prefix to render_error_message() and export it,
wolfcrypt/test/test.h: add prototype for wc_test_render_error_message(), and #ifdef WC_TEST_EXPORT_SUBTESTS, add prototypes for all the subtests.
2025-04-01 01:17:10 -05:00
|
|
|
#ifdef WC_TEST_EXPORT_SUBTESTS
|
|
|
|
|
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t error_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t base64_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t base16_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t asn_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t md2_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t md5_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t md4_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha224_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha256_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha512_test(void);
|
|
|
|
|
#if !defined(WOLFSSL_NOSHA512_224) && \
|
|
|
|
|
(!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha512_224_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if !defined(WOLFSSL_NOSHA512_256) && \
|
|
|
|
|
(!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha512_256_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha384_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha3_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t shake128_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t shake256_test(void);
|
|
|
|
|
#ifdef WOLFSSL_SM3
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sm3_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hash_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_md5_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha224_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha256_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha384_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha512_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha3_test(void);
|
|
|
|
|
#if defined(HAVE_HKDF) && !defined(NO_HMAC)
|
|
|
|
|
#if defined(WOLFSSL_AFALG_XILINX) || defined(WOLFSSL_AFALG_XILINX_AES) || \
|
|
|
|
|
defined(WOLFSSL_AFALG_XILINX_SHA3) || defined(WOLFSSL_AFALG_HASH_KEEP) || \
|
|
|
|
|
defined(WOLFSSL_AFALG_XILINX_RSA)
|
|
|
|
|
/* hkdf_test has issue with extern WOLFSSL_TEST_SUBROUTINE set on Xilinx with afalg */
|
|
|
|
|
static wc_test_ret_t hkdf_test(void);
|
|
|
|
|
#else
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hkdf_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#endif /* HAVE_HKDF && ! NO_HMAC */
|
|
|
|
|
#ifdef WOLFSSL_HAVE_PRF
|
|
|
|
|
#if defined(HAVE_HKDF) && !defined(NO_HMAC)
|
|
|
|
|
#ifdef WOLFSSL_BASE16
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t tls12_kdf_test(void);
|
|
|
|
|
#endif /* WOLFSSL_BASE16 */
|
|
|
|
|
#endif /* WOLFSSL_HAVE_HKDF && !NO_HMAC */
|
|
|
|
|
#endif /* WOLFSSL_HAVE_PRF */
|
|
|
|
|
#if defined(WOLFSSL_HAVE_PRF) && !defined(NO_HMAC) && defined(WOLFSSL_SHA384)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t prf_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sshkdf_test(void);
|
|
|
|
|
#ifdef WOLFSSL_TLS13
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t tls13_kdf_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t x963kdf_test(void);
|
|
|
|
|
#if defined(HAVE_HPKE) && defined(HAVE_ECC) && defined(HAVE_AESGCM)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hpke_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WC_SRTP_KDF
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t srtpkdf_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t arc4_test(void);
|
|
|
|
|
#ifdef WC_RC2
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t rc2_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t chacha_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t XChaCha_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t chacha20_poly1305_aead_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t XChaCha20Poly1305_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t des_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t des3_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_cbc_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_ctr_test(void);
|
|
|
|
|
#if defined(WOLFSSL_AES_CFB)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_cfb_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_AES_XTS
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_xts_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes192_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes256_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aesofb_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cmac_test(void);
|
|
|
|
|
#ifdef HAVE_ASCON
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ascon_hash256_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ascon_aead128_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(WOLFSSL_SIPHASH)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t siphash_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t poly1305_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aesgcm_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aesgcm_default_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t gmac_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aesccm_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aeskeywrap_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t camellia_test(void);
|
|
|
|
|
#ifdef WOLFSSL_SM4
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sm4_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WC_RSA_NO_PADDING
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t rsa_no_pad_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t rsa_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t dh_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t dsa_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t srp_test(void);
|
|
|
|
|
#ifndef WC_NO_RNG
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_test(void);
|
|
|
|
|
#endif /* WC_NO_RNG */
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pwdbased_test(void);
|
|
|
|
|
#if defined(USE_CERT_BUFFERS_2048) && \
|
|
|
|
|
defined(HAVE_PKCS12) && \
|
|
|
|
|
!defined(NO_ASN) && !defined(NO_PWDBASED) && !defined(NO_HMAC) && \
|
|
|
|
|
!defined(NO_CERTS) && !defined(NO_DES3)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs12_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ripemd_test(void);
|
|
|
|
|
#if defined(OPENSSL_EXTRA) && !defined(WOLFCRYPT_ONLY)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t openssl_test(void); /* test mini api */
|
|
|
|
|
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t openssl_pkey0_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t openssl_pkey1_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t openSSL_evpMD_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t openssl_evpSig_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pbkdf1_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs12_pbkdf_test(void);
|
|
|
|
|
#if defined(HAVE_PBKDF2) && !defined(NO_SHA256) && !defined(NO_HMAC)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pbkdf2_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t scrypt_test(void);
|
|
|
|
|
#ifdef HAVE_ECC
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ecc_test(void);
|
|
|
|
|
#if defined(HAVE_ECC_ENCRYPT) && defined(HAVE_AES_CBC) && \
|
|
|
|
|
(defined(WOLFSSL_AES_128) || defined(WOLFSSL_AES_256))
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ecc_encrypt_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(USE_CERT_BUFFERS_256) && !defined(WOLFSSL_ATECC508A) && \
|
|
|
|
|
!defined(WOLFSSL_ATECC608A) && !defined(NO_ECC256) && \
|
|
|
|
|
defined(HAVE_ECC_VERIFY) && defined(HAVE_ECC_SIGN) && \
|
|
|
|
|
!defined(WOLF_CRYPTO_CB_ONLY_ECC) && !defined(NO_ECC_SECP)
|
|
|
|
|
/* skip for ATECC508/608A, cannot import private key buffers */
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ecc_test_buffers(void);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_CURVE25519
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t curve25519_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_ED25519
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ed25519_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_CURVE448
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t curve448_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_ED448
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ed448_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_HAVE_MLKEM
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t mlkem_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_DILITHIUM
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t dilithium_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(WOLFSSL_HAVE_XMSS)
|
|
|
|
|
#if !defined(WOLFSSL_SMALL_STACK) && WOLFSSL_XMSS_MIN_HEIGHT <= 10
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t xmss_test_verify_only(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if !defined(WOLFSSL_XMSS_VERIFY_ONLY)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t xmss_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(WOLFSSL_HAVE_LMS)
|
|
|
|
|
#if !defined(WOLFSSL_SMALL_STACK)
|
|
|
|
|
#if (defined(WOLFSSL_WC_LMS) && (LMS_MAX_HEIGHT >= 10) && \
|
|
|
|
|
!defined(WOLFSSL_NO_LMS_SHA256_256)) || defined(HAVE_LIBLMS)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t lms_test_verify_only(void);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#if !defined(WOLFSSL_LMS_VERIFY_ONLY)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t lms_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFCRYPT_HAVE_ECCSI
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t eccsi_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFCRYPT_HAVE_SAKKE
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sakke_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_BLAKE2
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t blake2b_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_BLAKE2S
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t blake2s_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_LIBZ
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t compress_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_PKCS7
|
|
|
|
|
#ifndef NO_PKCS7_ENCRYPTED_DATA
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7encrypted_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(HAVE_LIBZ) && !defined(NO_PKCS7_COMPRESSED_DATA)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7compressed_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7signed_test(void);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7enveloped_test(void);
|
|
|
|
|
#if defined(HAVE_AESGCM) || defined(HAVE_AESCCM)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7authenveloped_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if !defined(NO_AES) && defined(HAVE_AES_CBC)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7callback_test(byte* cert, word32 certSz, byte* key,
|
|
|
|
|
word32 keySz);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#if !defined(NO_ASN_TIME) && !defined(NO_RSA) && defined(WOLFSSL_TEST_CERT) && \
|
|
|
|
|
!defined(NO_FILESYSTEM)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cert_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_TEST_CERT) && \
|
|
|
|
|
!defined(NO_FILESYSTEM) && !defined(NO_RSA) && defined(WOLFSSL_GEN_CERT)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t certext_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN_CACHE) && defined(WOLFSSL_TEST_CERT) && \
|
|
|
|
|
defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_CERT_GEN)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t decodedCertCache_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t memory_test(void);
|
|
|
|
|
#if defined(WOLFSSL_PUBLIC_MP) && \
|
|
|
|
|
((defined(WOLFSSL_SP_MATH_ALL) && !defined(WOLFSSL_RSA_VERIFY_ONLY)) || \
|
|
|
|
|
defined(USE_FAST_MATH))
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t mp_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(WOLFSSL_PUBLIC_MP) && defined(WOLFSSL_KEY_GEN)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t prime_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(ASN_BER_TO_DER) && \
|
|
|
|
|
(defined(WOLFSSL_TEST_CERT) || defined(OPENSSL_EXTRA) || \
|
|
|
|
|
defined(OPENSSL_EXTRA_X509_SMALL))
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t berder_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t logging_test(void);
|
|
|
|
|
#if !defined(NO_ASN) && !defined(NO_ASN_TIME)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t time_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(__INCLUDE_NUTTX_CONFIG_H)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t wolfcrypt_mutex_test(void);
|
|
|
|
|
#else
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t mutex_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(USE_WOLFSSL_MEMORY) && !defined(FREERTOS)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t memcb_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_CAAM_BLOB
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t blob_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_ARIA
|
|
|
|
|
#include "wolfssl/wolfcrypt/port/aria/aria-crypt.h"
|
|
|
|
|
void printOutput(const char *strName, unsigned char *data, unsigned int dataSz);
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE int ariagcm_test(MC_ALGID);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(WOLF_CRYPTO_CB) && !defined(WC_TEST_NO_CRYPTOCB_SW_TEST)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_CERT_PIV
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t certpiv_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_AES_SIV
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_siv_test(void);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(WOLFSSL_AES_EAX) && \
|
|
|
|
|
(!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST)
|
|
|
|
|
extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_eax_test(void);
|
|
|
|
|
#endif /* WOLFSSL_AES_EAX */
|
|
|
|
|
|
|
|
|
|
#endif /* WC_TEST_EXPORT_SUBTESTS */
|
|
|
|
|
|
2014-12-17 15:33:22 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
} /* extern "C" */
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-12-17 13:19:17 -07:00
|
|
|
|
|
|
|
|
#endif /* WOLFCRYPT_TEST_H */
|