-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fully static precomputation tables #893
Comments
Indeed, I totally forgot about randomization. If we had static ecmult_gen tables and static ecmult tables, I think we can still make it easier for users to create contexts.
Right but I don't think they will need to belong to the context, and not everyone will need them.
Yeah sorry, I noticed it when I read your comment again and should have edited my post here.
Hm, I guess not everyone has the same tradeoffs (code size, etc.), so if we get rid of contexts, we'll lose some flexibility. |
Related comment: #918 (comment) |
Currently we offer
secp256k1_context_no_precomp
[1] but it's a "none" context.If static precomputation (for ecmult_gen contexts) is enabled, we could easily offer a static
secp256k1_context_sign
. I believe we should do this and additionally offer static precomputation for ecmult contexts. This will make it possible to offer a staticsecp256k1_context_verify
and a fully staticsecp256k1_context_sign_verify
depending on the compilation flags.I think this is very helpful for embedded targets and is probably much more convenient to use than the prealloc API [2], which requires to users to obtain the size of the context
secp256k1_context_preallocated_size()
at runtime and deal with manual allocation etc.[1] Note that the docs can be improved here. They describe the context in terms of internals ("precomputed tables"). We should also describe this in terms of equivalent context flags. The same is true for the name of this thing.
secp256k1/include/secp256k1.h
Lines 186 to 191 in 8c727b9
[2] Also with behind language bindings #892, see also @gmaxwell's comment there advocating for a fully static context
The text was updated successfully, but these errors were encountered: