39 Commits

Author SHA1 Message Date
Pieter Wuille
5048be17e9 Rename valgrind_ctime_test -> ctime_tests 2023-01-11 16:07:37 -05:00
Hennadii Stepanov
ad8647f548
Drop no longer relevant files from .gitignore 2022-12-15 10:56:29 +00:00
Tim Ruffing
092be61c5e gitignore: Add *.sage.py files autogenerated by sage 2022-12-01 12:07:00 +01:00
Hennadii Stepanov
f5039cb66c
Cleanup .gitignore file
The removed line was introduced for `obj/.gitignore` file. Since the
`obj` directory has been removed, it is not longer required.
2022-10-28 16:30:20 +01:00
Hennadii Stepanov
798727ae1e
Revert "Add test logs to gitignore"
This reverts commit bceefd6547635132ba17f022a52db18f17e00df6.
2022-10-28 16:10:46 +01:00
Tim Ruffing
0d253d52e8 configure: Use modern way to set AR
This uses AM_PROG_AR to discover ar, which is the recommended way to do
so. Among other advantages, it honors the AR environment variable (as
set from the outside). The macro has been around since automake 1.11.2
(Dec 2011).

This commit also removes code that discovers ranlib and strip. ranlib
has been obsolete for decades (ar does its task now automatically), and
anyway LT_INIT takes care of discovering it. The code we used to set
STRIP was last mentioned in the automake 1.5 manual. Since automake 1.6
(Mar 2002), strip is discovered automatically when necessary (look for
the *private* macro AM_PROG_INSTALL_STRIP in the automake manual).
2022-03-14 18:35:59 +01:00
Elichai Turkel
517644eab1
Optionally compile the examples in autotools, compile+run in travis 2022-02-23 16:14:58 +02:00
Pieter Wuille
f95b8106d0 Rename gen_ecmult_static_pre_g -> precompute_ecmult 2021-12-17 11:19:45 -05:00
Pieter Wuille
bae77685eb Rename gen_ecmult_gen_static_prec_table -> precompute_ecmult_gen 2021-12-17 11:15:37 -05:00
Tim Ruffing
ad63bb4c29 build: Prebuild and distribute ecmult_gen table
- Improve Makefile.am for both prebuilt tables files
 - On the way, tidy EXTRA_DIST: Move the header files to noinst_HEADERS,
   where they conceptually belong, and add missing SECURITY.md to EXTRA_DIST
2021-12-09 20:52:28 +01:00
Tim Ruffing
9ad09f6911 refactor: Rename program that generates static ecmult_gen table 2021-12-03 11:23:33 +01:00
Pieter Wuille
9f56bdf5b9 Merge bench_schnorrsig into bench 2021-11-05 17:35:11 -04:00
Pieter Wuille
3208557ae1 Merge bench_recover into bench 2021-11-05 17:34:46 -04:00
Pieter Wuille
855e18d8a8 Merge bench_ecdh into bench 2021-11-05 17:34:25 -04:00
Pieter Wuille
2a7be678a6 Combine bench_sign and bench_verify into single bench 2021-11-05 17:30:56 -04:00
siv2r
b4b130678d create csv file from the benchmark output 2021-10-19 21:30:23 +05:30
Russell O'Connor
16a3cc07e8 Generate ecmult_static_pre_g.h
This header contains a static array that replaces the ecmult_context pre_g and pre_g_128 tables.
The gen_ecmult_static_pre_g program generates this header file.
2021-08-20 11:11:26 -04:00
Tim Ruffing
b924e1e605 build: Ensure that configure's compile checks default to -O2
Fixes #896.
2021-07-01 19:59:25 +02: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
Tim Ruffing
8ab24e8dad
Merge #558: Add schnorrsig module which implements BIP-340 compliant signatures
f431b3f28ac95a3645ad5a6dc96b878fa30a1de3 valgrind_ctime_test: Add schnorrsig_sign (Jonas Nick)
16ffa9d97cef93f49544b016339c107882f9a1c3 schnorrsig: Add taproot test case (Jonas Nick)
8dfd53ee3fa059562483d1867815f78b9e00d947 schnorrsig: Add benchmark for sign and verify (Jonas Nick)
4e43520026f5bcd182d21f0759bac159ef47bb62 schnorrsig: Add BIP-340 compatible signing and verification (Jonas Nick)
7332d2db6b62fda851f9ed8adbfda187a875b84e schnorrsig: Add BIP-340 nonce function (Jonas Nick)
7a703fd97db0161bae07ef84513ddde6e0d27353 schnorrsig: Init empty experimental module (Jonas Nick)
eabd9bc46a31c0da6db6d88840eadbe9006447b1 Allow initializing tagged sha256 (Jonas Nick)
6fcb5b845d2832ce019d60507033f74426290768 extrakeys: Add keypair_xonly_tweak_add (Jonas Nick)
58254463f9a2e96d893157a341c9953c440fdf60 extrakeys: Add keypair struct with create, pub and pub_xonly (Jonas Nick)
f0010349b876bc6b3f0a6ec6c8bad0b12ca17b51 Separate helper functions for pubkey_create and seckey_tweak_add (Jonas Nick)
910d9c284c33b77774a9316d4524f313357d441c extrakeys: Add xonly_pubkey_tweak_add & xonly_pubkey_tweak_add_test (Jonas Nick)
176bfb1110147b5dca1834ea071acc846fb1cab3 Separate helper function for ec_pubkey_tweak_add (Jonas Nick)
4cd2ee474d178bd1b5602486104db346a7562c67 extrakeys: Add xonly_pubkey with serialize, parse and from_pubkey (Jonas Nick)
47e6618e11813cfabe91f0909ca031f960cb7dd4 extrakeys: Init empty experimental module (Jonas Nick)
3e08b02e2a78f2a1fc457efab665db8ab8085373 Make the secp256k1_declassify argument constant (Jonas Nick)

Pull request description:

  This PR implements signing, verification and batch verification as described in [BIP-340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki) in an experimental module named `schnorrsig`. It includes the test vectors and a benchmarking tool.
  This PR also adds a module `extrakeys` that allows [BIP-341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki)-style key tweaking.

  (Adding ChaCha20 as a CSPRNG and batch verification was moved to PR #760).

  In order to enable the module run `./configure` with `--enable-experimental --enable-module-schnorrsig`.

  Based on apoelstra's work.

ACKs for top commit:
  gmaxwell:
    ACK f431b3f28ac95a3645ad5a6dc96b878fa30a1de3  (exactly matches the previous post-fixup version which I have already reviewed and tested)
  sipa:
    ACK f431b3f28ac95a3645ad5a6dc96b878fa30a1de3
  real-or-random:
    ACK f431b3f28ac95a3645ad5a6dc96b878fa30a1de3 careful code review

Tree-SHA512: e15e849c7bb65cdc5d7b1d6874678e275a71e4514de9d5432ec1700de3ba92aa9f381915813f4729057af152d90eea26aabb976ed297019c5767e59cf0bbc693
2020-09-11 21:25:34 +02:00
Jonas Nick
4e43520026 schnorrsig: Add BIP-340 compatible signing and verification 2020-09-06 19:00:03 +00:00
Jake Rawsthorne
bceefd6547
Add test logs to gitignore 2020-09-01 00:35:47 +01:00
Gregory Maxwell
3d2302257f Constant-time behaviour test using valgrind memtest.
Valgrind does bit-level tracking of the "uninitialized" status of memory,
 property tracks memory which is tainted by any uninitialized memory, and
 warns if any branch or array access depends on an uninitialized bit.

That is exactly the verification we need on secret data to test for
 constant-time behaviour. All we need to do is tell valgrind our
 secret key is actually uninitialized memory.

This adds a valgrind_ctime_test which is compiled if valgrind is installed:

Run it with libtool --mode=execute:
$ libtool --mode=execute valgrind ./valgrind_ctime_test
2020-02-24 18:59:30 +00:00
Tony Rizko
cb32940df3 Add bench_ecmult to .gitignore 2017-12-30 19:59:17 -08:00
Andrew Poelstra
20b8877be1 Add exhaustive test for group functions on a low-order subgroup
We observe that when changing the b-value in the elliptic curve formula
`y^2 = x^3 + ax + b`, the group law is unchanged. Therefore our functions
for secp256k1 will be correct if and only if they are correct when applied
to the curve defined by `y^2 = x^3 + 4` defined over the same field. This
curve has a point P of order 199.

This commit adds a test which computes the subgroup generated by P and
exhaustively checks that addition of every pair of points gives the correct
result.

Unfortunately we cannot test const-time scalar multiplication by the same
mechanism. The reason is that these ecmult functions both compute a wNAF
representation of the scalar, and this representation is tied to the order
of the group.

Testing with the incomplete version of gej_add_ge (found in 5de4c5dff^)
shows that this detects the incompleteness when adding P - 106P, which
is exactly what we expected since 106 is a cube root of 1 mod 199.
2016-11-25 20:45:29 +00:00
upgradeadvice
70141a85d0 Update .gitignore
Don't ignore everything under build-aux
2016-02-16 16:59:00 -06:00
Pieter Wuille
14727fd9e1 Use correct name in gitignore 2015-08-03 22:40:00 +02:00
Pieter Wuille
a5a66c70b6 Add support for custom EC-Schnorr-SHA256 signatures 2015-08-03 20:08:51 +02:00
Andrew Poelstra
91c0ce95ca Add benchmarks for ECDH and const-time multiplication 2015-08-01 10:57:36 -05:00
Thomas Daede
fbecc38a89 Add ability to use a statically generated ecmult context.
This vastly shrinks the size of the context required for signing on devices with
memory-mapped Flash.

Tables are generated by the new gen_context tool into a header.
2015-07-13 18:00:03 -07:00
Gregory Maxwell
c146b4a446 Add bench_internal to gitignore. 2015-04-22 19:11:19 +00:00
Pavel Janík
6a59012f04 Make git ignore bench_recover when configured with benchmark enabled 2014-12-16 07:43:19 +01:00
Phillip Mienk
8ca6a9c06f Correct .gitignore to correctly account for build-aux. 2014-11-15 19:47:03 -08:00
Pieter Wuille
8f9a307818 Better .gitignore for bench binaries 2014-11-01 06:01:40 -07:00
Cory Fields
d40908763a build: add autogen. How was this missing? 2014-06-19 14:56:23 -04:00
Cory Fields
4212f7d7cb packaging: add pkg-config file to gitignore 2014-05-20 21:04:31 -04:00
Cory Fields
78cd96b151 autotools: autotools'ify libsecp256k1 2014-01-17 23:24:12 -05:00
Pieter Wuille
a16c3a905b Add obj/ directory 2013-04-11 12:46:39 +02:00
Pieter Wuille
f0c89aadc6 Revamp makefile 2013-04-07 01:39:57 +02:00