Bash script to plot openssl speed results.
pairing_bench.sh measures the processing speed of bilinear maps, or pairings, supported in the following open-source repositories:
I chose them because they are active as of
pairing_bench.shv1.3 and have already supported or are expected to support more than 128-bit security.
In the legend on the top of the following figures, loop denotes the core looping process of the bilinear map, fexp denotes final exponentiation, and pairing denotes loop+fexp.
Relic 0.7.0 (preset/x64-pbc-*.sh in the Relic 0.7.0 repository)
Miracle v4.1:
MCL 3.04:
Cf. the figure of 128-bit security below.
128-bit security:
For 128-bit security, the results in [eccbench21] are useful as well.
192-bit security:
Annex D.3.4 of [ISO/IEC 15946-5:2022] gives parameters corresponding to B24-P559, BLS24559, or BLS24_559.
256-bit security:
Annex D.3.5 of [ISO/IEC 15946-5:2022] gives parameters corresponding to B48-P581, BLS48581, or BLS48_581.
On Debian/Ubuntu:
sudo apt install gnuplot git make gcc python
makeandgccare to make binaries in each repository.pythonis to configure test in Miracle.
Download and enter this repository:
git clone https://github.com/KazKobara/plot_openssl_speed.git
cd plot_openssl_speed
Help and usage:
./pairing_bench.sh -h
Command
The following example command saves measurement raw results, their tailored data, and their figures in the ./tmp/Pairing/ folder as *.log, *.dat, and *.png, respectively.
./pairing_bench.sh mcl:v3.04 relic:0.7.0 miracle:v4.1
- The part before
:in each argument is the alias of the repository supported in this script.- The part after
:specifies either a branch name or a tag name for that repository.- For x86-based CPUs,
-t tsc(Time Stamp Counter) option measures CPU cycles using RDTCS/RDTCSP instructions, instead of real time.- For non-x86-based CPUs, you may need to modify
pairing_bensh.shand other files according to the instructions in the repository:
- For Relic 0.7.0, change
x64-pbc-*.shundertmp/Pairing/Relic/relic-0.7.0/presetand adjustpairing_bensh.shfor your CPU.
I measured and depicted the above figures in the following environment:
$ awk '/^PRETTY/ {print substr($0,14,length($0)-14)}' /etc/os-release
Ubuntu 22.04.5 LTS
$ uname -srm
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64
$ awk '{if($1$2 == "modelname"){$1="";$2="";$3=""; model=substr($0,4)}; if($1$2 == "cpuMHz") {max=$4/1000; printf "%s (%.2fGHz)\n",model,max; exit;}}' /proc/cpuinfo
Intel(R) Core(TM) i7-10810U CPU @ 1.10GHz (1.61GHz)