Further changes after making tables static #1065

issue real-or-random openend this issue on January 17, 2022
  1. real-or-random commented at 6:13 pm on January 17, 2022: contributor

    More things to improve after #988:

    • Compile precomputation as a separate object file and link it (solved by #1042)
    • Speed up secp256k1_ecmult_gen_context_build at context creation. It currently computes fixed values which could be made static (open PR: #1120)
    • Document (or set by default) build options to remove unused static tables (and code) when no signing/verification function is called (something like --disable-shared CFLAGS="-fdata-sections -ffunction-sections -O2 -g" LDFLAGS="-Wl,--gc-sections")
    • Document the backwards-compatible API changes made in #988 and in #956: All contexts except the no_precomp context are now effectively signing contexts. The no_precomp context is effectively a verification context., and name is misleading as no context uses dynamic precompuation now. The reason why no_precomp is different is that it’s impossible to re-randomize it.
    • Decide what to do with the no_precomp context: Possibilities include: renaming it, deprecating it (its main user rust-secp256k1 won’t like this), and/or promote it a full signing context, maybe with a verbose name such as “global-context-less-secure” in the spirit of what rust-secp256k1 is doing.
  2. real-or-random cross-referenced this on Jan 19, 2022 from issue Add serde impl for KeyPair by elsirion
  3. real-or-random cross-referenced this on Feb 1, 2022 from issue Context randomization tracking issue by apoelstra
  4. real-or-random commented at 12:14 pm on February 2, 2022: contributor
    * [ ]  Decide what to do with the `no_precomp` context: Possibilities include: renaming it, deprecating it (its main user rust-secp256k1 won't like this), and/or promote it a full signing context, maybe with a verbose name such as "global-context-less-secure" in the spirit of what rust-secp256k1 is doing.
    

    I suggest we

    • rename _no_precomp to _builtin (or similar)
    • keep a deprecated alias _no_precomp
    • expose the self-tests in the public API

    We should get rid of the “signing”/“verification” terminology. But there’s potential for bikeshedding. We could also just call it secp256k1_context_builtin, or secp256k1_context_static, or secp256k1_context_basic which is generic enough that we’ll never have to rename it again, even if we add cpuid/whatever in the future (see #780). A more verbose version will be _no_secret_ops. But ECDH is a secret op but we don’t have blinding… And I don’t mind that people are forced to at least have a glimpse at the docs.

    Does this sound good?

    As a next step, if desired, we could introduce a variant builtin_secret_ops_less_secure (or similar) which is a “signing” context that cannot be randomized… Not sure if we want this.

  5. real-or-random renamed this:
    Futher changes after making tables static
    Further changes after making tables static
    on Feb 8, 2022
  6. jonasnick commented at 3:01 pm on February 22, 2022: contributor

    I suggest we

    • rename _no_precomp to _builtin (or similar)
    • keep a deprecated alias _no_precomp
    • expose the self-tests in the public API

    Concept ACK

    I’m not aware of the full scope of the context redesign discussions, but it seems like people find the no_precomp context useful. You mentioned the name secp256k1_context_static in PM, which I prefer over the mentioned alternatives.

  7. real-or-random cross-referenced this on Jul 5, 2022 from issue ecmult_gen: Skip RNG when creating blinding if no seed is available by real-or-random
  8. real-or-random referenced this in commit 63a3565e97 on Jul 7, 2022
  9. real-or-random added the label documentation on Jan 5, 2023
  10. real-or-random added the label build on Jan 5, 2023
  11. real-or-random added this to the milestone 0.3.1 (or 0.4.0) on Mar 8, 2023
  12. real-or-random removed this from the milestone 0.3.1 (or 0.4.0) on Mar 8, 2023
  13. real-or-random added this to the milestone stable release (1.0.0-rc.1) on Mar 8, 2023


real-or-random jonasnick

Labels
documentation build

Milestone
stable release (1.0.0-rc.1)


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: 2024-12-03 17:15 UTC

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