Commit Graph

120 Commits

Author SHA1 Message Date
Tim Ruffing 2d5f4cebdc configure: Use CFLAGS_FOR_BUILD when checking native compiler
This fixes a bug where configure would fail or disable static
ecmult tables because it wrongly checks the native compiler using
the target CFLAGS (instead of the native CFLAGS_FOR_BUILD), and
similar for CPPFLAGS and LDFLAGS.

Moreover, this commit adds tests to figure out whether the native
compiler supports the warning flags passed during the build, and it
contains a few minor improvements to the code that checks the native
compiler.
2019-02-10 11:56:36 +01:00
Tim Ruffing c663397f46 Use __GNUC_PREREQ for detecting __builtin_expect 2018-12-17 11:47:25 +01:00
Evan Klitzke 3965027c81
Summarize build options in configure script 2018-03-27 16:10:15 -07:00
Pierre Pronchery 270f6c80db Portability fix for the configure scripts generated
Found thanks to the developer checks from the pkgsrc software
distribution (for NetBSD, SmartOS, Minix, MacOS X, Linux, and more).
2018-02-26 02:22:11 +01:00
Gregory Maxwell b549d3d5f7
Merge #472: [build] Set --enable-jni to no by default instead of auto.
57752d2 [build] Set --enable-jni to no by default instead of auto. (Karl-Johan Alm)

Pull request description:

  Having `--enable-jni` be `auto` doesn't make a lot of sense, and results in things like https://github.com/bitcoin/bitcoin/pull/11056.

Tree-SHA512: 27d6ea041f5d6e249857869ab87b8f7b1f6d18ec5ec82d2c46e692cd690b9f5c5857886725901a29d3539d427d8b6154d0c7909cfa2ce30bb3d4460c05708386
2018-02-06 22:54:03 +00:00
Pieter Wuille 7a78f60598 Print whether we're building benchmarks 2017-09-27 17:25:12 -07:00
Pieter Wuille 4afec9f1ae Build benchmarks by default 2017-09-27 17:25:12 -07:00
Karl-Johan Alm 57752d28b3
[build] Set --enable-jni to no by default instead of auto. 2017-08-17 17:10:57 +09:00
Andrew Poelstra a724d7296d configure: add --enable-coverage to set options for coverage analysis 2016-11-28 03:29:01 +00: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
Pieter Wuille e06e878fd7 Remove Schnorr experiment 2016-11-17 18:55:06 -08:00
Cory Fields 00c5d2e142 fix auto-enabled static precompuatation
This was broken in aa0b1fd149
2016-09-07 12:16:15 -04:00
Pieter Wuille 65285a63ee
Merge #403: configure: add flag to disable OpenSSL tests
a9b2a5d configure: add flag to disable OpenSSL tests (Andrew Poelstra)
2016-07-06 12:08:16 +02:00
Andrew Poelstra a9b2a5d850 configure: add flag to disable OpenSSL tests
OpenSSL messes up valgrind.
2016-07-06 08:25:33 +00:00
Pieter Wuille 24ad20f75b
Merge #399: build: verify that the native compiler works for static precomp
aa0b1fd build: verify that the native compiler works for static precomp (Cory Fields)
2016-06-29 11:11:46 +02:00
Cory Fields aa0b1fd149 build: verify that the native compiler works for static precomp 2016-05-27 15:45:14 -04:00
Pieter Wuille eee808d809 Test whether ECDH and Schnorr are enabled for JNI 2016-05-25 19:15:42 +02:00
Wladimir J. van der Laan 001f1763c7 ARM assembly implementation of field_10x26 inner
Rebased-by: Pieter Wuille <pieter.wuille@gmail.com>
2016-05-25 18:27:47 +02:00
GreenAddress 3093576aa4 JNI library
Squashed and rebased. Thanks to @theuni and @faizkhan00 for doing
the majority of work here! Also thanks to @btchip for help with debugging
and review.
2016-02-01 14:07:18 +01:00
Pieter Wuille 83221ecb00 Add experimental features to configure 2015-11-27 00:20:28 +01:00
Gregory Maxwell 118cd8210f Use explicit symbol visibility.
The use of static makes this somewhat redundant currently, though if
 we later have multiple compilation units it will be needed.

This also sets the dllexport needed for shared libraries on win32.
2015-09-25 05:42:20 +00:00
Pieter Wuille 85e3a2cc08
Merge pull request #112
2b4cf41 Use pkg-config always when possible, with failover to manual checks for libcrypto (Luke Dashjr)
2015-09-04 20:24:42 +02:00
Pieter Wuille 9f443be086 Move pubkey recovery code to separate module 2015-08-28 01:51:52 +02:00
Pieter Wuille 9d96e362a5
Merge pull request #280
ed5334a Update configure.ac to make it build on OpenBSD (mlmikael)
2015-08-04 16:32:39 +02:00
Pieter Wuille a5a66c70b6 Add support for custom EC-Schnorr-SHA256 signatures 2015-08-03 20:08:51 +02:00
Andrew Poelstra 0739bbb6f0 Add ECDH module which works by hashing the output of ecmult_const 2015-08-01 10:57:33 -05:00
mlmikael ed5334a7fe Update configure.ac to make it build on OpenBSD
This update is to make libsecp256k1 build on OpenBSD (more specifically OpenBSD 5.7 with Autotools 2.69).

Without the "AM_PROG_CC_C_O" line in configure.ac, ./autogen.sh crashes with "Makefile.am: C objects in subdir but `AM_PROG_CC_C_O' not in `configure.ac'\nautoreconf-2.69: automake failed with exit status: 1".
2015-07-19 16:07:46 +02:00
Pieter Wuille a83bb48068 Make ecmult static precomputation default 2015-07-15 21:41:51 -04: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
Pieter Wuille 4bc273bd9c
Merge pull request #222
7c3771d Disable overlength-strings warnings. (evoskuil)
2015-02-24 02:37:58 -08:00
evoskuil 7c3771dd0f Disable overlength-strings warnings. 2015-02-23 14:12:25 -08:00
Pieter Wuille ae55e850c7 Use faster byteswapping and avoid alignment-increasing casts. 2015-02-23 04:58:58 -08:00
Luke Dashjr 2b4cf416e7 Use pkg-config always when possible, with failover to manual checks for libcrypto 2015-02-13 23:44:07 +00:00
Gregory Maxwell f735446c4d Convert the rest of the codebase to C89.
Update build system to enforce -std=c89 -pedantic.
2015-01-25 17:44:10 +00:00
Pieter Wuille 7277fd76e2 Remove GMP field implementation 2014-12-17 12:41:31 +01:00
Pieter Wuille 1ba4a60a51 Configure options reorganization 2014-12-13 15:04:28 +01:00
Pieter Wuille 3c0f246e7e
Merge pull request #157
5190079 build: use subdir-objects for automake (Cory Fields)
2014-12-12 15:48:28 +01:00
Pieter Wuille 808dd9b3f5
Merge pull request #156
8336040 build: disable benchmark by default (Cory Fields)
2014-12-12 15:46:50 +01:00
Cory Fields 28ade27da1 build: nuke bashisms 2014-12-11 21:24:35 -05:00
Cory Fields 5190079e31 build: use subdir-objects for automake 2014-12-11 20:18:54 -05:00
Cory Fields 8336040f79 build: disable benchmark by default 2014-12-11 20:09:22 -05:00
Pieter Wuille 5f5a31fe0a
Merge pull request #149
056ad31 Really compile with -O3 by default (Pieter Wuille)
2014-12-11 00:50:21 +01:00
Pieter Wuille 056ad31064 Really compile with -O3 by default 2014-12-09 11:48:34 +01:00
Pieter Wuille 74ad63a9e5
Merge pull request #146
c88e2b8 Compile with -O3 by default (Pieter Wuille)
2014-12-09 11:20:53 +01:00
Cory Fields 1f46b006b7 build: fix __builtin_expect detection for clang
Using AC_CHECK_DECL, the generated test tries to cast the function to void.
Clang doesn't allow that for builtins.
2014-12-08 22:35:02 -05:00
Pieter Wuille c88e2b8cca Compile with -O3 by default 2014-12-09 01:30:43 +01:00
Pieter Wuille 67935050e1 Convert YASM code into inline assembly 2014-12-04 13:54:01 +01:00
Pieter Wuille c35ff1ea44 Convert lambda splitter to pure scalar code.
This enables the use of the endomorphism optimization without bignum.
2014-12-02 16:50:00 +01:00
Pieter Wuille 597128d389 Make num optional 2014-12-01 12:38:38 +01:00
Pieter Wuille d1502eb459 Add secp256k1_scalar_inverse_var which delegates to GMP 2014-11-30 23:38:01 +01:00
Cory Fields e2274c58e6 build: osx: attempt to work with homebrew keg-only packages 2014-11-24 11:49:22 -05:00
Gregory Maxwell a099073a7e Enable warnings.
Wno-unused-function is used for the moment because of the checking
 functions which are currently only used by VERIFY but are not (yet?)
 ifdefed out in normal builds.
2014-11-13 01:45:57 -08:00
kiwigb 6fac238f03 Use same build template as bitcoin. Add bitcoin_secp.m4. 2014-11-07 01:55:27 +13:00
kiwigb db72c181bb Add autoreconf warnings. Replace obsolete AC_TRY_COMPILE.
Remove redundant checks (already done by LT_INIT).
2014-11-06 22:20:05 +13:00
Pieter Wuille 1d52a8b155 Implementations for scalar without data-dependent branches. 2014-11-04 03:01:55 -08:00
Cory Fields 53628757f3 warnings: enable quiet builds 2014-11-03 23:29:24 -08:00
Pieter Wuille 520ba3c921 Remove OpenSSL bignum implementation 2014-10-31 02:10:13 -07:00
Pieter Wuille 3ed6dfae69 Only use the libcrypto part of OpenSSL 2014-09-01 19:45:51 +02:00
Pieter Wuille 1c7fa133a6 Add VERIFY_CHECK/DEBUG_CHECK and use CHECK macros more 2014-08-26 01:23:51 +02:00
Cory Fields 3ab1178d54 build: grab full paths to host tools
This ensures that make will work even if PATH has changed, which is often the
case when cross-compiling.

Fixes cross-compiled builds when integrated into Bitcoin's repo.
2014-07-24 17:20:02 -04:00
Pieter Wuille 728554dfae
Merge pull request #18
4212f7d packaging: add pkg-config file to gitignore (Cory Fields)
67a4765 packaging: fixup pkg-config (Cory Fields)
81b2fae packaging: remove the --with-pkgconfigdir option (Cory Fields)
c7ee71f add pkg-config support (Amir Taaki)
2014-06-03 21:53:58 +02:00
Pieter Wuille 5355746867
Merge pull request #17
a86f241 Add MacPorts default include/lib paths for OSX (Peter Dettman)
2014-06-02 10:51:37 +02:00
Peter Dettman 17eec032c8 Support 64bit_asm field on OSX 2014-06-02 15:33:35 +07:00
Cory Fields 81b2faebd4 packaging: remove the --with-pkgconfigdir option
It was not necessary and would only confuse packagers.
2014-05-20 20:59:14 -04:00
Amir Taaki c7ee71f792 add pkg-config support 2014-05-20 20:39:46 -04:00
Peter Dettman a86f241d08 Add MacPorts default include/lib paths for OSX 2014-05-20 11:39:54 +07:00
Luke Dashjr 282ebc6dbd Fix build on x32 2014-04-10 13:33:55 +00:00
Cory Fields 6e7a6d479a autotools: No need to link against libssl 2014-01-24 17:32:59 -05:00
Cory Fields 0e9baf6fde autotools: changes suggested by Pieter Wuille 2014-01-24 16:57:13 -05:00
Cory Fields 78cd96b151 autotools: autotools'ify libsecp256k1 2014-01-17 23:24:12 -05:00