-
Notifications
You must be signed in to change notification settings - Fork 270
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
Clarify RAM footprint on MCUs #122
Comments
does |
sorry I haven't tried yet, riding on black magik for now 🥂 - will try tomorrow asap |
@vhnatyk Just edit L25 and L27 to they're ORed later with the |
Have you read the docs? If you don't sign, then you need either a verification context or no context at all. Some functions like So playing around with And if you need more scalar and group arithmetic than provided by the functions of |
I tried that 😊 among first attempt - to no success, maybe I can't allocate chunks bigger then some threshold like 32kb or lower (then it's not documented for MCU)
oh, umm - problem probably I wouldn't find better and more established and reviewed lib for secp256k1 curve |
Yeah, the only thing I'm saying is that the aforementioned API functions are the only scalar and group operation that this library offers. If you need other operation, we simply don't support them. (You're of course free to fork the project, but then you're on your own.) |
@vhnatyk ping |
@elichai - hi, for two months thoughts that I have to sort it out are bugging me 🤔 , but always something 'urgent'. It should be much easier since secp256k1 #337 got merged in. But haven't sorted it out yet, unfortunately - seems I should be fine with |
@elichai - very strange, but with
and I tried that right away in |
Excellent :) I think since 0.15.2 we brought some changes in from upstream that helped, though I don't remember the details. |
Hi @real-or-random As you suggested I created a separate issue here in rust-secp256k1.
I'm on very very tiny Linux from Poky/Yocto project and have full std but only with 256KB of RAM available for my app. If I set some very small numbers to define size of precompiled tables like
so it effectively becomes
where
prealloc_size
is 256 due toSECP256K1_ECMULT_GEN_CONTEXT_PREALLOCATED_SIZE
resolves to 256 inWithout those black magik tricks even with
ECMULT_WINDOW_SIZE
4 -prealloc_size
at some step is 65536 and causes SEGFAULT for me. With those small numbers, I'm able to run my code to the point where pure rust libsecp256k1 runs. But with those small numbers all major rust-secp256k1 sign/verify tests failthough all tests in my repo pass. As I understand to avoid black magik I have to switch to static prec defining
USE_ECMULT_STATIC_PRECOMPUTATION
and generatingecmult_static_context.h
with the smallest possible table size. Or since I neither use signing nor verify - just scalar and point math maybe I should disable pre-comp at all if I can? I sawSECP256K1_CONTEXT_NONE
and in your PR Changes necessary for usage on Trezor secp256k1-zkp#53 and there is no method for context none in rust-secp256k1lib.rs
- just All, SignOnly, VerifyOnly.Thanx)
The text was updated successfully, but these errors were encountered: