aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2019-01-12 18:20:10 -0500
committerPaul Selkirk <paul@psgd.org>2019-01-12 18:20:10 -0500
commit44dc84d3696795fbe0b6f1786cabaa08fd88ade6 (patch)
tree34f3fa7cc69b5f89c4c6cc90d6015b24fe9eba53 /projects/hsm
parent07af68c08baefbced001a0081256cb1fff8ed491 (diff)
Timing tests for RSA signing and sub-components thereof.
This is not the sort of thing that should go anywhere near production code, so it's on a dangling branch. I may rebase it from time to time.
Diffstat (limited to 'projects/hsm')
-rw-r--r--projects/hsm/Makefile4
-rw-r--r--projects/hsm/hsm.c8
-rw-r--r--projects/hsm/mgmt-cli.c2
3 files changed, 11 insertions, 3 deletions
diff --git a/projects/hsm/Makefile b/projects/hsm/Makefile
index 3430e14..cd2cfde 100644
--- a/projects/hsm/Makefile
+++ b/projects/hsm/Makefile
@@ -9,6 +9,7 @@ OBJS = mgmt-cli.o \
mgmt-masterkey.o \
mgmt-misc.o \
mgmt-task.o \
+ ../cli-test/mgmt-timing.o \
log.o \
$(TOPLEVEL)/task.o
@@ -16,6 +17,9 @@ CFLAGS += -DNUM_RPC_TASK=4
CFLAGS += -I$(LIBHAL_SRC)
CFLAGS += -I$(LIBCLI_SRC)
+CFLAGS += -I$(LIBTFM_BLD)
+CFLAGS += -I../cli-test
+CFLAGS += -Wno-missing-field-initializers
LIBS += $(LIBHAL_BLD)/libhal.a $(LIBTFM_BLD)/libtfm.a
LIBS += $(LIBCLI_BLD)/libcli.a
diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c
index 29509e8..8075ed6 100644
--- a/projects/hsm/hsm.c
+++ b/projects/hsm/hsm.c
@@ -86,9 +86,8 @@ static uint8_t busy_stack[BUSY_STACK_SIZE];
* 4096-byte block of an FPGA or bootloader image upload.
*/
#ifndef CLI_STACK_SIZE
-#define CLI_STACK_SIZE 8*1024
+#define CLI_STACK_SIZE 200*1024
#endif
-static uint8_t cli_stack[CLI_STACK_SIZE];
/* RPC buffers. For each active request, there will be two - input and output.
*/
@@ -501,7 +500,10 @@ int main(void)
*/
/* Create the CLI task. */
- if (task_add("cli", (funcp_t)cli_main, NULL, cli_stack, sizeof(cli_stack)) == NULL)
+ void *cli_stack = (void *)sdram_malloc(CLI_STACK_SIZE);
+ if (cli_stack == NULL)
+ Error_Handler();
+ if (task_add("cli", (funcp_t)cli_main, NULL, cli_stack, CLI_STACK_SIZE) == NULL)
Error_Handler();
/* Start the tasker */
diff --git a/projects/hsm/mgmt-cli.c b/projects/hsm/mgmt-cli.c
index 2b5be1f..d417314 100644
--- a/projects/hsm/mgmt-cli.c
+++ b/projects/hsm/mgmt-cli.c
@@ -49,6 +49,7 @@
#include "mgmt-keystore.h"
#include "mgmt-masterkey.h"
#include "mgmt-task.h"
+#include "mgmt-timing.h"
#undef HAL_OK
#define HAL_OK LIBHAL_OK
@@ -197,6 +198,7 @@ int cli_main(void)
configure_cli_bootloader(cli);
configure_cli_misc(cli);
configure_cli_task(cli);
+ configure_cli_timing(cli);
while (1) {
control_mgmt_uart_dma_rx(DMA_RX_START);