Improving matrix.

pull/569/head
David Garske 2025-04-21 16:39:16 -07:00 committed by Daniele Lacamera
parent cc63bf92ab
commit 271ae4c2f0
3 changed files with 21 additions and 42 deletions

View File

@ -13,38 +13,14 @@ jobs:
strategy:
fail-fast: false
matrix:
math: [SPMATH=1, SPMATHALL=1, FASTMATH=1]
smallstack: [WOLFBOOT_SMALL_STACK=0 WOLFBOOT_HUGE_STACK=1, WOLFBOOT_SMALL_STACK=1]
include:
- name: ED25519-SHA256
keygen: --ed25519
sign: --ed25519 --sha256
config: SIGN=ED25519 HASH=SHA256
- name: ECC256-SHA256
keygen: --ecc256
sign: --ecc256 --sha256
config: SIGN=ECC256 HASH=SHA256
- name: ECC384-SHA384
keygen: --ecc384
sign: --ecc384 --sha384
config: SIGN=ECC384 HASH=SHA384
- name: ECC521-SHA512
keygen: --ecc521
sign: --ecc521 --sha3
config: SIGN=ECC521 HASH=SHA3
- name: RSA2048-SHA256
keygen: --rsa2048
sign: --rsa2048 --sha256
config: SIGN=RSA2048 HASH=SHA256
- name: RSA3072-SHA384
keygen: --rsa3072
sign: --rsa3072 --sha384
config: SIGN=RSA3072 HASH=SHA384
- name: RSA4096-SHA512
keygen: --rsa4096
sign: --rsa4096 --sha3
config: SIGN=RSA4096 HASH=SHA3
math: [SPMATH=1 WOLFBOOT_SMALL_STACK=0,
SPMATH=1 WOLFBOOT_SMALL_STACK=1,
SPMATHALL=1 WOLFBOOT_SMALL_STACK=0,
SPMATHALL=1 WOLFBOOT_SMALL_STACK=1,
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=0,
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=1]
asym: [ed25519, ecc256, ecc384, ecc521, rsa2048, rsa3072, rsa4096, ed448]
hash: [sha256, sha384, sha3]
steps:
- uses: actions/checkout@v4
with:
@ -55,13 +31,17 @@ jobs:
make keysclean && make -C tools/keytools clean && rm -f include/target.h
- name: Build test-lib
env:
ASYM: ${{ matrix.asym }}
HASH: ${{ matrix.hash }}
run: |
cp config/examples/library.config .config
make keytools
./tools/keytools/keygen ${{ matrix.keygen }} -g wolfboot_signing_private_key.der
./tools/keytools/keygen --${{ matrix.asym }} -g wolfboot_signing_private_key.der
echo "Test" > test.bin
./tools/keytools/sign ${{ matrix.sign }} test.bin wolfboot_signing_private_key.der 1
make test-lib ${{ matrix.math }} ${{ matrix.config }} ${{ matrix.smallstack }}
./tools/keytools/sign --${{ matrix.asym }} --${{ matrix.hash }} test.bin wolfboot_signing_private_key.der 1
# Convert asym and hash to upper case
make test-lib SIGN=${ASYM^^} HASH=${HASH^^}
- name: Run test-lib
run: |

View File

@ -472,7 +472,7 @@ extern int tolower(int c);
#endif
#ifndef WOLFBOOT_SMALL_STACK
# ifdef WOLFSSL_SP_MATH
# if defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_MATH_ALL)
# define WOLFSSL_SP_NO_MALLOC
# define WOLFSSL_SP_NO_DYN_STACK
# endif

View File

@ -1,4 +1,3 @@
/* xmalloc.c
*
* Fixed-pool implementation of malloc/free for wolfBoot
@ -35,13 +34,12 @@
#endif
#include "target.h"
#ifdef WOLFBOOT_SMALL_STACK
#ifdef WOLFBOOT_DEBUG_MALLOC
#include <stdio.h>
#endif
struct xmalloc_slot {
uint8_t *addr;
uint32_t size;
@ -322,8 +320,6 @@ static uint8_t asncheck_buf[ASNCHECK_BUF_SIZE];
#define MPDIGIT_BUF1_SIZE (MP_DIGIT_SIZE * (106 * 4 + 3))
static uint8_t mp_digit_buf1[MPDIGIT_BUF1_SIZE];
#endif
#else
#define MP_SCHEME "SP RSA4096"
#ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM
@ -346,7 +342,7 @@ static uint8_t asncheck_buf[ASNCHECK_BUF_SIZE];
#endif
{ NULL, 0, 0}
};
#else /* FAST MATH */
#else /* Old tom's Fast math (tfm.c) */
#define MP_SCHEME "TFM RSA"
#define MP_INT_TYPE_SIZE (sizeof(mp_int))
#define MP_MONT_REDUCE_BUF_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
@ -409,6 +405,7 @@ void* XMALLOC(size_t n, void* heap, int type)
static int detect_init = 0;
if (detect_init++ == 0) {
printf("MP_SCHEME %s\n", MP_SCHEME);
printf("MP_DIGIT %d\n", (int)MP_DIGIT_SIZE);
dump_pool();
}
printf("MALLOC: Type %d, Size %zd", type, n);
@ -450,3 +447,5 @@ void XFREE(void *ptr, void *heap, int type)
(void)heap;
(void)type;
}
#endif /* WOLFBOOT_SMALL_STACK */