-
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
illegal-callback called with message that says "secp256k1_ecmult_context_is_built(&ctx->ecmult_ctx)" #573
Comments
In C you would need to call |
Sorry forgot to write that my (with-context .....) does setup and teardown of a context with the parameters given on the same line, so yes i have a context setup with SECP256K1_CONTEXT_SIGN before doing anything more. |
Can you post the source of the |
Try SECP256K1_CONTEXT_VERIFY instead |
Oh, yeah, @real-or-random is right. I was confusing the By the way, most crypto operations take 10s of microseconds, while context creation takes 10s of milliseconds, so you are paying a huge performance cost to use the |
I tried to use a SECP256K1_CONTEXT_VERIFY before writting this, but it did not work. tried again and I got the something similier to "[libsecp256k1] illegal argument: secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx)" I then remembered that my (with-context) macro do call secp256k1_context_randomize when setting up the context..
commenting out the line that does the randomization fixes the crash. Things i would like to know/understand
|
Oh, neat. It turns out that Edit: Yep, this is a bug in rust-secp too. Thanks for the report! To work around your problem, just don't call |
Yes this should be documented. But maybe randomizing a non-supported context should be a no-op instead of failing. I'm not sure. |
@gmaxwell @sipa opinions? |
@real-or-random Agree, we should make randomizing a non-signing context a no-op. Batch validation needs randomness, despite being a fully public operation. |
Before this commit secp256k1_context_randomize called illegal_callback when called on a context not initialized for signing. This is not documented. Moreover, it is not desirable because non-signing contexts may use randomization in the future. This commit makes secp256k1_context_randomize a noop in this case. This is safe because the context cannot be used for signing anyway. This fixes bitcoin-core#573 and it fixes rust-bitcoin/rust-secp256k1#82.
6198375 Make randomization of a non-signing context a noop (Tim Ruffing) Pull request description: Before this commit secp256k1_context_randomize called illegal_callback when called on a context not initialized for signing. This is not documented. Moreover, it is not desirable because non-signing contexts may use randomization in the future. This commit makes secp256k1_context_randomize a noop in this case. This is safe because the context cannot be used for signing anyway. This fixes #573 and it fixes rust-bitcoin/rust-secp256k1#82. Tree-SHA512: 34ddfeb004d9da8f4a77c739fa2110544c28939378e779226da52f410a0e36b3aacb3ebd2e3f3918832a9027684c161789cfdc27a133f2f0e0f1c47e8363029c
Before this commit secp256k1_context_randomize called illegal_callback when called on a context not initialized for signing. This is not documented. Moreover, it is not desirable because non-signing contexts may use randomization in the future. This commit makes secp256k1_context_randomize a noop in this case. This is safe because the context cannot be used for signing anyway. This fixes bitcoin-core#573 and it fixes rust-bitcoin/rust-secp256k1#82.
trying to wrap secp256k1 in lisp and I am getting this message when trying to derive a public child key of a public parent key.
my code looks something like this(I have used cl-autowrap, have not given everthing nice names yet)
i get the call to my illegal-callback after the call to tweak-add function and before the call to the ec-pubkey-serialize.
Questions:
what does this message mean? do i need to configure the context in some specific way? do I need to have a scratch-space set up? i have tried with one.
I am running my lisp code in SBCL.
The text was updated successfully, but these errors were encountered: