Skip to content

Commit 30c29b6

Browse files
committed
Improving matrix.
1 parent 4432fc4 commit 30c29b6

2 files changed

Lines changed: 14 additions & 39 deletions

File tree

.github/workflows/test-library.yml

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,13 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
math: [SPMATH=1, SPMATHALL=1, FASTMATH=1]
17-
smallstack: [WOLFBOOT_SMALL_STACK=0 WOLFBOOT_HUGE_STACK=1, WOLFBOOT_SMALL_STACK=1]
18-
include:
19-
- name: ED25519-SHA256
20-
keygen: --ed25519
21-
sign: --ed25519 --sha256
22-
config: SIGN=ED25519 HASH=SHA256
23-
- name: ECC256-SHA256
24-
keygen: --ecc256
25-
sign: --ecc256 --sha256
26-
config: SIGN=ECC256 HASH=SHA256
27-
- name: ECC384-SHA384
28-
keygen: --ecc384
29-
sign: --ecc384 --sha384
30-
config: SIGN=ECC384 HASH=SHA384
31-
- name: ECC521-SHA512
32-
keygen: --ecc521
33-
sign: --ecc521 --sha3
34-
config: SIGN=ECC521 HASH=SHA3
35-
- name: RSA2048-SHA256
36-
keygen: --rsa2048
37-
sign: --rsa2048 --sha256
38-
config: SIGN=RSA2048 HASH=SHA256
39-
- name: RSA3072-SHA384
40-
keygen: --rsa3072
41-
sign: --rsa3072 --sha384
42-
config: SIGN=RSA3072 HASH=SHA384
43-
- name: RSA4096-SHA512
44-
keygen: --rsa4096
45-
sign: --rsa4096 --sha3
46-
config: SIGN=RSA4096 HASH=SHA3
47-
16+
math: [SPMATH=1 WOLFBOOT_SMALL_STACK=0,
17+
SPMATH=1 WOLFBOOT_SMALL_STACK=1,
18+
SPMATHALL=1 WOLFBOOT_SMALL_STACK=0,
19+
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=0,
20+
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=1]
21+
asym: [ed25519, ecc256, ecc384, ecc521, rsa2048, rsa3072, rsa4096, ed448]
22+
hash: [sha256, sha384, sha3]
4823
steps:
4924
- uses: actions/checkout@v4
5025
with:
@@ -58,10 +33,10 @@ jobs:
5833
run: |
5934
cp config/examples/library.config .config
6035
make keytools
61-
./tools/keytools/keygen ${{ matrix.keygen }} -g wolfboot_signing_private_key.der
36+
./tools/keytools/keygen --${{ matrix.asym }} -g wolfboot_signing_private_key.der
6237
echo "Test" > test.bin
63-
./tools/keytools/sign ${{ matrix.sign }} test.bin wolfboot_signing_private_key.der 1
64-
make test-lib ${{ matrix.math }} ${{ matrix.config }} ${{ matrix.smallstack }}
38+
./tools/keytools/sign --${{ matrix.asym }} --${{ matrix.hash }} test.bin wolfboot_signing_private_key.der 1
39+
make test-lib NO_ASM=1 SIGN=${{ matrix.asym.uppercase }} HASH=${{ matrix.hash.uppercase }} ${{ matrix.smallstack }}
6540
6641
- name: Run test-lib
6742
run: |

src/xmalloc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static uint32_t sha_block[HASH_BLOCK_SIZE];
303303
#endif
304304
static uint8_t asncheck_buf[ASNCHECK_BUF_SIZE];
305305

306-
#ifndef USE_FAST_MATH
306+
#if !defined(USE_FAST_MATH) && !defined(WOLFSSL_SP_MATH_ALL) /* Single Precision */
307307
#ifdef WOLFBOOT_SIGN_RSA2048
308308
#define MP_SCHEME "SP RSA2048"
309309
#ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM
@@ -322,8 +322,6 @@ static uint8_t asncheck_buf[ASNCHECK_BUF_SIZE];
322322
#define MPDIGIT_BUF1_SIZE (MP_DIGIT_SIZE * (106 * 4 + 3))
323323
static uint8_t mp_digit_buf1[MPDIGIT_BUF1_SIZE];
324324
#endif
325-
326-
327325
#else
328326
#define MP_SCHEME "SP RSA4096"
329327
#ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM
@@ -346,7 +344,8 @@ static uint8_t asncheck_buf[ASNCHECK_BUF_SIZE];
346344
#endif
347345
{ NULL, 0, 0}
348346
};
349-
#else /* FAST MATH */
347+
348+
#else /* Old tom's Fast math (tfm.c) */
350349
#define MP_SCHEME "TFM RSA"
351350
#define MP_INT_TYPE_SIZE (sizeof(mp_int))
352351
#define MP_MONT_REDUCE_BUF_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
@@ -409,6 +408,7 @@ void* XMALLOC(size_t n, void* heap, int type)
409408
static int detect_init = 0;
410409
if (detect_init++ == 0) {
411410
printf("MP_SCHEME %s\n", MP_SCHEME);
411+
printf("MP_DIGIT %d\n", (int)MP_DIGIT_SIZE);
412412
dump_pool();
413413
}
414414
printf("MALLOC: Type %d, Size %zd", type, n);

0 commit comments

Comments
 (0)