nim-blscurve/tests
Etan Kissling d5d595a59c
Expose Pippenger multiplication for combining multiple sigs of same msg (#178)
* Expose Pippenger multiplication for combining multiple sigs of same msg

In many use cases, there are multiple signatures of the same message,
e.g., Ethereum attestations often share the signed `AttestationData`.

For that situation, `blst` started exposing Pippenger multiplication
to accelerate this use case. Multiscalar multiplication is much faster
than individual scalar multiplication of each signature / pubkey.

Further optimizations may be achieved with parallel tiling, see the Rust
binding code in the `npoints >= 32` situation:

- https://github.com/supranational/blst/blob/v0.3.13/bindings/rust/src/pippenger.rs

Likewise, multiple pubkeys / signatures may be loaded simultaneously
using the new `blst` APIs.

We don't do either of these additional optimizations as our architecture
does not readily support them. Pippenger multiplication alone already
offers a significant speedup until prioritizing further optimizations.

```
------------------------------------------------------------------------------------------------------------------------------------
BLS verif of 6 msgs by 6 pubkeys                                                117.232 ops/s      8530098 ns/op     20471994 cycles
BLS verif of 6 sigs of same msg by 6 pubkeys (with blinding)                    553.186 ops/s      1807711 ns/op      4338371 cycles
BLS verif of 6 sigs of same msg by 6 pubkeys                                    724.279 ops/s      1380683 ns/op      3313617 cycles
------------------------------------------------------------------------------------------------------------------------------------
BLS verif of 60 msgs by 60 pubkeys                                               11.131 ops/s     89839743 ns/op    215615251 cycles
BLS verif of 60 sigs of same msg by 60 pubkeys (with blinding)                  238.059 ops/s      4200634 ns/op     10081380 cycles
BLS verif of 60 sigs of same msg by 60 pubkeys                                  680.634 ops/s      1469219 ns/op      3526031 cycles
------------------------------------------------------------------------------------------------------------------------------------
BLS verif of 180 msgs by 180 pubkeys                                              3.887 ops/s    257298895 ns/op    617517127 cycles
BLS verif of 180 sigs of same msg by 180 pubkeys (with blinding)                166.340 ops/s      6011785 ns/op     14428186 cycles
BLS verif of 180 sigs of same msg by 180 pubkeys                                536.938 ops/s      1862413 ns/op      4469689 cycles
------------------------------------------------------------------------------------------------------------------------------------
```

* Suppress `const` warning for Windows build

* Different approach for dealing with [-Wincompatible-pointer-types]

* Extend documentation
2024-08-12 02:19:19 +00:00
..
fuzzing Add an example fuzzing test 2020-05-21 11:13:28 +03:00
blst_sha256.nim enable `styleCheck:usages` (#136) 2022-04-07 10:12:00 +02:00
download_ef_bls12381_vectors.sh bump `bls12-381-tests` to `v0.1.2` (#162) 2024-02-08 22:29:51 +00:00
eip2333_key_derivation.nim remove MIRACL Core backend (#170) 2024-02-22 15:54:55 +01:00
eth2_vectors.nim remove MIRACL Core backend (#170) 2024-02-22 15:54:55 +01:00
hash_to_curve_v7.nim [Ready] Hash to curve draft 7 + BLS signature draft 2 (#58) 2020-05-28 10:19:21 +02:00
nim.cfg move `-d:nimRawSetjmp` to config.nims (#140) 2022-06-27 11:52:09 +02:00
priv_to_pub.nim enable `styleCheck:usages` (#136) 2022-04-07 10:12:00 +02:00
priv_to_pub.sage Priv to pub blst (#69) 2020-08-12 15:58:46 +02:00
secret_sharing.nim Routines for working with threshold signatures 2022-05-09 15:38:12 +03:00
serialization.nim bump `bls12-381-tests` to `v0.1.2` (#162) 2024-02-08 22:29:51 +00:00
t_batch_verifier.nim Expose Pippenger multiplication for combining multiple sigs of same msg (#178) 2024-08-12 02:19:19 +00:00
test_locator.nim bump `bls12-381-tests` to `v0.1.2` (#162) 2024-02-08 22:29:51 +00:00