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

size of array ‘secp256k1_ecmult_static_context’ is too large #8

Open
xphoniex opened this issue Feb 10, 2023 · 0 comments
Open

Comments

@xphoniex
Copy link

I'm trying to compile this for avr target (arduino) but getting:

$ avr-gcc -c -shared -mmcu=atmega328p src/secp256k1_bundle.c

In file included from src/../secp256k1/src/secp256k1.c:17:0,
                 from src/secp256k1_bundle.c:4:
src/../secp256k1/src/ecmult_impl.h: In functionsecp256k1_ecmult_multi_batch_size_helper’:
src/../secp256k1/src/ecmult_impl.h:78:37: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define ECMULT_MAX_POINTS_PER_BATCH 5000000
                                     ^
src/../secp256k1/src/ecmult_impl.h:1021:30: note: in expansion of macroECMULT_MAX_POINTS_PER_BATCHmax_n_batch_points = ECMULT_MAX_POINTS_PER_BATCH;
                              ^
In file included from src/../secp256k1/src/ecmult_gen_impl.h:14:0,
                 from src/../secp256k1/src/secp256k1.c:19,
                 from src/secp256k1_bundle.c:4:
src/../secp256k1/src/hash_impl.h: In functionsecp256k1_sha256_finalize’:
src/../secp256k1/src/hash_impl.h:156:36: warning: right shift count >= width of type [-Wshift-count-overflow]
     sizedesc[0] = BE32(hash->bytes >> 29);
                                    ^
src/../secp256k1/src/hash_impl.h:34:21: note: in definition of macroBE32#define BE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
                     ^
src/../secp256k1/src/hash_impl.h:34:32: warning: left shift count >= width of type [-Wshift-count-overflow]
 #define BE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
                                ^
src/../secp256k1/src/hash_impl.h:156:19: note: in expansion of macroBE32sizedesc[0] = BE32(hash->bytes >> 29);
                   ^
src/../secp256k1/src/hash_impl.h:156:36: warning: right shift count >= width of type [-Wshift-count-overflow]
     sizedesc[0] = BE32(hash->bytes >> 29);
                                    ^
src/../secp256k1/src/hash_impl.h:34:44: note: in definition of macroBE32#define BE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
                                            ^
src/../secp256k1/src/hash_impl.h:156:36: warning: right shift count >= width of type [-Wshift-count-overflow]
     sizedesc[0] = BE32(hash->bytes >> 29);
                                    ^
src/../secp256k1/src/hash_impl.h:34:68: note: in definition of macroBE32#define BE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
                                                                    ^
src/../secp256k1/src/hash_impl.h:156:36: warning: right shift count >= width of type [-Wshift-count-overflow]
     sizedesc[0] = BE32(hash->bytes >> 29);
                                    ^
src/../secp256k1/src/hash_impl.h:34:94: note: in definition of macroBE32#define BE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
                                                                                              ^
src/../secp256k1/src/hash_impl.h:34:32: warning: left shift count >= width of type [-Wshift-count-overflow]
 #define BE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))
                                ^
src/../secp256k1/src/hash_impl.h:157:19: note: in expansion of macroBE32sizedesc[1] = BE32(hash->bytes << 3);
                   ^
In file included from src/../secp256k1/src/ecmult_gen_impl.h:16:0,
                 from src/../secp256k1/src/secp256k1.c:19,
                 from src/secp256k1_bundle.c:4:
src/../secp256k1/src/ecmult_static_context.h: At top level:
src/../secp256k1/src/ecmult_static_context.h:6:35: error: size of arraysecp256k1_ecmult_static_contextis too large
 static const secp256k1_ge_storage secp256k1_ecmult_static_context[64][16] = {

can this fit into an avr chip's memory, ~2KB ram?
or am I running this incorrectly?

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

No branches or pull requests

1 participant