mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-28 17:11:23 +02:00
Set stack size depending on the number of enabled interfaces.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -144,7 +144,7 @@ int sm_wrap() {
|
|||||||
if (sm_indicator == 0) {
|
if (sm_indicator == 0) {
|
||||||
return PICOKEY_OK;
|
return PICOKEY_OK;
|
||||||
}
|
}
|
||||||
uint8_t input[4096];
|
uint8_t input[2048];
|
||||||
size_t input_len = 0;
|
size_t input_len = 0;
|
||||||
memset(input, 0, sizeof(input));
|
memset(input, 0, sizeof(input));
|
||||||
mbedtls_mpi ssc;
|
mbedtls_mpi ssc;
|
||||||
@@ -232,7 +232,7 @@ void sm_update_iv() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int sm_verify() {
|
int sm_verify() {
|
||||||
uint8_t input[4096];
|
uint8_t input[2048];
|
||||||
memset(input, 0, sizeof(input));
|
memset(input, 0, sizeof(input));
|
||||||
uint16_t input_len = 0;
|
uint16_t input_len = 0;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
@@ -241,7 +241,7 @@ int sm_verify() {
|
|||||||
if (data_len % sm_blocksize) {
|
if (data_len % sm_blocksize) {
|
||||||
data_len += sm_blocksize;
|
data_len += sm_blocksize;
|
||||||
}
|
}
|
||||||
if (data_len + (add_header ? sm_blocksize : 0) > 4096) {
|
if (data_len + (add_header ? sm_blocksize : 0) > sizeof(input)) {
|
||||||
return PICOKEY_WRONG_LENGTH;
|
return PICOKEY_WRONG_LENGTH;
|
||||||
}
|
}
|
||||||
mbedtls_mpi ssc;
|
mbedtls_mpi ssc;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ typedef QueueHandle_t queue_t;
|
|||||||
#define queue_is_empty(a) (uxQueueMessagesWaiting(*(a)) == 0)
|
#define queue_is_empty(a) (uxQueueMessagesWaiting(*(a)) == 0)
|
||||||
#define queue_try_remove(a,b) xQueueReceive(*(a), b, 0)
|
#define queue_try_remove(a,b) xQueueReceive(*(a), b, 0)
|
||||||
extern TaskHandle_t hcore0, hcore1;
|
extern TaskHandle_t hcore0, hcore1;
|
||||||
#define multicore_launch_core1(a) xTaskCreatePinnedToCore((void(*)(void *))a, "core1", 4096*5, NULL, CONFIG_TINYUSB_TASK_PRIORITY - 2, &hcore1, 1)
|
#define multicore_launch_core1(a) xTaskCreatePinnedToCore((void(*)(void *))a, "core1", 4096*ITF_TOTAL*2, NULL, CONFIG_TINYUSB_TASK_PRIORITY - 2, &hcore1, 1)
|
||||||
#define multicore_reset_core1() do { if (hcore1) { eTaskState e = eTaskGetState(hcore1); if (e <= eSuspended) { vTaskDelete(hcore1); }} }while(0)
|
#define multicore_reset_core1() do { if (hcore1) { eTaskState e = eTaskGetState(hcore1); if (e <= eSuspended) { vTaskDelete(hcore1); }} }while(0)
|
||||||
#define sleep_ms(a) vTaskDelay(a / portTICK_PERIOD_MS)
|
#define sleep_ms(a) vTaskDelay(a / portTICK_PERIOD_MS)
|
||||||
static inline uint32_t board_millis(void) {
|
static inline uint32_t board_millis(void) {
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ int main(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
xTaskCreatePinnedToCore(core0_loop, "core0", 4096*5, NULL, CONFIG_TINYUSB_TASK_PRIORITY - 1, &hcore0, 0);
|
xTaskCreatePinnedToCore(core0_loop, "core0", 4096*ITF_TOTAL*2, NULL, CONFIG_TINYUSB_TASK_PRIORITY - 1, &hcore0, 0);
|
||||||
#else
|
#else
|
||||||
core0_loop();
|
core0_loop();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CFG_TUD_VENDOR_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
|
#define CFG_TUD_VENDOR_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
|
||||||
#define CFG_TUD_VENDOR_TX_BUFSIZE 4096
|
#define CFG_TUD_VENDOR_TX_BUFSIZE 2048
|
||||||
|
|
||||||
//------------- CLASS -------------//
|
//------------- CLASS -------------//
|
||||||
#define CFG_TUD_CDC 0
|
#define CFG_TUD_CDC 0
|
||||||
|
|||||||
Reference in New Issue
Block a user