-
Notifications
You must be signed in to change notification settings - Fork 276
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
Better lowmemory feature with precomputed ECMULT #299
Conversation
Nice improvement |
ping @laanwj who originally added this feature |
IMHO This sound interesting mostly because of the stack utilization during context creation (related bitcoin-core/secp256k1#188) but I'm not an embedded person so hard for me to judge that use case. |
Unfortunately,
I'll look into patching |
Actually, compiling and running
|
How do you feel about doing the same thing (static ECMULT precomputation) for the regular memory case? It would eliminate people worrying about the cost of creating and keeping contexts due to CPU/memory costs. cc @TheBlueMatt Maybe separately feature gated, but enabled by default. |
I understand the need for this but I don't think it's the right approach to tackle it here. This should be solved upstream and we more or less agree that pregenerated files should be part of the solution, see the discussion here. bitcoin-core/secp256k1#918 (comment) Once this has been done, integrating this here in the rust bindings should be a matter of turning a flag on (if at all). |
Now that bitcoin-core/secp256k1#988 and bitcoin-core/secp256k1#1042 have been merged, we should get this feature for free by just updating the secp256k1 tree. |
Based on @justinmoon's no_std branch
Reduces the memory cost of a secp context from about 64KB to 704 bytes, while increasing the code section size by 62KB.
Also greatly reduces stack utilization while setting up the context. Previously, about 200KB were being used during context generation, and now we can fit in less than 64KB RAM.