Split up signing and verification initialization #60

pull sipa wants to merge 2 commits into bitcoin-core:master from sipa:splitsignver changing 5 files +69 −12
  1. sipa commented at 9:10 PM on September 8, 2014: contributor

    Makes it possible to avoid initialization part of the (large and slow to compute) tables if you only need signing or verification.

  2. sipa force-pushed on Sep 8, 2014
  3. sipa commented at 9:12 PM on September 8, 2014: contributor

    Paging @gmaxwell.

  4. sipa force-pushed on Sep 8, 2014
  5. gmaxwell commented at 10:09 PM on September 8, 2014: contributor

    If it's a seperate function then the linker can omit the code when statically linking. The code is so small that I don't know if we care. Alternatively, we could later provide _sign_init and _verify_init functions which the original init just calls, so I think we're not comitted to this way even while keeping the API compatible.

    Have you considered setting a canary value on each of the inits? e.g. instead of depending on behavior around null making sure that if it's initilized its set to some particular unlikely value at the end of init, and reset to something else at the beginning of free? (then checked on all entry)

  6. Split up signing and verification initialization 04e34d18c3
  7. Set precomputation table late and unset early.
    Set the global pointer to the precomputation table only after initializing
    it completely, and unset it before doing any uninitialization.
    
    This causes fail-fast behavior in case of race conditions between
    initialization and operations using it.
    c259a7cbc0
  8. sipa force-pushed on Sep 13, 2014
  9. sipa commented at 3:23 PM on September 13, 2014: contributor

    @gmaxwell Added a commit to switch the global pointer late on initialize, and early on uninitialize. I believe that this should have almost the same effect as canary values inside the structures (apart from unintentional overwrite, of course).

  10. sipa merged this on Sep 28, 2014
  11. sipa closed this on Sep 28, 2014

  12. sipa referenced this in commit b00982fdbd on Sep 28, 2014
  13. real-or-random referenced this in commit 57e6539a7b on May 31, 2019
Contributors

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-04-14 11:15 UTC

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