Skip to content
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

Updating secp256k1 and linking with external callbacks #115

Merged
merged 5 commits into from
Jul 4, 2019

Conversation

elichai
Copy link
Member

@elichai elichai commented May 28, 2019

This is the first step of #114

  • Updated secp256k1 library.
  • Added ECMULT_WINDOW_SIZE precompile flag with the default 15 (source at the bottom)
  • Implemented a the callbacks in rust to be linked via USE_EXTERNAL_DEFAULT_CALLBACKS

After this PR all no-std environments that supports liballoc should work (because they should have access to malloc)
But my next step is to use the pre-allocated feature.

Refs:
https://github.com/bitcoin-core/secp256k1/blob/master/configure.ac#L422
https://github.com/bitcoin-core/secp256k1/blob/master/configure.ac#L406

@elichai
Copy link
Member Author

elichai commented May 28, 2019

One thing I'm not sure of is if we should do anything with the message in the callback, because doing anything with it will require libc for no-std (for strlen)

.gitignore Show resolved Hide resolved
src/types.rs Show resolved Hide resolved
src/ffi.rs Outdated Show resolved Hide resolved
@elichai
Copy link
Member Author

elichai commented Jun 13, 2019

I implemented strlen so we can print the message.
if some version of bitcoin-core/secp256k1#639 will get merged upstream I'll remove the implementation and change the callbacks accordingly.

@elichai
Copy link
Member Author

elichai commented Jul 3, 2019

Rebased, replaced the c_char with i8 and a warning.
and removed some comment I missed about derefing the callback message.

@apoelstra
Copy link
Member

Confirmed this eliminates fprintf and abort from the missing symbols in rustwasm/wasm-pack#621

Only remaining ones are malloc and free. ACK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants