Files
wolfssl/tests/api/test_wolfmath.h
T
Daniele Lacamera 28a9c5921f tests: fix shared-CI link and FIPS build for math/kdf MC/DC tests
kdf: wc_Tls13_HKDF_Extract_ex / wc_Tls13_HKDF_Expand_Label_ex postdate the
frozen FIPS/selftest kdf.h and are undeclared there. Gate every _ex call site
behind WOLFSSL_TEST_HKDF_EX (!HAVE_FIPS && !HAVE_SELFTEST); the thin non-_ex
wrappers, which exist everywhere, keep their coverage.

wolfmath: test_wc_TfmDecisionCoverage / test_wc_TfmExptModDecisionCoverage /
test_wc_IntegerDecisionCoverage called library-internal fp_* and s_mp_*
functions that carry no MP_API decoration, so under -fvisibility=hidden they
are not exported from the shared library and unit.test failed to link them
(undefined reference to fp_set / s_mp_mul_digs / ...) in the default shared CI
build. Relocate those decision drivers into the tests/unit-mcdc white-boxes,
which reach the internals legally by #including tfm.c / integer.c; tests/api
now uses only the public mp_* interface. mp_rand_prime calls are gated by
WOLFSSL_KEY_GEN (and, for integer, !NO_DH || !NO_DSA) to match where the
library declares and defines it.
2026-07-17 08:56:03 +02:00

55 lines
2.2 KiB
C

/* test_wolfmath.h
*
* Copyright (C) 2006-2026 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef WOLFCRYPT_TEST_WOLFMATH_H
#define WOLFCRYPT_TEST_WOLFMATH_H
#include <tests/api/api_decl.h>
int test_mp_get_digit_count(void);
int test_mp_get_digit(void);
int test_mp_get_rand_digit(void);
int test_mp_cond_copy(void);
int test_mp_rand(void);
int test_wc_export_int(void);
int test_wc_SpIntSizeDecisionCoverage(void);
int test_wc_SpIntShiftDecisionCoverage(void);
int test_wc_SpIntDigitArithDecisionCoverage(void);
int test_wc_SpIntArithDecisionCoverage(void);
int test_wc_SpIntConvDecisionCoverage(void);
int test_wc_SpIntExptGcdDecisionCoverage(void);
#define TEST_WOLFMATH_DECLS \
TEST_DECL_GROUP("wolfmath", test_mp_get_digit_count), \
TEST_DECL_GROUP("wolfmath", test_mp_get_digit), \
TEST_DECL_GROUP("wolfmath", test_mp_get_rand_digit), \
TEST_DECL_GROUP("wolfmath", test_mp_cond_copy), \
TEST_DECL_GROUP("wolfmath", test_mp_rand), \
TEST_DECL_GROUP("wolfmath", test_wc_export_int), \
TEST_DECL_GROUP("wolfmath", test_wc_SpIntSizeDecisionCoverage), \
TEST_DECL_GROUP("wolfmath", test_wc_SpIntShiftDecisionCoverage), \
TEST_DECL_GROUP("wolfmath", test_wc_SpIntDigitArithDecisionCoverage),\
TEST_DECL_GROUP("wolfmath", test_wc_SpIntArithDecisionCoverage), \
TEST_DECL_GROUP("wolfmath", test_wc_SpIntConvDecisionCoverage), \
TEST_DECL_GROUP("wolfmath", test_wc_SpIntExptGcdDecisionCoverage)
#endif /* WOLFCRYPT_TEST_WOLFMATH_H */