Add a SECP256K1_CONTEXT_ALL flag #559

issue gwillen opened this issue on October 1, 2018
  1. gwillen commented at 4:48 PM on October 1, 2018: none

    I recently learned that the typical use of libsecp contexts, in non-hot-path situations like during app startup of a heavyweight app, is just to give all the flags all the time.

    I think it would be slightly helpful to document this by creating a SECP256K1_CONTEXT_ALL flag, and commenting it with a note on when it's appropriate to use (i.e. when a few dozen milliseconds aren't a big deal.)

    CC: @apoelstra from earlier discussion

  2. gmaxwell commented at 11:51 AM on June 7, 2019: contributor

    How should this work in a future where there are flags that turn on/off other behaviours and not just control what modes the libraries can be used in? e.g. I was considering a SECP256K1_NO_BIST to disable built in self-tests at context creation time.

  3. apoelstra commented at 7:57 AM on June 8, 2019: contributor

    Heh, I guess we could learn from the many other projects that used "all" for a set of flags which later turned out to be incomplete.

    What if we created a flag SECP256K1_CONTEXT_DEFAULT which created both precomp tables and did the self-tests. Here "default" means "I have enough CPU and RAM that I don't need to think about it".

  4. real-or-random commented at 9:14 AM on June 8, 2019: contributor

    Yep and "default" should then also mean "I'm aware that this may need more CPU and RAM in the future but I know this will never break my current API calls in the future".

  5. jonasnick commented at 8:52 AM on May 9, 2026: contributor

    The context object doesn't really have flags anymore. From include/secp256k1.h:

     *  The only valid non-deprecated flag in recent library versions is
     *  SECP256K1_CONTEXT_NONE, which will create a context sufficient for all functionality
     *  offered by the library. All other (deprecated) flags will be treated as equivalent
     *  to the SECP256K1_CONTEXT_NONE flag.
    
  6. jonasnick closed this on May 9, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-11 16:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me