New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose and use precomputation tables for commitment generators #135
Comments
One option for this could be to generate precomputation tables dynamically when a Another option is to generate precomputation tables statically along with NUMS points. Most of them won't be used, however. A middle ground could be statically creating only the standard |
This is just a first attempt, and is probably not the best way to approach the issue. Comments and suggestions welcome! |
This work adds precomputation support for Pedersen commitments that use a provided generator. Basepoint tables are created via `lazy_static` alongside the generators themselves. When computing a commitment using the default generators, the corresponding tables are used. Commitments using any other generators are unchanged. Closes [issue #135](#135).
Precomputation tables for fixed generators, like those used in commitments and public keys, can provide significant relative performance benefits in scalar-group multiplication operations. The "default" group generator
G
already has a table hardcoded in the curve library, and the API allows you to generate tables for any group element you wish. Aside from using tables for function-based operations like commitments, it may additionally be useful to expose references to these tables for higher-level protocol operations (like commitment signatures) that handle their own scalar-group multiplications.An unfortunate downside of the
dalek
API is that it handles scalar-group multiplication precomputation differently than for multiscalar multiplication operations, and the latter is quite inflexible. There are a few options for how to handle these limitations, some of which might necessitate a custom fork of the curve library to expose some of the guts of the implementation.For reference, local benchmarks suggest a 60% performance gain for generating a Pedersen commitment with the use of precomputation tables for both generators, relative to the use of constant-time multiscalar multiplication with no tables.
The text was updated successfully, but these errors were encountered: