Skip to content
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

btcec: create new btcec/v2 module that type aliases into the dcrec module #1773

Merged
merged 5 commits into from Jan 27, 2022

Commits on Jan 27, 2022

  1. btcec: convert package into go module, alias to dcrec

    In this commit, we turn the package into a new Go module (version 2),
    and then port over the current set of types and functions to mainly
    alias to the more optimized and maintained dcrec variant.
    
    Taking a look at the benchmarks, most operations other than
    normalization (which IIRC is a bit slower now due to constant time
    fixes) enjoy some nice speeds up:
    ```
    benchcmp is deprecated in favor of benchstat: https://pkg.go.dev/golang.org/x/perf/cmd/benchstat
    benchmark                            old ns/op     new ns/op     delta
    BenchmarkAddJacobian-8               464           328           -29.20%
    BenchmarkAddJacobianNotZOne-8        1138          372           -67.27%
    BenchmarkScalarBaseMult-8            47336         31531         -33.39%
    BenchmarkScalarBaseMultLarge-8       42465         32057         -24.51%
    BenchmarkScalarMult-8                123355        117579        -4.68%
    BenchmarkNAF-8                       582           168           -71.12%
    BenchmarkSigVerify-8                 175414        120794        -31.14%
    BenchmarkFieldNormalize-8            23.8          24.4          +2.39%
    BenchmarkParseCompressedPubKey-8     24282         10907         -55.08%
    ```
    Roasbeef committed Jan 27, 2022
    Copy the full SHA
    87e8fe9 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    eee3c3b View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    d2960c8 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    3ee1211 View commit details
    Browse the repository at this point in the history
  5. build: use sed to remove v2 path from btcec/coverage.txt

    The `goveralls` tool we use to handle code coverage upload seems to not
    understand that a `v2 module can exist, without having a v2 file path on
    disk. We use a `sed` command to remove the `v2` module prefix so the
    tool can reach into the correct file to extract the source code.
    Roasbeef committed Jan 27, 2022
    Copy the full SHA
    b3d263e View commit details
    Browse the repository at this point in the history