Benchmark

The tables below contain the output of the benchmark ant script. To execute the benchmark on your machine use the following command:

ant -f jpbc.xml benchmark

Below is a description of all the pairing parameters used for the tests. In each case the curve group has a 160-bit group order, and k denotes the embedding degree of the curve.

Type Base field size k Dlog security Comments
(bits) (bits)
a 512 2 1024 Good for cryptosystems where group element size is not critical. Uses supersingular curve Y^2 = X^3 + X. Group order is a Solinas prime.
d n n 6 6 n Good for cryptosystems when group elements must be as short as possible. Uses MNT method to generate curves.
e 1024 1 1024 Not useful, but requires only modular arithmetic to implement. Curve easily found using CM method.
f 160 12 1920 Useful for insuring against future finite field discrete log algorithm improvements. Curve found using method due to Paulo Barreto.
g n n 10 10 n Slower than embedding degree 12 pairings, perhaps not worth using. Uses Freeman-Scott algorithm to generate curves.
a1 1024 2 2048 Some cryptosystems need the curve order to be a specific number, e.g. N= p q where p and q are large primes so that N is hard to factorize. We can find a suitable pairing by using the same curve as for type A pairings.

We have executed the benchmark on the following testbeds.

  1. TestBed 1: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 3 GB Ram, Ubuntu 10.04
  2. TestBed 2: iMac Intel(R) Core(TM) 2 Duo @ 2.66GHz, 4 GB Ram, MacOSX 10.6.5
  3. TestBed 3: HTC Desire HD A9191, Android 2.2. (Java Port)

Testbed 1

Benchmark

Benchmark - Average Time (ms) Pairing Type
a a1 d159 d201 d224 e f g149
Pairing#pairing(in1, in2) 14.654 (2.688) 325.276 (58.522) 34.976 (7.776) 54.237 (10.187) 60.697 (12.772) 67.854 (7.98) 166.331 (50.358) 119.976 (22.441)
Pairing#pairing(in1) 7.505 (3.357) 216.053 (67.304) 6.279 (1.636) 9.382 (2.094) 12.314 (2.868) 0.0030 (0.018) 0.0080 (0.015) 0.0090 (1.56)
PairingPreProcessing#pairing(in2) 7.234 (1.114) 117.274 (15.621) 28.834 (6.092) 44.723 (8.026) 48.604 (9.681) 67.07 (8.345) 171.7 (48.833) 119.596 (20.745)
Element Pow (G1)
Element#pow(BigInteger) 18.592 (4.122) 332.025 (43.392) 5.532 (1.557) 8.209 (1.907) 10.136 (2.778) 51.482 (7.181) 5.466 (1.371) 5.019 (1.388)
Element#powZn(Element) 18.588 (3.523) 333.131 (41.173) 5.275 (1.512) 6.784 (1.917) 8.58 (2.738) 51.597 (6.323) 5.247 (1.36) 4.964 (1.329)
Element#pow() 94.807 (14.598) 1737.983 (197.61) 20.859 (6.665) 32.751 (8.773) 42.297 (10.272) 255.076 (30.187) 20.715 (6.627) 18.753 (6.109)
ElementPowPreProcessing#pow(BigInteger) 2.841 (0.543) 55.116 (6.119) 0.66 (0.194) 0.99 (0.307) 1.313 (0.313) 7.477 (0.918) 0.618 (0.208) 0.56 (0.183)
ElementPowPreProcessing#powZn(Element) 2.779 (0.346) 54.918 (5.998) 0.615 (0.172) 0.985 (0.236) 1.325 (0.306) 7.494 (0.869) 0.611 (0.188) 0.565 (0.153)
Element#mul(BigInteger) 19.428 (2.993) 352.999 (41.371) 4.383 (1.251) 7.004 (1.654) 8.907 (1.984) 51.742 (6.354) 4.342 (1.298) 3.936 (1.251)
Element#setToRandom() 61.519 (3.647) 356.176 (3.309) 4.472 (1.813) 7.817 (2.284) 9.011 (2.608) 316.345 (6.939) 4.362 (1.894) 3.981 (1.845)
Element Pow (G2)
Element#pow(BigInteger) 18.796 (4.008) 329.505 (43.811) 33.034 (10.795) 50.116 (13.991) 60.115 (17.397) 65.237 (7.205) 8.227 (2.911) 70.395 (19.925)
Element#powZn(Element) 18.904 (3.658) 331.257 (42.071) 32.891 (10.55) 50.286 (14.016) 60.194 (17.443) 66.105 (6.282) 8.293 (2.805) 70.349 (19.996)
Element#pow() 95.054 (14.957) 1726.461 (205.013) 156.187 (50.621) 243.519 (68.995) 288.73 (84.462) 335.137 (30.017) 38.593 (11.907) 325.196 (94.328)
ElementPowPreProcessing#pow(BigInteger) 2.813 (0.487) 55.005 (6.395) 4.801 (1.565) 7.259 (2.104) 8.883 (2.611) 9.938 (0.919) 1.214 (0.352) 9.936 (2.843)
ElementPowPreProcessing#powZn(Element) 2.809 (0.415) 55.026 (6.267) 4.796 (1.509) 7.289 (2.061) 8.946 (2.566) 9.942 (0.86) 1.226 (0.313) 9.869 (2.792)
Element#mul(BigInteger) 19.515 (3.015) 353.068 (43.407) 33.865 (10.63) 52.208 (14.512) 62.163 (17.743) 68.912 (6.304) 8.688 (2.343) 72.548 (20.134)
Element#setToRandom() 61.467 (3.654) 357.392 (3.542) 100.391 (11.368) 167.748 (15.267) 180.496 (18.469) 422.726 (7.057) 17.175 (2.994) 348.095 (20.875)
Element Pow (GT)
Element#pow(BigInteger) 2.112 (0.529) 35.729 (6.244) 12.437 (2.978) 16.331 (3.781) 17.944 (4.584) 1.092 (0.696) 35.336 (11.829) 29.037 (6.397)
Element#powZn(Element) 2.182 (0.466) 32.43 (6.071) 10.104 (2.757) 14.932 (3.534) 16.919 (4.17) 1.183 (0.314) 35.717 (12.014) 29.357 (6.128)
Element#pow() 14.475 (18.554) 237.474 (90.663) 57.477 (85.239) 84.677 (125.712) 99.505 (139.49) 13.469 (12.364) 245.232 (877.874) 168.238 (367.562)
ElementPowPreProcessing#pow(BigInteger) 0.365 (0.171) 7.505 (1.349) 1.765 (0.511) 2.582 (0.709) 3.221 (0.825) 0.335 (0.105) 7.534 (2.427) 5.269 (1.221)
ElementPowPreProcessing#powZn(Element) 0.376 (0.085) 7.5 (1.203) 1.807 (0.431) 2.607 (0.599) 3.222 (0.715) 0.328 (0.06) 7.484 (2.289) 5.214 (1.108)
Element#mul(BigInteger) 1.751 (0.356) 32.71 (5.273) 10.672 (2.419) 15.633 (3.3) 19.158 (4.071) 0.909 (0.219) 36.463 (14.208) 30.594 (6.714)
Element#setToRandom() 2.965 (1.662) 1.059 (1.531) 5.874 (5.086) 9.946 (5.878) 10.157 (5.981) 4.614 (1.664) 106.518 (50.767) 45.993 (15.21)
Element Pow (Zr)
Element#pow(BigInteger) 0.068 (0.087) 6.315 (2.105) 0.073 (0.103) 0.082 (0.097) 0.191 (0.1) 0.095 (0.101) 0.072 (0.103) 0.059 (0.081)
Element#powZn(Element) 0.07 (0.049) 6.924 (1.54) 0.066 (0.052) 0.076 (0.043) 0.194 (0.061) 0.068 (0.043) 0.075 (0.053) 0.057 (0.033)
Element#pow() 0.871 (0.39) 72.627 (11.18) 1.071 (0.408) 1.248 (0.444) 2.275 (0.524) 0.757 (0.392) 1.124 (0.366) 0.935 (0.277)
ElementPowPreProcessing#pow(BigInteger) 0.021 (0.064) 2.298 (0.415) 0.034 (0.057) 0.04 (0.059) 0.073 (0.059) 0.028 (0.042) 0.043 (0.061) 0.042 (0.043)
ElementPowPreProcessing#powZn(Element) 0.026 (0.015) 2.283 (0.3) 0.038 (0.022) 0.029 (0.015) 0.066 (0.024) 0.023 (0.018) 0.037 (0.028) 0.039 (0.017)
Element#mul(BigInteger) 0.0030 (0.069) 0.011 (0.067) 0.0010 (0.056) 0.0020 (0.051) 0.0 (0.043) 0.0010 (0.057) 0.0030 (0.042) 0.0030 (0.041)
Element#setToRandom() 0.0070 (0.778) 0.075 (0.737) 0.016 (0.917) 0.016 (0.746) 0.024 (0.813) 0.01 (0.714) 0.016 (0.952) 0.0090 (0.731)

Machine Configuration

cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
stepping : 11
cpu MHz : 1596.000
cache size : 4096 KB
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36
clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc
arch_perfmon pebs bts rep_good pni dtes64 monitor ds_cpl vmx est tm2
ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow vnmi flexpriority
bogomips : 4800.38
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
                

Testbed 2

Benchmark

Benchmark - Average Time (ms) Pairing Type
a a1 d159 d201 d224 e f g149
Pairing#pairing(in1, in2) 15.722 (2.191) 275.288 (49.916) 33.579 (11.105) 49.878 (14.115) 57.756 (16.979) 52.745 (6.68) 157.48 (79.063) 104.069 (32.185)
Pairing#pairing(in1) 8.149 (2.742) 182.422 (59.333) 6.432 (1.838) 9.249 (2.366) 12.371 (3.044) 0.0030 (0.0090) 0.013 (0.012) 0.0060 (1.566)
PairingPreProcessing#pairing(in2) 7.459 (1.135) 104.087 (13.947) 27.296 (9.202) 40.798 (11.662) 46.544 (13.73) 52.792 (6.682) 157.356 (79.344) 104.11 (30.518)
Element Pow (G1)
Element#pow(BigInteger) 17.869 (2.885) 300.611 (36.439) 4.441 (1.273) 6.682 (1.719) 8.734 (2.877) 48.091 (6.61) 4.33 (2.135) 3.987 (1.65)
Element#powZn(Element) 17.861 (2.859) 300.397 (36.725) 4.426 (1.251) 6.651 (1.665) 8.737 (2.461) 48.12 (6.234) 4.341 (1.555) 4.007 (3.86)
Element#pow() 88.945 (13.535) 1527.266 (173.805) 21.207 (5.678) 32.74 (7.87) 42.762 (11.368) 238.589 (30.042) 20.874 (8.205) 18.911 (6.972)
ElementPowPreProcessing#pow(BigInteger) 2.633 (0.52) 47.458 (5.367) 0.638 (0.189) 0.978 (0.27) 1.3 (0.419) 7.003 (1.346) 0.641 (0.221) 0.561 (0.292)
ElementPowPreProcessing#powZn(Element) 2.623 (0.378) 47.493 (5.297) 0.641 (0.166) 0.994 (0.216) 1.333 (0.321) 7.01 (1.008) 0.625 (0.139) 0.589 (0.226)
Element#mul(BigInteger) 17.943 (2.927) 302.809 (36.431) 4.44 (1.268) 6.664 (1.727) 8.755 (2.531) 48.108 (6.353) 4.352 (2.279) 4.008 (1.532)
Element#setToRandom() 56.055 (9.556) 304.852 (15.217) 4.52 (7.976) 7.45 (8.411) 8.756 (9.573) 293.706 (14.071) 4.377 (10.398) 4.021 (9.041)
Element Pow (G2)
Element#pow(BigInteger) 17.873 (2.87) 300.6 (37.502) 32.149 (16.25) 47.244 (19.839) 58.212 (25.577) 48.12 (6.321) 8.245 (5.65) 66.164 (38.316)
Element#powZn(Element) 17.865 (2.849) 300.359 (37.933) 32.075 (16.212) 47.208 (19.818) 58.134 (25.775) 48.087 (6.096) 8.244 (6.065) 66.627 (37.715)
Element#pow() 89.203 (13.732) 1525.901 (179.333) 156.809 (77.748) 234.837 (95.666) 289.122 (123.174) 238.394 (33.273) 38.898 (25.53) 314.687 (172.349)
ElementPowPreProcessing#pow(BigInteger) 2.616 (0.425) 47.511 (5.543) 4.862 (2.359) 7.153 (2.858) 9.074 (3.707) 7.001 (0.91) 1.212 (0.77) 9.613 (5.282)
ElementPowPreProcessing#powZn(Element) 2.608 (0.409) 47.494 (5.472) 4.971 (2.323) 7.096 (2.821) 8.942 (3.708) 7.025 (0.812) 1.209 (0.446) 9.51 (5.156)
Element#mul(BigInteger) 17.974 (2.877) 302.799 (37.751) 34.625 (16.37) 49.883 (19.889) 61.255 (25.807) 48.085 (6.341) 8.247 (4.803) 68.905 (37.831)
Element#setToRandom() 56.028 (9.598) 304.855 (15.202) 98.646 (22.938) 156.171 (26.593) 172.913 (33.996) 293.51 (12.962) 16.166 (16.829) 318.142 (44.548)
Element Pow (GT)
Element#pow(BigInteger) 1.514 (0.446) 29.105 (4.983) 10.045 (3.759) 15.883 (4.69) 17.743 (6.088) 0.904 (0.261) 36.17 (27.572) 28.186 (15.484)
Element#powZn(Element) 1.547 (0.424) 28.618 (4.943) 10.032 (3.718) 15.981 (4.632) 17.562 (5.848) 0.902 (0.429) 36.118 (26.013) 28.126 (12.419)
Element#pow() 10.841 (19.592) 219.332 (81.528) 61.235 (130.264) 88.874 (185.267) 101.114 (225.381) 9.738 (24.262) 258.582 (1914.789) 169.381 (1135.543)
ElementPowPreProcessing#pow(BigInteger) 0.322 (0.133) 6.917 (1.316) 1.964 (0.703) 2.798 (0.945) 3.285 (4.253) 0.308 (0.326) 7.943 (25.058) 5.278 (4.55)
ElementPowPreProcessing#powZn(Element) 0.319 (0.096) 6.903 (1.175) 1.977 (0.641) 2.878 (0.817) 3.332 (1.265) 0.293 (0.052) 7.714 (6.946) 5.259 (3.019)
Element#mul(BigInteger) 1.593 (0.449) 29.684 (4.91) 10.017 (3.79) 16.811 (4.705) 18.749 (6.209) 0.9 (1.216) 38.429 (29.985) 30.77 (15.156)
Element#setToRandom() 2.644 (13.879) 0.987 (13.943) 5.345 (42.081) 10.101 (43.166) 9.598 (43.46) 4.644 (8.605) 105.468 (170.08) 43.658 (92.629)
Element Pow (Zr)
Element#pow(BigInteger) 0.053 (0.09) 5.536 (1.11) 0.059 (0.065) 0.079 (0.078) 0.126 (1.286) 0.061 (0.179) 0.057 (0.734) 0.05 (1.394)
Element#powZn(Element) 0.066 (0.025) 5.538 (1.041) 0.052 (0.037) 0.077 (0.032) 0.123 (0.035) 0.056 (0.026) 0.056 (0.164) 0.052 (0.088)
Element#pow() 0.718 (0.303) 61.563 (9.477) 0.81 (0.341) 1.065 (0.34) 1.423 (0.459) 0.704 (0.888) 0.796 (0.514) 0.758 (7.676)
ElementPowPreProcessing#pow(BigInteger) 0.03 (0.035) 1.982 (0.352) 0.027 (0.023) 0.033 (0.026) 0.057 (0.037) 0.021 (0.26) 0.029 (0.471) 0.027 (0.529)
ElementPowPreProcessing#powZn(Element) 0.023 (0.017) 1.97 (0.255) 0.026 (0.028) 0.04 (0.0090) 0.06 (0.019) 0.026 (0.012) 0.024 (0.026) 0.021 (0.108)
Element#mul(BigInteger) 0.0010 (0.036) 0.013 (0.067) 0.0010 (0.032) 0.0010 (0.032) 0.0020 (0.043) 0.0010 (0.021) 0.0 (0.618) 0.0030 (0.877)
Element#setToRandom() 0.0070 (6.752) 0.064 (6.851) 0.0060 (6.874) 0.01 (6.937) 0.012 (6.917) 0.0030 (8.876) 0.012 (7.589) 0.0090 (8.066)

Machine Configuration

Model Name: iMac
Model Identifier: iMac8.1
Processor Name: Intel Core 2 Duo
Processos Speed: 2.66 GHz
Number Of Processors: 1
Total Number of Cores: 2
L2 Cache: 6 MB
Memory: 4GB
Bus Speed: 1.07 GHz
                

Testbed 3

Benchmark

Benchmark - Average Time (ms) Pairing Type
a d159 d201 d224
Pairing#pairing(in1, in2) 491.2 3593.3 4265.8 5187.4
Pairing#pairing(in1) 262.3 264.0 312.7 403.9
PairingPreProcessing#pairing(in2) 245.4 3364.8 4019.0 4908.9
Element Pow (G1)
Element#pow(BigInteger) 258.0 149.9 182.3 237.6
Element#powZn(Element) 260.6 144.8 174.0 212.7
Element#pow 1229.2 617.0 784.3 1002.3
ElementPowPreProcessing#pow(BigInteger) 34.1 19.9 17.3 26.3
ElementPowPreProcessing#powZn(Element) 29.9 17.8 22.2 31.0
Element#mul(BigInteger) 265.6 135.3 172.7 212.0
Element#setToRandom 810.5 134.8 183.3 225.1
Element Pow (G2)
Element#pow(BigInteger) 262.9 2119.5 2505.3 3123.7
Element#powZn(Element) 256.8 2110.5 2483.9 3086.6
Element#pow 1223.6 10093.7 12131.5 15054.1
ElementPowPreProcessing#pow(BigInteger) 37.4 300.5 365.9 458.0
ElementPowPreProcessing#powZn(Element) 35.5 320.4 370.7 487.0
Element#mul(BigInteger) 250.9 2326.5 2738.7 3412.2
Element#setToRandom 804.0 6836.8 8874.2 9981.0
Element Pow (GT)
Element#pow(BigInteger) 71.5 1246.6 1458.9 1803.3
Element#powZn(Element) 75.3 1247.0 1467.5 1827.3
Element#pow 539.8 7816.6 9350.7 11522.4
ElementPowPreProcessing#pow(BigInteger) 20.8 235.9 275.3 355.8
ElementPowPreProcessing#powZn(Element) 19.8 250.4 288.1 371.0
Element#mul(BigInteger) 78.8 1329.9 1600.6 1967.7
Element#setToRandom 58.9 619.2 866.6 862.7
Element Pow (Zr)
Element#pow(BigInteger) 0.5 0.2 0.5 0.3
Element#powZn(Element) 1.3 1.7 1.8 0.7
Element#pow 65.1 67.8 77.1 102.4
ElementPowPreProcessing#pow(BigInteger) 1.3 1.1 2.2 4.8
ElementPowPreProcessing#powZn(Element) 2.8 6.1 5.3 2.0
Element#mul(BigInteger) 0.0 0.5 0.0 0.0
Element#setToRandom 0.2 0.1 0.3 0.1

Machine Configuration

HTC Desire HD A9191