ECC and GCM for ARM/NEON

Here is the code for the paper “Fast Software Polynomial Multiplication on ARM Processors using  the NEON Engine”. It’s not very organized, but I guess it’s better than nothing…

As usual, it’s based on the RELIC library, so it’s probably good to read its build instructions.

This code was tested on ARM boards (PandaBoard, Arndale) running Linux. It’s possible to run on Android but it’s more contrived (tip: create a standalone toolchain, check the NDK docs).

It was tested with Code Sourcery 2012.09 GCC cross-compiler, but it should be possible (and easier, though slower) to compile it natively.

ECC code

Download ECC code

Build instructions:

unzip relic_arm_ecc.zip
mkdir -p relic_arm_ecc/build
cd relic_arm_ecc/build
CC=/path/to/arm-gcc sh ../preset/arm-ecc-128.sh ..
make
#If you're compiling natively, otherwise copy it to target
bin/test_eb
#This should run benchmarks
bin/bench_eb

Edit ../preset/arm-ecc-128.sh to specify the path to GMP, it will make some parts run faster. You can also change the “-DCORTEX=9” to 8 or 15, which will fine tune some code for each Cortex processor. If you do edit it, apply the preset again and recompile.

GCM code

Download GCM code

Build instructions:

unzip relic_arm_authenc.zip
mkdir -p relic_arm_authenc/build
cd relic_arm_authenc/build
CC=/path/to/arm-gcc sh ../preset/arm-authenc.sh ..
make
#If you're compiling natively, otherwise copy it to target
bin/test_ac
#This should run benchmarks
bin/bench_ac

Authors and License

See the RELIC page for the original RELIC authors. The ARM specific code was developed by Danilo F. Câmara and Conrado P. L. Gouvêa and is licensed with the same license from RELIC (LGPL with additional permissions for static linking).