Implementations for scalar without data-dependent branches #77

pull sipa wants to merge 1 commits into bitcoin-core:master from sipa:scalarc changing 10 files +1194 −57
  1. sipa commented at 11:29 AM on October 29, 2014: contributor

    No description provided.

  2. sipa force-pushed on Oct 29, 2014
  3. sipa force-pushed on Oct 29, 2014
  4. sipa force-pushed on Oct 29, 2014
  5. sipa commented at 4:12 PM on October 29, 2014: contributor

    The code generated by the __int128 based version contains jumps :(

  6. gmaxwell commented at 11:04 PM on October 29, 2014: contributor

    The jmps are from the uint128_t comparisons. (I inquired in the GCC channel, ... Seems GCC needs but doesn't have specialized code for x86_64 to generate the (almost certantly faster) branchless version. of course I got the expected finger wagging about ever expecting to get constant time behavior from compiled code :) ).

    Hopefully we can just union uint128_t and two int64_t and construct the comparison manually without resorting to assembly.

  7. sipa force-pushed on Oct 30, 2014
  8. sipa renamed this:
    Constant-time scalar implementation
    Implementations for scalar without data-dependent branches
    on Oct 30, 2014
  9. sipa commented at 1:57 PM on October 30, 2014: contributor

    Rebased on top of #79, and reworked the accumulators to avoid comparisons on double-register integers. Both the 8x32 version on x86 and the 4x64 version on x86_64 now compile to code without jumps.

  10. sipa force-pushed on Oct 31, 2014
  11. sipa commented at 9:05 AM on October 31, 2014: contributor

    @gmaxwell added some more

  12. sipa force-pushed on Oct 31, 2014
  13. sipa cross-referenced this on Oct 31, 2014 from issue Use Montgomery multiplications in scalar inverses by sipa
  14. sipa force-pushed on Nov 3, 2014
  15. Implementations for scalar without data-dependent branches. 1d52a8b155
  16. sipa force-pushed on Nov 4, 2014
  17. gmaxwell commented at 11:37 PM on November 4, 2014: contributor

    ACK.

  18. sipa merged this on Nov 5, 2014
  19. sipa closed this on Nov 5, 2014

  20. sipa referenced this in commit 985fd63a73 on Nov 5, 2014

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