|
| 1 | +name: test simulator with crypto callback (cryptocb) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'master', 'main', 'release/**' ] |
| 6 | + pull_request: |
| 7 | + branches: [ '*' ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + cryptocb_simulator_tests: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + container: |
| 13 | + image: ghcr.io/wolfssl/wolfboot-ci-sim:v1.0 |
| 14 | + timeout-minutes: 30 |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + with: |
| 19 | + submodules: true |
| 20 | + |
| 21 | + - name: Trust workspace |
| 22 | + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" |
| 23 | + |
| 24 | + # 64 bit simulator, cryptocb enabled |
| 25 | + # |
| 26 | + - name: make clean |
| 27 | + run: | |
| 28 | + make keysclean |
| 29 | +
|
| 30 | + - name: Select config (64 bit simulator) |
| 31 | + run: | |
| 32 | + cp config/examples/sim.config .config |
| 33 | +
|
| 34 | + - name: Build tools |
| 35 | + run: | |
| 36 | + make -C tools/keytools && make -C tools/bin-assemble |
| 37 | +
|
| 38 | + # Classical algorithms (each tested once with SPMATH=1) |
| 39 | + # Note: ECC uses wc_ecc_verify_hash_ex which bypasses cryptocb PK dispatch, |
| 40 | + # so we only verify hash for ECC. ED25519 and RSA dispatch PK through cryptocb. |
| 41 | + # |
| 42 | + - name: Build wolfboot.elf (ED25519, cryptocb) |
| 43 | + run: | |
| 44 | + make clean && make test-sim-internal-flash-with-update SIGN=ED25519 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 45 | +
|
| 46 | + - name: Run cryptocb sunnyday test (ED25519) |
| 47 | + run: | |
| 48 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ED25519-verify" |
| 49 | +
|
| 50 | + - name: Cleanup to change key type |
| 51 | + run: | |
| 52 | + make keysclean |
| 53 | +
|
| 54 | + - name: Build wolfboot.elf (ECC256, cryptocb) |
| 55 | + run: | |
| 56 | + make clean && make test-sim-internal-flash-with-update SIGN=ECC256 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 57 | +
|
| 58 | + - name: Run cryptocb sunnyday test (ECC256) |
| 59 | + run: | |
| 60 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" |
| 61 | +
|
| 62 | + - name: Cleanup to change key type |
| 63 | + run: | |
| 64 | + make keysclean |
| 65 | +
|
| 66 | + - name: Build wolfboot.elf (ECC384, cryptocb) |
| 67 | + run: | |
| 68 | + make clean && make test-sim-internal-flash-with-update SIGN=ECC384 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 69 | +
|
| 70 | + - name: Run cryptocb sunnyday test (ECC384) |
| 71 | + run: | |
| 72 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" |
| 73 | +
|
| 74 | + - name: Cleanup to change key type |
| 75 | + run: | |
| 76 | + make keysclean |
| 77 | +
|
| 78 | + - name: Build wolfboot.elf (ECC521, cryptocb) |
| 79 | + run: | |
| 80 | + make clean && make test-sim-internal-flash-with-update SIGN=ECC521 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 81 | +
|
| 82 | + - name: Run cryptocb sunnyday test (ECC521) |
| 83 | + run: | |
| 84 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" |
| 85 | +
|
| 86 | + - name: Cleanup to change key type |
| 87 | + run: | |
| 88 | + make keysclean |
| 89 | +
|
| 90 | + - name: Build wolfboot.elf (RSA2048, cryptocb) |
| 91 | + run: | |
| 92 | + make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 93 | +
|
| 94 | + - name: Run cryptocb sunnyday test (RSA2048) |
| 95 | + run: | |
| 96 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "RSA" |
| 97 | +
|
| 98 | + - name: Cleanup to change key type |
| 99 | + run: | |
| 100 | + make keysclean |
| 101 | +
|
| 102 | + - name: Build wolfboot.elf (RSA3072, cryptocb) |
| 103 | + run: | |
| 104 | + make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 105 | +
|
| 106 | + - name: Run cryptocb sunnyday test (RSA3072) |
| 107 | + run: | |
| 108 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "RSA" |
| 109 | +
|
| 110 | + - name: Cleanup to change key type |
| 111 | + run: | |
| 112 | + make keysclean |
| 113 | +
|
| 114 | + - name: Build wolfboot.elf (RSA4096, cryptocb) |
| 115 | + run: | |
| 116 | + make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 117 | +
|
| 118 | + - name: Run cryptocb sunnyday test (RSA4096) |
| 119 | + run: | |
| 120 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "RSA" |
| 121 | +
|
| 122 | + # SHA-384 hash coverage (paired with algorithms that naturally use 384-bit) |
| 123 | + # |
| 124 | + - name: Cleanup to change key type |
| 125 | + run: | |
| 126 | + make keysclean |
| 127 | +
|
| 128 | + - name: Build wolfboot.elf (ECC384 + SHA384, cryptocb) |
| 129 | + run: | |
| 130 | + make clean && make test-sim-internal-flash-with-update SIGN=ECC384 HASH=SHA384 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 131 | +
|
| 132 | + - name: Run cryptocb sunnyday test (ECC384 + SHA384) |
| 133 | + run: | |
| 134 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-384" |
| 135 | +
|
| 136 | + - name: Cleanup to change key type |
| 137 | + run: | |
| 138 | + make keysclean |
| 139 | +
|
| 140 | + - name: Build wolfboot.elf (RSA4096 + SHA384, cryptocb) |
| 141 | + run: | |
| 142 | + make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 HASH=SHA384 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 143 | +
|
| 144 | + - name: Run cryptocb sunnyday test (RSA4096 + SHA384) |
| 145 | + run: | |
| 146 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-384" "RSA" |
| 147 | +
|
| 148 | + # SHA3-384 hash coverage |
| 149 | + # |
| 150 | + - name: Cleanup to change key type |
| 151 | + run: | |
| 152 | + make keysclean |
| 153 | +
|
| 154 | + - name: Build wolfboot.elf (ECC384 + SHA3-384, cryptocb) |
| 155 | + run: | |
| 156 | + make clean && make test-sim-internal-flash-with-update SIGN=ECC384 HASH=SHA3 SPMATH=1 WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 157 | +
|
| 158 | + - name: Run cryptocb sunnyday test (ECC384 + SHA3-384) |
| 159 | + run: | |
| 160 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA3-384" |
| 161 | +
|
| 162 | + # AES encrypted partition coverage (external flash + AES128-CTR) |
| 163 | + # |
| 164 | + - name: Cleanup to change key type |
| 165 | + run: | |
| 166 | + make keysclean |
| 167 | +
|
| 168 | + - name: Build wolfboot.elf (ED25519 + AES128 encrypt, cryptocb) |
| 169 | + run: | |
| 170 | + cp config/examples/sim-encrypt-update.config .config |
| 171 | + make clean && make test-sim-external-flash-with-enc-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 172 | +
|
| 173 | + - name: Run cryptocb sunnyday test (ED25519 + AES128 encrypt) |
| 174 | + run: | |
| 175 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ED25519-verify" "AES-CTR" |
| 176 | +
|
| 177 | + # PQ algorithms (each uses its own config, build + test inline) |
| 178 | + # |
| 179 | + - name: Build and test LMS (cryptocb) |
| 180 | + run: | |
| 181 | + cp config/examples/sim-lms.config .config |
| 182 | + make keysclean && make clean |
| 183 | + make keytools |
| 184 | + make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 185 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" |
| 186 | +
|
| 187 | + - name: Build and test XMSS (cryptocb) |
| 188 | + run: | |
| 189 | + cp config/examples/sim-xmss.config .config |
| 190 | + make keysclean && make clean |
| 191 | + make keytools |
| 192 | + make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 193 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" |
| 194 | +
|
| 195 | + - name: Build and test ML-DSA level 2 (cryptocb) |
| 196 | + run: | |
| 197 | + cp config/examples/sim-ml-dsa.config .config |
| 198 | + make keysclean && make clean |
| 199 | + make keytools |
| 200 | + make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 201 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ML-DSA-verify" |
| 202 | +
|
| 203 | + - name: Build and test ML-DSA level 3 (cryptocb) |
| 204 | + run: | |
| 205 | + cp config/examples/sim-ml-dsa3.config .config |
| 206 | + make keysclean && make clean |
| 207 | + make keytools |
| 208 | + make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 209 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ML-DSA-verify" |
| 210 | +
|
| 211 | + - name: Build and test ML-DSA level 5 (cryptocb) |
| 212 | + run: | |
| 213 | + cp config/examples/sim-ml-dsa5.config .config |
| 214 | + make keysclean && make clean |
| 215 | + make keytools |
| 216 | + make test-sim-internal-flash-with-update WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 217 | + tools/scripts/sim-cryptocb-sunnyday-update.sh "SHA-256" "ML-DSA-verify" |
| 218 | +
|
| 219 | + # Hybrid auth: ML_DSA + ECDSA |
| 220 | + # |
| 221 | + - name: make clean (hybrid) |
| 222 | + run: | |
| 223 | + make keysclean |
| 224 | +
|
| 225 | + - name: Select config (hybrid ML_DSA + ECC) |
| 226 | + run: | |
| 227 | + cp config/examples/sim-ml-dsa-ecc-hybrid.config .config |
| 228 | +
|
| 229 | + - name: Build tools (hybrid) |
| 230 | + run: | |
| 231 | + make -C tools/keytools && make -C tools/bin-assemble |
| 232 | +
|
| 233 | + - name: Build wolfboot.elf (hybrid, cryptocb) |
| 234 | + run: | |
| 235 | + make clean && make WOLFBOOT_TEST_SIM_CRYPTOCB=1 |
| 236 | +
|
| 237 | + - name: Run hybrid boot test with cryptocb verification |
| 238 | + run: | |
| 239 | + ./wolfboot.elf get_version > sim_cryptocb.log 2>/dev/null |
| 240 | + grep -q "sim-cryptocb: hash SHA-256" sim_cryptocb.log || (echo "hash SHA-256 not found" && cat sim_cryptocb.log && exit 1) |
| 241 | + grep -q "sim-cryptocb: pk ML-DSA-verify" sim_cryptocb.log || (echo "pk ML-DSA-verify not found" && cat sim_cryptocb.log && exit 1) |
| 242 | + echo "Hybrid cryptocb verification passed" |
0 commit comments