Files
wolfssl/tests
Daniele Lacamera 8efb4ddf19 tests: add sp_int.c (sp-math module) MC/DC DecisionCoverage + white-box
tests/api/test_wolfmath.c gains six DecisionCoverage test functions
covering sp_int.c's mp_*/sp_* API: the allocation family (sp_init_size,
sp_grow, sp_copy, sp_exch), the shift family (sp_set_bit, sp_2expt,
sp_lshd, sp_rshb), the single-digit and multi-precision arithmetic
families (sp_add_d/sp_sub_d/sp_mul_d/sp_div_d/sp_mod_d/sp_div_2/
sp_div_2_mod_ct/sp_add/sp_sub/sp_addmod_ct/sp_submod_ct/sp_div,
including their WOLFSSL_SP_INT_NEGATIVE sign-path counterparts), the
conversion family (sp_div_2d/sp_mod_2d/sp_mul_2d/sp_sqrmod/
sp_mont_red_ex/sp_to_unsigned_bin_len(_ct)/sp_tohex/sp_read_radix), and
the sp_invmod/sp_exptmod_ex/sp_gcd/sp_prime_is_prime(_ex) top-level
argument and degenerate-input checks. Each exercises an internal
size/capacity guard or argument check via a deliberately undersized
destination (sp_init_size with a small size) or an out-of-range
argument - legitimate, public ways to reach decisions valid-sized RSA/
ECC/DH usage never trips.

tests/unit-mcdc/test_sp_int_whitebox.c is a new white-box supplement
(compiles sp_int.c in directly) closing the sp_count_bits/sp_cnt_lsb
non-normalized-digit trim loops: no public caller can produce that
state since every public mutator normalizes via sp_clamp before
returning.

Part of the ISO 26262 per-module MC/DC campaign's sp-math module
(wolfcrypt/src/sp_int.c, Phase 1): 412/547 (75.32%) MC/DC across 6
build-variant axes (WOLFSSL_SP_MATH_ALL vs bare WOLFSSL_SP_MATH,
WOLFSSL_SP_SMALL, WOLFSSL_SP_INT_NEGATIVE, WOLFSSL_SP_DIV_WORD_HALF,
WOLFSSL_SMALL_STACK) + the white-box, up from a 318/547 baseline. The
remaining gaps are deep invmod/exptmod/prime/gcd internal state-machine
internals, the SP-accelerated-backend-entangled RSA/DH key-size
dispatch, and other structural residuals; campaign-side files (config,
module registry, baseline) live in the separate testing repo.
2026-07-13 11:19:23 +02:00
..
2026-02-18 09:52:21 -07:00
2026-06-04 18:29:24 +10:00
2022-01-31 15:29:25 -05:00
2022-01-31 15:29:25 -05:00
2024-01-16 15:18:05 -08:00
2026-02-25 15:19:13 +01:00
2026-02-25 15:19:13 +01:00
2022-01-31 15:29:25 -05:00
2022-06-01 10:36:01 +10:00
2022-02-23 09:47:34 +01:00
2024-01-16 15:18:05 -08:00
2026-06-05 10:58:44 +10:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00

Before creating any new configure files (.conf) read the CONF_FILES_README.md