-
Notifications
You must be signed in to change notification settings - Fork 146
Generic cryptocb support #749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bigbrett
wants to merge
4
commits into
wolfSSL:master
Choose a base branch
from
bigbrett:cryptocb-integration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,242 @@ | ||
| name: test simulator with crypto callback (cryptocb) | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ 'master', 'main', 'release/**' ] | ||
| pull_request: | ||
| branches: [ '**' ] | ||
|
|
||
| jobs: | ||
| cryptocb_simulator_tests: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/wolfssl/wolfboot-ci-sim:v1.0 | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Trust workspace | ||
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
|
|
||
| # 64 bit simulator, cryptocb enabled | ||
| # | ||
| - name: make clean | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Select config (64 bit simulator) | ||
| run: | | ||
| cp config/examples/sim.config .config | ||
|
|
||
| - name: Build tools | ||
| run: | | ||
| make -C tools/keytools && make -C tools/bin-assemble | ||
|
|
||
| # Classical algorithms (each tested once with SPMATH=1) | ||
| # Note: ECC uses wc_ecc_verify_hash_ex which bypasses cryptocb PK dispatch, | ||
| # so we only verify hash for ECC. ED25519 and RSA dispatch PK through cryptocb. | ||
| # | ||
| - name: Build wolfboot.elf (ED25519, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=ED25519 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (ED25519) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ED25519-verify" | ||
|
|
||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (ECC256, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=ECC256 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (ECC256) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" | ||
|
|
||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (ECC384, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=ECC384 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (ECC384) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" | ||
|
|
||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (ECC521, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=ECC521 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (ECC521) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" | ||
|
|
||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (RSA2048, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (RSA2048) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "RSA" | ||
|
|
||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (RSA3072, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (RSA3072) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "RSA" | ||
|
|
||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (RSA4096, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (RSA4096) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "RSA" | ||
|
|
||
| # SHA-384 hash coverage (paired with algorithms that naturally use 384-bit) | ||
| # | ||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (ECC384 + SHA384, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=ECC384 HASH=SHA384 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (ECC384 + SHA384) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-384" | ||
|
|
||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (RSA4096 + SHA384, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 HASH=SHA384 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (RSA4096 + SHA384) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-384" "RSA" | ||
|
|
||
| # SHA3-384 hash coverage | ||
| # | ||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (ECC384 + SHA3-384, cryptocb) | ||
| run: | | ||
| make clean && make test-sim-internal-flash-with-update SIGN=ECC384 HASH=SHA3 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (ECC384 + SHA3-384) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA3-384" | ||
|
|
||
| # AES encrypted partition coverage (external flash + AES128-CTR) | ||
| # | ||
| - name: Cleanup to change key type | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Build wolfboot.elf (ED25519 + AES128 encrypt, cryptocb) | ||
| run: | | ||
| cp config/examples/sim-encrypt-update.config .config | ||
| make clean && make test-sim-external-flash-with-enc-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run cryptocb sunnyday test (ED25519 + AES128 encrypt) | ||
| run: | | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ED25519-verify" "AES-CTR" | ||
|
|
||
| # PQ algorithms (each uses its own config, build + test inline) | ||
| # | ||
| - name: Build and test LMS (cryptocb) | ||
| run: | | ||
| cp config/examples/sim-lms.config .config | ||
| make keysclean && make clean | ||
| make keytools | ||
| make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" | ||
|
|
||
| - name: Build and test XMSS (cryptocb) | ||
| run: | | ||
| cp config/examples/sim-xmss.config .config | ||
| make keysclean && make clean | ||
| make keytools | ||
| make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" | ||
|
|
||
| - name: Build and test ML-DSA level 2 (cryptocb) | ||
| run: | | ||
| cp config/examples/sim-ml-dsa.config .config | ||
| make keysclean && make clean | ||
| make keytools | ||
| make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ML-DSA-verify" | ||
|
|
||
| - name: Build and test ML-DSA level 3 (cryptocb) | ||
| run: | | ||
| cp config/examples/sim-ml-dsa3.config .config | ||
| make keysclean && make clean | ||
| make keytools | ||
| make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ML-DSA-verify" | ||
|
|
||
| - name: Build and test ML-DSA level 5 (cryptocb) | ||
| run: | | ||
| cp config/examples/sim-ml-dsa5.config .config | ||
| make keysclean && make clean | ||
| make keytools | ||
| make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
| tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ML-DSA-verify" | ||
|
|
||
| # Hybrid auth: ML_DSA + ECDSA | ||
| # | ||
| - name: make clean (hybrid) | ||
| run: | | ||
| make keysclean | ||
|
|
||
| - name: Select config (hybrid ML_DSA + ECC) | ||
| run: | | ||
| cp config/examples/sim-ml-dsa-ecc-hybrid.config .config | ||
|
|
||
| - name: Build tools (hybrid) | ||
| run: | | ||
| make -C tools/keytools && make -C tools/bin-assemble | ||
|
|
||
| - name: Build wolfboot.elf (hybrid, cryptocb) | ||
| run: | | ||
| make clean && make WOLFBOOT_TEST_SIM_CRYPTOCB=1 | ||
|
|
||
| - name: Run hybrid boot test with cryptocb verification | ||
| run: | | ||
| ./wolfboot.elf get_version > sim_cryptocb.log 2>/dev/null | ||
| grep -q "sim-cryptocb: hash SHA-256" sim_cryptocb.log || (echo "hash SHA-256 not found" && cat sim_cryptocb.log && exit 1) | ||
| grep -q "sim-cryptocb: pk ML-DSA-verify" sim_cryptocb.log || (echo "pk ML-DSA-verify not found" && cat sim_cryptocb.log && exit 1) | ||
| echo "Hybrid cryptocb verification passed" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.