This is a simple program to test the speed of the different components used to build a modular-exponentiation-based TLP. It accompanies the paper "Time-Lock Puzzles via Cubing" by Ivo Maffei and Andrew W. Roscoe.
This project provides naive and insecure implementations, as it purpose was only to provide rough time estimates.
See the file in tests output
for an example output of the program.
This program relies on the following libraries (other versions might work, but were not tested):
- GMP version 6.3
- OpenSSL version 3.4
- GNU's Argp
- GNU Make version 3.81
- GCC version 14.2
- Install all the dependencies above. (On MacOS you can use homebrew.)
- Edit the
makefile
to choose your C compiler and the include paths. - Use the
.patch
files to augment GMP with a faster (i.e., no window precomputation) modular exponentiation function. - Compile with
make
. - Run with
./trecubing
.
You can view a list of various options by running ./trecubing --help
.
Here is an example of its output.
Usage: trecubing [OPTION...] [FILENAME|stdout]
Test different primitives for Time-Lock Puzzles via Cubing and outputs the test
results in the file provided.
-n, --iterations=nIters Specify the number of indipendent iterations to
run (default: 100)
-p, --primesize=pSize Specify the (approximate) size in bits for the
modolus to use (default: test all valid sizes)
-s, --securityParam=secpar If non-zero, this specifies that we are using a
prime power modulo whose base has this bitsize
Select one or more of the following 5 if you don't want to test all methods:
-c, --cubing Test the cubing/cube root performance
--clean Clean the output file before writing to it
-e, --encryption Test the stream cipher encryption performance
-m, --moduli Test the performance of prime power modulo
creations
-x, --hashing Test the hashing performance
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
Report bugs to ivo.maffei@uni.lu.