40 Commits

Author SHA1 Message Date
Tim Ruffing
2f0762fa8f field: Remove x86_64 asm
Widely available versions of GCC and Clang beat our field asm on -O2.
In particular, GCC 10.5.0, which is Bitcoin Core's current compiler
for official x86_64 builds, produces code that is > 20% faster for
fe_mul and > 10% faster for signature verification (see #726).

These are the alternatives to this PR:

We could replace our current asm with the fastest compiler output
that we can find. This is potentially faster, but it has multiple
drawbacks:
 - It's more coding work because it needs detailed benchmarks (e.g.,
   with many compiler/options).
 - It's more review work because we need to deal with inline asm
   (including clobbers etc.) and there's a lack of experts reviewers
   in this area.
 - It's not unlikely that we'll fall behind again in a few compiler
   versions, and then we have to deal with this again, i.e., redo the
   benchmarks. Given our history here, I doubt that we'll revolve
   this timely.

We could change the default of the asm build option to off. But this
will also disable the scalar asm, which is still faster.

We could split the build option into two separate options for field
and scalar asm and only disable the field asm by default. But this
adds complexity to the build and to the test matrix.

My conclusion is that this PR gets the low-hanging fruit in terms of
performance. It simplifies our code significantly. It's clearly an
improvement, and it's very easy to review. Whether re-introducing
better asm (whether from a compiler or from CryptOpt) is worth the
hassle can be evaluated separately, and should not hold up this
improvement.

Solves #726.
2023-11-24 08:11:08 +01:00
Jonas Nick
5dab0baa80
README: remove CI badge
We're not solely using cirrus anymore and github already displays the CI status
at a different location.
2023-10-22 11:50:09 +00:00
Tim Ruffing
756b61d451 readme: Use correct build type in CMake/Windows build instructions 2023-03-08 19:21:13 +01:00
Hennadii Stepanov
5468d70964
build: Add CMake-based build system
Co-authored-by: Tim Ruffing <crypto@timruffing.de>
2023-03-08 13:33:16 +00:00
Tim Ruffing
88b00897e7 readme: Fix line break 2022-08-02 10:41:15 +02:00
Tim Ruffing
78f5296da4 readme: Sell "no runtime dependencies" 2022-08-02 10:41:15 +02:00
Tim Ruffing
ef48f088ad readme: Add IRC channel 2022-08-02 10:41:15 +02:00
Elliott Jin
d9d94a9969 doc: mention optional modules in README 2022-03-25 08:14:18 -07:00
Jonas Nick
7f09d0f311 README: mention that ARM assembly is experimental 2022-03-18 13:22:21 +00:00
Jonas Nick
80cf4eea5f build: stop treating schnorrsig, extrakeys modules as experimental 2022-03-17 14:14:08 +00:00
Elichai Turkel
42e03432e6
Add usage examples to the readme 2022-02-23 16:14:59 +02:00
Tim Ruffing
4c94c55bce doc: Remove obsolete hint for valgrind stack size
Also don't mention exhaustive_tests without explanation. They're
included in our test suite (`make check`) anyway.
2021-12-03 11:23:33 +01:00
siv2r
b4b130678d create csv file from the benchmark output 2021-10-19 21:30:23 +05:30
Jonas Nick
99e8614812 README: mention schnorrsig module 2021-05-28 11:40:52 +00:00
Tim Ruffing
09b3bb8648 Clean up git tree
This removes the ununsed `obj` directory. It also suggests in the README
to create the "coverage" files in a separate directory and adds the
coverage files to .gitignore.

readme: Improve instructions for coverage reports
2021-05-14 11:37:44 +02:00
Pieter Wuille
1e0e885c8a Make field/scalar code use the new modinv modules for inverses 2021-03-12 10:06:14 -08:00
Tim Ruffing
2480e55c8f ci: Remove support for Travis CI
So long, and thanks for all fish!
2021-01-29 21:54:07 +01:00
Tim Ruffing
8c02e465c5 ci: Add support for Cirrus CI 2021-01-29 21:54:07 +01:00
Jonas Nick
353dff156f Stop treating ECDH as experimental 2020-10-20 17:49:33 +00:00
Pieter Wuille
4232e5b7da Rip out non-endomorphism code 2020-10-13 11:31:13 -07:00
Marko Bencun
acb7f97eb8
README: add a section for test coverage
It is a hassle to figure out the exact commands to create a good
report.
2020-01-15 11:45:19 +01:00
Tim Ruffing
2e759ec753 Overhaul README.md
* Update feature list
  * Be more positive about the state and quality of the library
  * Mention ECDSA key operations explicitly in short library description
  * Say "secret key" instead of "private key
  * Define "experimental"

Co-Authored-By: Gregory Maxwell <greg@xiph.org>
2019-12-28 14:58:32 +01:00
Tim Ruffing
d644dda5c9
Merge #689: Remove "except in benchmarks" exception for fp math
bde2a32286c697dd1056aa3eb1ea2a5353f0bede Convert bench.h to fixed-point math (Wladimir J. van der Laan)

Pull request description:

  Convert `bench.h` to fixed-point math, removing all use of float math from the repository:

  - Use 64-bit integer microsecond timestamps
  - Use decimal fixed-point math for formatting numbers

  It turned out to be a little trickier than I expected because of formatting and rounding. But, output should be the same before and after.

  I used the following to test the number formatting: https://gist.github.com/laanwj/f971bfbe018e39c19677a21ff954d0c7

ACKs for top commit:
  real-or-random:
    ACK bde2a32286c697dd1056aa3eb1ea2a5353f0bede I've read the code in detail and I've tested it. I haven't explicitly tested the formatting function with known/hardcoded inputs.

Tree-SHA512: 41ab6024b88c65a4b194272097c70d527bedb396dc7ab9d3d93165f1a19d31092798370f66399443a8d5393d0a6dcf5825679de5a325550865cfdef3586bf64c
2019-12-13 13:17:10 +01:00
Wladimir J. van der Laan
bde2a32286 Convert bench.h to fixed-point math
- Use 64-bit integer microsecond timestamps
- Use fixed-point math for formatting numbers

Then, remove "except in benchmarks" exception from `README.md`.
2019-12-13 11:23:39 +01:00
Jonas Nick
387d723c3f
Merge #679: Add SECURITY.md
78c38363412db3ea1cd1f0cc42dd1624c078ee32 Add SECURITY.md (Jonas Nick)

Pull request description:

  Fixes #646

  WIP because the secp256k1-security@bitcoincore.org email address doesn't exist yet. But it seems like the right place for vulnerability reports. security@bitcoincore.org would have the downside that it perhaps reaches more people than necessary. Ideally secp256k1-security would just forward to the three maintainers listed in SECURITY.md. @sipa @apoelstra is it okay to put you there? Fwiw I'm opting out for now because three people should be enough.

  @sipa do you know who to talk to about adding secp256k1-security@bitcoincore.org and the specifics about how it would work?

ACKs for top commit:
  real-or-random:
    ACK 78c38363412db3ea1cd1f0cc42dd1624c078ee32 I looked at the diff and verified my fingerprint

Tree-SHA512: 53a989615665cf8cf0c6a70d3bc2c4b71b68178cae40b2a7881aa9eba24732d126ba1e258a9fc127c69b47bb3025943097300cfcbbe18736cbf92ff4f3a901e0
2019-11-26 19:10:14 +00:00
Tim Ruffing
bae1bea3c4
Make no-float policy explicit
We don't want floating types for various reasons, e.g.,
 - Their representation and often their behavior is implementation-defined.
 - Many targets don't support them.
2019-11-01 10:39:41 +01:00
Jonas Nick
78c3836341 Add SECURITY.md 2019-10-28 14:59:05 +00:00
djb
dcb2e3b3ff
variable signing precompute table
make ECMULT_GEN_PREC_BITS configurable

ecmult_static_context.h: add compile time config assertion (#3) - Prevents accidentally using a file which was generated with a
different configuration.

README: mention valgrind issue

With --with-ecmult-gen-precision=8, valgrind needs a max stack size
adjustment to not run into a stack switching heuristic:

http://valgrind.org/docs/manual/manual-core.html

> -max-stackframe= [default: 2000000]
> The maximum size of a stack frame. If the stack pointer moves by more than this amount then Valgrind will assume that the program is switching to a different stack.
You may need to use this option if your program has large stack-allocated arrays.

basic-config: undef ECMULT_WINDOW_SIZE before (re-)defining it
2019-09-05 09:19:41 +02:00
Marko Bencun
ce6d438266
README.md: update instruction to run tests
Reflecting what Travis does.
2019-07-19 13:50:16 +02:00
Gregory Maxwell
8d1563b0ff Note intention of timing sidechannel freeness.
Resolves #238
2019-05-29 18:43:13 +00:00
MarcoFalke
faa2a11ce5 Update bitcoin-core GitHub links 2016-04-29 23:14:45 +02:00
Gregory Maxwell
b5bbce62e1 Some readme updates, e.g. removal of the GMP field. 2015-01-26 05:07:00 +00:00
Pieter Wuille
6c7f0c621c Update README.md 2014-11-17 14:04:45 +01:00
Pieter Wuille
62c3f55a9d Nothing-up-my-sleeving blinding for a*G 2014-09-01 14:56:12 +02:00
Lucas Betschart
70ef4f548b Update README.md : Travis status
I like that :)
2014-07-03 15:44:08 +02:00
Pieter Wuille
62c5890208 No releases yet anyway 2014-06-21 00:07:37 +02:00
Cory Fields
d40908763a build: add autogen. How was this missing? 2014-06-19 14:56:23 -04:00
John Driscoll
7fc1fb4fa0 Documented autotools build process in readme 2014-05-25 13:54:13 -07:00
Pieter Wuille
8622cc259b More details in README.md 2014-03-30 18:54:55 +02:00
Pieter Wuille
3f37bcc297 Create README.md 2014-03-30 18:22:47 +02:00