-
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
SECP256K1_BUILD sanity checking and USE_FIELD_INV_BUILTIN/USE_SCALAR_INV_BUILTIN simplification. #800
Comments
I don't see why that wouldn't work.
Yeah, I was expecting them to go away after safegcd (and we'd drop gmp/num support entirely; it can always be brought back from history if there is really a need).
The remaining things are:
|
Yes but if you don't use a build system, default to it off? ASM could default on x86_64 ... and on ARM it could emit a warning if it's not used? Static precompute could check for a define set by the header? ... though maybe consider shipping the static table to avoid having to generate it? |
I don't quite understand what the purpose of |
@real-or-random It's used to indicate that we're building the library itself, and not an interface. It matters because secp256k1.h is included both when building the library itself, and by applications linking with it. For the former, we don't want the "nonnull" attributes, as they would make the compiler optimize away our explicit nonnull checks. We only want them as part of the external interface. It's also not set when compiling |
|
If secp256k1.c is built without SECP256K1_BUILD the non-null argument tests get compiled out and then the tests crash.
One way to address that would be to simply have test.c and secp256k1.c set the macro before importing the headers. I think this would be pretty fool-proof. If there is some reason that can't be done secp256k1.c compile could fail if SECP256K1_BUILD isn't set. I prefer the foolproof way because demanding the build system set some define is more trouble for users that aren't using the build system.
Related, USE_FIELD_INV_BUILTIN/USE_SCALAR_INV_BUILTIN should get automatically defaulted. (maybe these go away with safegcd?) right now a non-buildsystem user needs to set them.
Perhaps for the rest too... I think now that there aren't defines needed for the fe/scalar type it should be possible to build with zero defines.
The text was updated successfully, but these errors were encountered: