Skip to content

test.c: Improved testing#10404

Open
SparkiDev wants to merge 1 commit intowolfSSL:masterfrom
SparkiDev:test_c_refactor_1
Open

test.c: Improved testing#10404
SparkiDev wants to merge 1 commit intowolfSSL:masterfrom
SparkiDev:test_c_refactor_1

Conversation

@SparkiDev
Copy link
Copy Markdown
Contributor

Description

Top-level test extraction into typed sub-functions

  • Digest tests (MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512,
    SHA-512/224, SHA-512/256, SHA-3 224/256/384/512, SHAKE128/256): each
    test category (KAT, large-hash, copy-cleanup, unaligned-memory,
    interleave, copy-Sha3 heap-allocation pattern) is now its own static
    wc_test_ret_t function rather than inline blocks inside one giant
    top-level test.
  • rsa_test: extracted rsa_pkcs1_test, rsa_cert_parse_test,
    rsa_pub_key_decode_test, rsa_certreq_test.
  • ecc_test: extracted ecc_test_all_curves, ecc_test_all_deterministic_k
    from the dispatcher; ecc_encrypt_combos_test from ecc_encrypt_test;
    ecc_buffers_encrypt_test, ecc_buffers_sign_verify_test,
    ecc_buffers_pub_key_decode_test from ecc_test_buffers.
  • dh_test: extracted dh_keyagree_test, dh_check_priv_key_test,
    dh_agree_ct_test, dh_key_import_export_test, dh_set_check_key_test.
  • Curve25519 / Ed25519 / Curve448 / Ed448: extracted KAT, key-agreement,
    ASN, and rare-sig sub-tests from each top-level dispatcher.
  • Cipher tests: extracted streaming sub-tests from aesofb_test,
    aescfb_test, aes_cts_test (aes_cts_192/256_stream_test).

Coverage additions

  • Added state-copy testing inside the SHA-3 KAT loops (matching the existing pattern in SHA-1/224/256/etc. KAT loops).
  • Added a SHA-224 large-hash test (parity with the other digest families).
  • Added copy-cleanup tests for SHA-512/224 and SHA-512/256.
  • Added Unaligned memory access testing to all *_large_hash_test functions (MD5, SHA-1/224/256/384, SHA3-224/256/384/512), matching the pattern that previously only existed for SHA-512/224/256.

Testing

/configure --disable-shared --enable-all --enable-aescts

@SparkiDev SparkiDev self-assigned this May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

MemBrowse Memory Report

No memory changes detected for:

@SparkiDev SparkiDev force-pushed the test_c_refactor_1 branch 4 times, most recently from 6584c8a to 3ccad2b Compare May 6, 2026 11:50
Top-level test extraction into typed sub-functions

- Digest tests (MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512,
SHA-512/224,   SHA-512/256, SHA-3 224/256/384/512, SHAKE128/256): each
test category (KAT, large-hash, copy-cleanup, unaligned-memory,
interleave, copy-Sha3 heap-allocation pattern) is now its own static
wc_test_ret_t function rather than inline blocks inside one giant
top-level test.
- rsa_test: extracted rsa_pkcs1_test, rsa_cert_parse_test,
rsa_pub_key_decode_test, rsa_certreq_test.
- ecc_test: extracted ecc_test_all_curves, ecc_test_all_deterministic_k
from the dispatcher; ecc_encrypt_combos_test from ecc_encrypt_test;
ecc_buffers_encrypt_test, ecc_buffers_sign_verify_test,
ecc_buffers_pub_key_decode_test from ecc_test_buffers.
- dh_test: extracted dh_keyagree_test, dh_check_priv_key_test,
dh_agree_ct_test, dh_key_import_export_test, dh_set_check_key_test.
- Curve25519 / Ed25519 / Curve448 / Ed448: extracted KAT, key-agreement,
ASN, and rare-sig sub-tests from each top-level dispatcher.
- Cipher tests: extracted streaming sub-tests from aesofb_test,
aescfb_test, aes_cts_test (aes_cts_192/256_stream_test).

Coverage additions

- Added state-copy testing inside the SHA-3 KAT loops (matching the
existing pattern in SHA-1/224/256/etc. KAT loops).
- Added a SHA-224 large-hash test (parity with the other digest
families).
- Added copy-cleanup tests for SHA-512/224 and SHA-512/256.
- Added Unaligned memory access testing to all *_large_hash_test
functions (MD5, SHA-1/224/256/384, SHA3-224/256/384/512), matching the
pattern that previously only existed for SHA-512/224/256.
@SparkiDev SparkiDev force-pushed the test_c_refactor_1 branch from 3ccad2b to 9095549 Compare May 6, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant