Curve25519 for ARM Cortex-M0
The software described below is a standalone Curve25519 implementation optimized for speed.Build instructions
Installing llvm, clang, and st-link
To install llvm/clang and an ARM gcc cross-compiler on a Debian system, run the following commands (as root):
Also, you will probably have to install libc6-dev-i386:
To program the Cortex-M0 chip on the development board we need st-link. To download and build this tool, first install the libusb headers (as root):
cd stlink
./autogen.sh
./configure
make && make install
Connecting the STM32F0Discovery development board
For our tests and benchmark we use the STM32F0Discovery development board. To read serial output from this board you will need a USB-TTL converter, which needs to be connected as follows:
- 3.3V → 3.3V
- TXD → PA3
- RXD → PA2
- GND → GND
- 5V → DO NOT CONNECT
The setup should look like in the following picture:
Building Curve25519 for ARM Cortex-M0
To download and build the software for ARM Cortex-M0, run the following commands:
tar xjvf curve25519-cortexm0-20150813.tar.bz2
cd curve25519-cortexm0-20150813
make
Copyright warning: The software package contains a subdirectory named stm32f0xx which contains software copyrighted by ARM Ltd. The files in this subdirectory are thus not in the public domain.
Running tests and benchmarks
Each of the two versions of the software comes with 3 testing and benchmarking routines:
- test/test_stm32f0.sh
- test/speed_stm32f0.sh
- test/stack_stm32f0.sh