This repository provides the artifact for "Benchmarking and configuring security levels in intermittent computing" published in ACM Transactions on Embedded Computing Systems. It contains code authored by Archanaa S. Krishnan, Daniel Dinu, and Charles Suslowicz. The implementation details can be found at the publication. If you use this artifact, please cite our paper.
We used several third party implementations were used to create this artifact:
- Secure Intermittent Computing Protocol's (SICP's) cryptographic algorithms are implemented using cifra.
- BEEBs benchmark
- TI's IP Encapsulation feature, IPE
The checkpoint security is in this benchmark is based on an optimized version of the Secure Intermittent Computing Protocol (SICP). At a high-level, it performs the following:
- On checkpoint call:
- Perform authenticated encryption over the checkpoint.
- On power-up:
- Perform authenticated decryption over the checkpoint.
The details of the protocol with optimizations be found in the artifact's publication. The implementation of optimized SICP is available in each benchmark under
sicp
folder, e.g. insicp-bench-template/sicp
.
- Perform authenticated decryption over the checkpoint.
The details of the protocol with optimizations be found in the artifact's publication. The implementation of optimized SICP is available in each benchmark under
Our benchmark used TI's CTPL library, which supports saving the processor state and stack to FRAM upon shutdown and restoring the state when power is returned. The base code for CTPL is example 4 from TI's FRAM Utilities. Due to copyright in CTPL files, we are not including the CTPL utility in this artifact. Refer to TI's MSP-FRAM-UTILTIES for free download options.
benchmark
contains the benchmarks from the publication.ipe
contains an example for implementing TI's IP Encapsulation. IPE feature is typically enabled / disabled using TI's CCS. Since this benchmark was built using GNU tools and not CCS and for ease of benchmarking, IPE is not enabled in the benchmark to emulate tamper-free memory. Instead, IPE is provided as a standalone example in [ipe] folder. Theipe_example
provided in [ipe] folder is a port of TI's IPE example provided in MSP Code Protection Features.sicp-bench-template
contains the template used to add multi-level checkpoint security to BEEBs benchmark.
- Copy
sicp-bench-template
to new project as a base template. - Add additional source/headers in an appropriate new directory.
- Copy the CTPL files from TI FRAM Utilies examples along with the example's main.c. Update #defines in
ctpl/ctpl_msp430fr5994.c
to save the state of desired peripherals and save them in secure or non-secure storage. Update 'ctpl/ctpl_low_level.S' to store the CTPL variables required for checkpoints in secure or non-secure memory. - Replace functionality in
main.c
with desired operation(s). Update the main.c to add the benchmark function, benchmark(), and secure checkpoint function call around the benchmark. - Copy the
rng
folder from TI FRAM Utilities example to generate the nonce associated with the first checkpoint. Due to copyright in RNG files, we are not including therng
folder in our benchmarks. - Update Makefile to include new source and header file declarations.
- Check Makefile build options for your project.
- Update memory map in
msp430fr5994.ld
as necessary for new project. This is only required for projects that need to specify the specific section locations (FRAM, SRAM, stack, etc). - Update your installation of
msp430-elf-gcc
based on [CTPL updates](#CTPL updates to core files) . - Build and Test.
- The files in ctpl reference directory were updated/changed from the default distributed files in msp430-elf-gcc. In both cases defines were not properly detected when gcc was being used to compile assembly files that needed to be pre-processed (.S files).
Changed to properly catch GNU Assembler define for processing .S files.
diff /opt/ti/msp430_gcc/include/in430.h /opt/ti/msp430_gcc/include/in430.h.orig
42c42
< #if !(defined(__ASSEMBLER__) || defined(_GNU_ASSEMBLER))
---
> #if !defined(__ASSEMBLER__)
Changed to properly catch GNU Assembler define for processing .S files.
diff msp430fr5994.h /opt/ti/msp430_gcc/include/msp430fr5994.h.orig
103c103
< #if (!defined(__STDC__) || defined(_GNU_ASSEMBLER_) || defined(__ASSEMBLER__)) /* Begin #defines for assembler */
---
> #ifndef __STDC__ /* Begin #defines for assembler */
- The
msp430fr5994.ld
file contains an updated memory map. - The
Makefile
will create a build directory containing the generated object files (.o), include files (.d), and a defines.txt that contains all defines created during the build process for troubleshooting. The creation of the defines.txt should be removed if your project is very large and it slows down the build process. - The gdb directory contains gdb command files used when connecting/loading/troubleshooting an msp430fr5994 via mspdebug.
- This repository was created and tested against the following version of
msp430-elf-gcc
:$ msp430-elf-gcc --version msp430-elf-gcc (SOMNIUM Technologies Limited - msp430-gcc 6.4.0.32) 6.4.0