Curve25519 for AVR ATmega
The software described below is a standalone Curve25519 implementation optimized for speed. We are planning to integrate it into AVRNaCl. It includes two versions, one called "small" and one called "fast". Both of those are optimized for speed, but the small implementation uses slightly slower (and considerably smaller) implementations of multiprecision multiplication and squaring.
Build instructions
Installing an AVR GNU toolchain
In order to build Curve25519 for AVR you need an AVR GNU toolchain installed. On a Debian (jessie) systems this is easily achieved by adding the following line to the file /etc/apt/sources.list:
and then the following commands (as root):
apt-get install gcc-avr binutils-avr avr-libc avrdude
Building Curve25519 for AVR ATmega
To download and build the software for ATmega2560, run the following commands:
tar xjvf curve25519-atmega-20150304.tar.bz2
cd curve25519-atmega-20150304/fast
make
cd ../small
make
Running tests and benchmarks
Each of the two versions of the software comes with 3 testing and benchmarking routines:
- test/test_atmega2560.sh
- test/speed_atmega2560.sh
- test/stack_atmega2560.sh