expose aggregate_verify_gt() in chia-bls #500
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
to prepare for the BLS cache.
Validating an aggregate signature in BLS can be broken down into the following steps:
1.1 augment the message by pre-pending the public key. The public key is also known as G1.
1.2 map the augmented message to G2 (
hash_to_g2()
)1.3 pair the G1 and G2 points to get a GT point
The pairing operation is quite expensive. As you can see from the benchmark, validating a signature against 1000 GT points is 2 orders of magnitude faster than validating 1000 (key, message)-pairs. The BLS cache caches the GT points to avoid having to compute the pairings multiple times.
The benchmark gives an indication on the speed-up of caching the pairings: