]> Git Repo - secp256k1.git/log
secp256k1.git
3 years agoAdd secp256k1_tagged_sha256 as defined in BIP-340
Jonas Nick [Fri, 15 Jan 2021 20:58:01 +0000 (20:58 +0000)]
Add secp256k1_tagged_sha256 as defined in BIP-340

Gives users the ability to hash messages to 32 byte before they are signed while
allowing efficient domain separation through the tag.

3 years agoschnorrsig: remove noncefp args from sign; add sign_custom function
Jonas Nick [Fri, 30 Oct 2020 17:48:16 +0000 (17:48 +0000)]
schnorrsig: remove noncefp args from sign; add sign_custom function

This makes the default sign function easier to use while allowing more granular
control through sign_custom.

Tests for sign_custom follow in a later commit.

3 years agoschnorrsig: add algolen argument to nonce_function_hardened
Jonas Nick [Fri, 15 Jan 2021 21:43:23 +0000 (21:43 +0000)]
schnorrsig: add algolen argument to nonce_function_hardened

This avoids having to remove trailing NUL bytes in the nonce function

3 years agoschnorrsig: clarify result of calling nonce_function_bip340 without data
Jonas Nick [Fri, 30 Oct 2020 20:39:48 +0000 (20:39 +0000)]
schnorrsig: clarify result of calling nonce_function_bip340 without data

3 years agoREADME: mention schnorrsig module
Jonas Nick [Fri, 30 Oct 2020 20:36:18 +0000 (20:36 +0000)]
README: mention schnorrsig module

3 years agoMerge #846: ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs
Jonas Nick [Fri, 21 May 2021 21:57:57 +0000 (21:57 +0000)]
Merge #846: ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs

02dcea1ad9441f857c7768e2b7d304bb19fd2a0c ci: Make test iterations configurable and tweak for sanitizer builds (Tim Ruffing)
489ff5c20a1457d0e7d765c8f05856c50c4777a8 tests: Treat empty SECP2561_TEST_ITERS as if it was unset (Tim Ruffing)
fcfcb97e74b55a107290d44c81c049d6168e954f ci: Simplify to use generic wrapper for QEMU, Valgrind, etc (Tim Ruffing)
de4157f13acc43d521e3133ff1d2e7d67484f0ac ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs (Tim Ruffing)

Pull request description:

ACKs for top commit:
  sipa:
    utACK 02dcea1ad9441f857c7768e2b7d304bb19fd2a0c
  jonasnick:
    ACK 02dcea1ad9441f857c7768e2b7d304bb19fd2a0c spot-checked ci output, checked that when `valgrind ./tests` crashes then `LOG_COMPILER=valgrind make check` also crashes.

Tree-SHA512: 5f4a2fe186eca0b4ca29190eb18e20d0804934df614cdc8eb8cf0145ff36ded43194325572bb77eaaeba85c369f6effe69b7bdf7df97ba418d72cf36c9749a8c

3 years agoci: Make test iterations configurable and tweak for sanitizer builds
Tim Ruffing [Mon, 17 May 2021 18:41:15 +0000 (20:41 +0200)]
ci: Make test iterations configurable and tweak for sanitizer builds

3 years agotests: Treat empty SECP2561_TEST_ITERS as if it was unset
Tim Ruffing [Fri, 21 May 2021 09:24:30 +0000 (11:24 +0200)]
tests: Treat empty SECP2561_TEST_ITERS as if it was unset

3 years agoci: Simplify to use generic wrapper for QEMU, Valgrind, etc
Tim Ruffing [Mon, 17 May 2021 15:19:01 +0000 (17:19 +0200)]
ci: Simplify to use generic wrapper for QEMU, Valgrind, etc

3 years agoci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs
Tim Ruffing [Mon, 9 Nov 2020 16:52:12 +0000 (17:52 +0100)]
ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs

3 years agoMerge #941: Clean up git tree
Jonas Nick [Fri, 14 May 2021 20:04:07 +0000 (20:04 +0000)]
Merge #941: Clean up git tree

09b3bb8648fec903e4ac2ec1d047503d5f0f48d7 Clean up git tree (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 09b3bb8648fec903e4ac2ec1d047503d5f0f48d7

Tree-SHA512: 70db146f4475e9618ecd68cf678d09a351e8da6c4fd4aa937c3f2fa30e3f6a9480ff24ac6301785fc2463bb5f8ff974091f8e9292ae7674ca9632b449a7034d5

3 years agoClean up git tree
Tim Ruffing [Wed, 12 May 2021 09:49:36 +0000 (11:49 +0200)]
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

3 years agoMerge #930: Add ARM32/ARM64 CI
Jonas Nick [Thu, 13 May 2021 19:31:49 +0000 (19:31 +0000)]
Merge #930: Add ARM32/ARM64 CI

8bbad7a18e5dc5054b27ae44ea0c8dffe050f6bf Add asm build to ARM32 CI (Pieter Wuille)
7d65ed5214273275841f5aa272ad561df7ea7f21 Add ARM32/ARM64 CI (Pieter Wuille)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 8bbad7a18e5dc5054b27ae44ea0c8dffe050f6bf CI output looks fine
  jonasnick:
    ACK 8bbad7a18e5dc5054b27ae44ea0c8dffe050f6bf

Tree-SHA512: 090a52af6914cf9fb659f9626a8224d82c8da81f6e628b7300e34851e198d8299dfd25789c0f1d6f2c79f58b5413be498f9fba43bc50238480fe6524b640538a

3 years agoMerge #850: add `secp256k1_ec_pubkey_cmp` method
Jonas Nick [Thu, 13 May 2021 19:17:35 +0000 (19:17 +0000)]
Merge #850: add `secp256k1_ec_pubkey_cmp` method

6eceec6d566898a5c157630e47f95b260767026b add `secp256k1_xonly_pubkey_cmp` method (Andrew Poelstra)
0d9561ae879848191a14bcc67db87cbfd44fb69a add `secp256k1_ec_pubkey_cmp` method (Andrew Poelstra)

Pull request description:

ACKs for top commit:
  elichai:
    Code review ACK 6eceec6d566898a5c157630e47f95b260767026b
  jonasnick:
    ACK 6eceec6d566898a5c157630e47f95b260767026b
  real-or-random:
    ACK 6eceec6d566898a5c157630e47f95b260767026b

Tree-SHA512: f95cbf65f16c88a4adfa1ea7cc6ddabab14baa3b68fa069e78e6faad4852cdbfaea42ee72590d2e0b8f3159cf9b37969511550eb6b2d256b101e2147711cc817

3 years agoMerge bitcoin-core/secp256k1#940: contrib: Explain explicit header guards
Pieter Wuille [Wed, 12 May 2021 03:10:00 +0000 (20:10 -0700)]
Merge bitcoin-core/secp256k1#940: contrib: Explain explicit header guards

22a9ea154a280987be7cf8322156c8738c41c3c5 contrib: Explain explicit header guards (Tim Ruffing)

Pull request description:

  They were added in #925 and deserve a comment.

ACKs for top commit:
  gmaxwell:
    ACK 22a9ea154a280987be7cf8322156c8738c41c3c5
  sipa:
    ACK 22a9ea154a280987be7cf8322156c8738c41c3c5

Tree-SHA512: 832e28d71857d52912dae7e6c0e08a3183bb788996bb2470616c6fbbac6ba601cc74bb51a4c908aec7df9ae4f4cbf2cbb1b451cefde1b5a7359dc93299840278

3 years agoMerge #926: secp256k1.h: clarify that by default arguments must be != NULL
Tim Ruffing [Fri, 7 May 2021 21:20:05 +0000 (23:20 +0200)]
Merge #926: secp256k1.h: clarify that by default arguments must be != NULL

0881633dfd0c530a915cf63be295f00841c94cc4 secp256k1.h: clarify that by default arguments must be != NULL (Jonas Nick)

Pull request description:

  The same file says that the illegal callback will only triger for violations
  explicitly mentioned, which is not true without this commit because we often
  don't mention that an argument is not allowed to be NULL.

  This line is extracted from #783 in the hope that it gets merged faster because other PRs depend on it.

ACKs for top commit:
  gmaxwell:
    ACK 0881633dfd0c530a915cf63be295f00841c94cc4
  real-or-random:
    ACK 0881633dfd0c530a915cf63be295f00841c94cc4

Tree-SHA512: ecdc6954a1c21c333da5b03db51f50a0e53984aaef69cc697adaddc96b276da23e342037f476d21742632f6ec02bfa0574f837a5b5791f5985f4c355037176fa

3 years agoadd `secp256k1_xonly_pubkey_cmp` method
Andrew Poelstra [Mon, 30 Nov 2020 18:42:32 +0000 (18:42 +0000)]
add `secp256k1_xonly_pubkey_cmp` method

3 years agoadd `secp256k1_ec_pubkey_cmp` method
Andrew Poelstra [Sun, 22 Nov 2020 17:33:46 +0000 (17:33 +0000)]
add `secp256k1_ec_pubkey_cmp` method

3 years agocontrib: Explain explicit header guards
Tim Ruffing [Thu, 6 May 2021 15:12:11 +0000 (17:12 +0200)]
contrib: Explain explicit header guards

They were added in #925 and deserve a comment.

3 years agoMerge #937: Have ge_set_gej_var, gej_double_var and ge_set_all_gej_var initialize...
Tim Ruffing [Thu, 6 May 2021 07:38:18 +0000 (09:38 +0200)]
Merge #937: Have ge_set_gej_var, gej_double_var and ge_set_all_gej_var initialize all fields of their outputs.

14c9739a1fb485bb56dbe3447132a37bcbef4e22 tests: Improve secp256k1_ge_set_all_gej_var for some infinity inputs (Tim Ruffing)
4a19668c37bc77d0165f4a1c0e626e321e9c4a09 tests: Test secp256k1_ge_set_all_gej_var for all infinity inputs (Tim Ruffing)
45b6468d7e3ed9849ed474c71e9a9479de1a77db Have secp256k1_ge_set_all_gej_var initialize all fields. Previous behaviour would not initialize r->y values in the case where infinity is passed in. Furthermore, the previous behaviour wouldn't initialize anything in the case where all inputs were infinity. (Russell O'Connor)
31c0f6de413e521731ad0e63424431b3dd49cec8 Have secp256k1_gej_double_var initialize all fields. Previous behaviour would not initialize r->x and r->y values in the case where infinity is passed in. (Russell O'Connor)
dd6c3de322740a3054cf6a1994a38dc8f201b473 Have secp256k1_ge_set_gej_var initialize all fields. Previous behaviour would not initialize r->x and r->y values in the case where infinity is passed in. (Russell O'Connor)

Pull request description:

  Previous behaviour would not initialize `r->x` and `r->y` values in the case where infinity is passed in.

ACKs for top commit:
  gmaxwell:
    ACK 14c9739a1fb485bb56dbe3447132a37bcbef4e22
  sipa:
    utACK 14c9739a1fb485bb56dbe3447132a37bcbef4e22
  real-or-random:
    ACK 14c9739a1fb485bb56dbe3447132a37bcbef4e22

Tree-SHA512: 2e779b767f02e348af4bbc62aa9871c3d1d29e61a6c643c879c49f2de27556a3588850acd2f7c7483790677597d01064025e14befdbf29e783f57996fe4430f9

3 years agoMerge #925: changed include statements without prefix 'include/'
Tim Ruffing [Wed, 5 May 2021 18:14:39 +0000 (20:14 +0200)]
Merge #925: changed include statements without prefix 'include/'

3c90bdda95aa4e79ff33bfbbbe91872417650ae9 change local lib headers to be relative for those pointing at "include/" dir (William Bright)

Pull request description:

  Referencing #924 , this PR splits the two issues brought on to a smaller to digest change. What this does is removes the prefix "include/" when referencing the local library header files.

  e.g:
  from:
  ```cpp
  #include "include/secp256k1.h"
  ```
  to:
  ```cpp
  #include "secp256k1.h"
  ```

  Rationale besides styling and consistency across other files in the repo, it makes it easier for outside builds to properly locate the headers.

  A live example seen here when attempting to build this library within bitcoin repo:
  ```sh
  [ 14%] Building CXX object leveldb/CMakeFiles/leveldb.dir/util/bloom.cc.o
  /tmp/bitcoin/src/secp256k1/src/secp256k1.c:7:10: fatal error: include/secp256k1.h: No such file or directory
      7 | #include "include/secp256k1.h"
        |          ^~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[2]: *** [secp256k1/CMakeFiles/Secp256k1.dir/build.make:76: secp256k1/CMakeFiles/Secp256k1.dir/src/secp256k1.c.o] Error 1
  make[1]: *** [CMakeFiles/Makefile2:537: secp256k1/CMakeFiles/Secp256k1.dir/all] Error 2
  make[1]: *** Waiting for unfinished jobs....

  ```

ACKs for top commit:
  gmaxwell:
    ACK 3c90bdda95aa4e79ff33bfbbbe91872417650ae9
  real-or-random:
    ACK 3c90bdda95aa4e79ff33bfbbbe91872417650ae9 code looks good and even the tests compile fine now without `-I` args

Tree-SHA512: 94d212718c6f4901f1c310aff504b7afedda91268143ffe1b45e9883cd517c0599e40ac798a51b54d66cd31646fe8cb1a489f1776612cfb5963654f4a1cee757

3 years agotests: Improve secp256k1_ge_set_all_gej_var for some infinity inputs
Tim Ruffing [Wed, 5 May 2021 07:38:22 +0000 (09:38 +0200)]
tests: Improve secp256k1_ge_set_all_gej_var for some infinity inputs

3 years agotests: Test secp256k1_ge_set_all_gej_var for all infinity inputs
Tim Ruffing [Wed, 5 May 2021 07:38:22 +0000 (09:38 +0200)]
tests: Test secp256k1_ge_set_all_gej_var for all infinity inputs

3 years agochange local lib headers to be relative for those pointing at "include/" dir
William Bright [Tue, 4 May 2021 17:19:33 +0000 (13:19 -0400)]
change local lib headers to be relative for those pointing at "include/" dir

added relative paths to header files imported from src directory

added include guards for contrib/ files when referring to secp256k1.h

3 years agoHave secp256k1_ge_set_all_gej_var initialize all fields.
Russell O'Connor [Tue, 4 May 2021 20:17:00 +0000 (16:17 -0400)]
Have secp256k1_ge_set_all_gej_var initialize all fields.
Previous behaviour would not initialize r->y values in the case where infinity is passed in.
Furthermore, the previous behaviour wouldn't initialize anything in the case where all inputs were infinity.

3 years agoHave secp256k1_gej_double_var initialize all fields.
Russell O'Connor [Tue, 4 May 2021 19:49:48 +0000 (15:49 -0400)]
Have secp256k1_gej_double_var initialize all fields.
Previous behaviour would not initialize r->x and r->y values in the case where infinity is passed in.

3 years agoHave secp256k1_ge_set_gej_var initialize all fields.
Russell O'Connor [Tue, 4 May 2021 18:59:47 +0000 (14:59 -0400)]
Have secp256k1_ge_set_gej_var initialize all fields.
Previous behaviour would not initialize r->x and r->y values in the case where infinity is passed in.

3 years agoMerge bitcoin-core/secp256k1#936: Fix gen_context/ASM build on ARM
Pieter Wuille [Tue, 4 May 2021 18:30:32 +0000 (11:30 -0700)]
Merge bitcoin-core/secp256k1#936: Fix gen_context/ASM build on ARM

c8483520c9077905a1dc8b9adb88b6ea2a3bd9ef Makefile.am: Don't pass a variable twice (Tim Ruffing)
2161f31785e66e4e46471208610b5e3e98331849 Makefile.am: Honor config when building gen_context (Tim Ruffing)
99f47c20ec41279075d6b3ae64c9c1a84b40a6f8 gen_context: Don't use external ASM because it complicates the build (Tim Ruffing)

Pull request description:

  Obsoletes #935.

ACKs for top commit:
  gmaxwell:
    ACK c8483520c9077905a1dc8b9adb88b6ea2a3bd9ef   looks good and works here. Undefign is kinda yuck, but it is already doing it and it's cleaner than the obvious alternatives.
  sipa:
    utACK c8483520c9077905a1dc8b9adb88b6ea2a3bd9ef. I verified that building still works on ARM64, but without asm of course.

Tree-SHA512: fc5500688b2aecc4238e21c32f65559bcbfd1e83d1ae4d2c8e15573e94613667731064d8b5f2b9e4209016d88118263802ff4b9a73c1f37c224ccf2a4a1d6536

3 years agoAdd asm build to ARM32 CI
Pieter Wuille [Sun, 2 May 2021 20:39:22 +0000 (13:39 -0700)]
Add asm build to ARM32 CI

3 years agoAdd ARM32/ARM64 CI
Pieter Wuille [Sun, 2 May 2021 19:48:38 +0000 (12:48 -0700)]
Add ARM32/ARM64 CI

3 years agoMakefile.am: Don't pass a variable twice
Tim Ruffing [Mon, 3 May 2021 12:11:38 +0000 (14:11 +0200)]
Makefile.am: Don't pass a variable twice

3 years agoMakefile.am: Honor config when building gen_context
Tim Ruffing [Mon, 3 May 2021 11:05:33 +0000 (13:05 +0200)]
Makefile.am: Honor config when building gen_context

This passes $(DEFS) (which should literally be "-DHAVE_CONFIG_H") to the
compiler when building gen_context.

This has currently no effect because gen_context.c does not check for
this macro but it's conceivable that it may do so in the future.

3 years agogen_context: Don't use external ASM because it complicates the build
Tim Ruffing [Mon, 3 May 2021 12:11:08 +0000 (14:11 +0200)]
gen_context: Don't use external ASM because it complicates the build

Fixes #931.

3 years agoMerge #933: Avoids a missing brace warning in schnorrsig/tests_impl.h on old compilers
Jonas Nick [Mon, 3 May 2021 09:51:28 +0000 (09:51 +0000)]
Merge #933: Avoids a missing brace warning in schnorrsig/tests_impl.h on old compilers

99e2d5be0dba938b7701d157cba86252db9eb61c Avoids a missing brace warning in schnorrsig/tests_impl.h on old compilers. (Gregory Maxwell)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 99e2d5be0dba938b7701d157cba86252db9eb61c
  jonasnick:
    utACK 99e2d5be0dba938b7701d157cba86252db9eb61c

Tree-SHA512: f3f9cfcd62830d7accca74dfce40abb091dec0990a66bad5d2a9599f2533121d8d1422499d511512bfb8d7c57da96e29e012dbc210e2e97ad55ad18de0869735

3 years agoAvoids a missing brace warning in schnorrsig/tests_impl.h on old compilers.
Gregory Maxwell [Sun, 2 May 2021 20:02:12 +0000 (20:02 +0000)]
Avoids a missing brace warning in schnorrsig/tests_impl.h on old compilers.

GCC 4.9.2, at least, emits "warning: missing braces around initializer"
 without this.

3 years agoMerge #922: Add mingw32-w64/wine CI build
Jonas Nick [Sun, 2 May 2021 12:57:34 +0000 (12:57 +0000)]
Merge #922: Add mingw32-w64/wine CI build

ed5a199bed65bf084f34ce18d35807d31a1c75bb tests: fopen /dev/urandom in binary mode (Tim Ruffing)
4dc37bf81b55b9a3ffcf09f7a212436d25844710 Add mingw32-w64/wine CI build (Pieter Wuille)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK ed5a199bed65bf084f34ce18d35807d31a1c75bb
  jonasnick:
    utACK ed5a199bed65bf084f34ce18d35807d31a1c75bb

Tree-SHA512: 45afc394e3a200f7c020426a66f78df8d12827b9dc91bb04dc1708c3ad5cdc4e7d20554d6d5c046d288552f4e722d4fe8a0f3234b662e7351a4d27aaaeb0d5c0

3 years agoMerge #928: Define SECP256K1_BUILD in secp256k1.c directly.
Tim Ruffing [Sun, 2 May 2021 09:40:34 +0000 (11:40 +0200)]
Merge #928: Define SECP256K1_BUILD in secp256k1.c directly.

ae9e648526ceaf7cd97ba4dfe3c105db8e226c35 Define SECP256K1_BUILD in secp256k1.c directly. (Gregory Maxwell)

Pull request description:

  This avoids building without it and makes it safer to use a custom
   building environment.  Test harnesses need to #include secp256k1.c
   first now.

  Fixes #927

ACKs for top commit:
  sipa:
    utACK ae9e648526ceaf7cd97ba4dfe3c105db8e226c35
  real-or-random:
    ACK ae9e648526ceaf7cd97ba4dfe3c105db8e226c35

Tree-SHA512: 65ccc15c18f111ba926db1bb25f06c2beb2997c6f42c6d3ebc371ca84f4b5918379efd25c30556cedfd2e4275758bd79d733e80a11159c6ec013dd4707a683ad

3 years agotests: fopen /dev/urandom in binary mode
Tim Ruffing [Sat, 1 May 2021 11:06:55 +0000 (13:06 +0200)]
tests: fopen /dev/urandom in binary mode

This makes a difference with mingw builds on Wine, where the subsequent
fread() may abort early in the default text mode.

The Microsoft C docs say:
"In text mode, CTRL+Z is interpreted as an EOF character on input."

3 years agoDefine SECP256K1_BUILD in secp256k1.c directly.
Gregory Maxwell [Sat, 1 May 2021 17:08:52 +0000 (17:08 +0000)]
Define SECP256K1_BUILD in secp256k1.c directly.

This avoids building without it and makes it safer to use a custom
 building environment.  Test harnesses need to #include secp256k1.c
 first now.

3 years agoAdd mingw32-w64/wine CI build
Pieter Wuille [Sat, 17 Apr 2021 17:57:16 +0000 (10:57 -0700)]
Add mingw32-w64/wine CI build

3 years agosecp256k1.h: clarify that by default arguments must be != NULL
Jonas Nick [Wed, 28 Apr 2021 16:57:49 +0000 (16:57 +0000)]
secp256k1.h: clarify that by default arguments must be != NULL

The same file says that the illegal callback will only triger for violations
explicitly mentioned, which is not true without this commit because we often
don't mention that an argument is not allowed to be NULL.

3 years agoMerge #906: Use modified divsteps with initial delta=1/2 for constant-time
Tim Ruffing [Thu, 22 Apr 2021 18:11:51 +0000 (20:11 +0200)]
Merge #906: Use modified divsteps with initial delta=1/2 for constant-time

be0609fd54af95a15b76cea150e6907d581318dd Add unit tests for edge cases with delta=1/2 variant of divsteps (Pieter Wuille)
cd393ce2283e0e7234ea39a15c4931715f4dde1e Optimization: only do 59 hddivsteps per iteration instead of 62 (Pieter Wuille)
277b224b6aba942efbac4a6aae1054035a68d8dd Use modified divsteps with initial delta=1/2 for constant-time (Pieter Wuille)
376ca366db0469f39b93af0af762090986ea75f2 Fix typo in explanation (Pieter Wuille)

Pull request description:

  This updates the divsteps-based modular inverse code to use the modified version which starts with delta=1/2. For variable time, the delta=1 variant is still used as it appears to be faster.

  See https://github.com/sipa/safegcd-bounds/tree/master/coq and https://medium.com/blockstream/a-formal-proof-of-safegcd-bounds-695e1735a348 for a proof of correctness of this variant.

  TODO:
  * [x] Update unit tests to include edge cases specific to this variant

  I'm still running the Coq proof verification for the 590 bound in non-native mode. It's unclear how long this will take.

ACKs for top commit:
  gmaxwell:
    ACK be0609fd54af95a15b76cea150e6907d581318dd
  sanket1729:
    crACK be0609fd54af95a15b76cea150e6907d581318dd
  real-or-random:
    ACK be0609fd54af95a15b76cea150e6907d581318dd careful code review and some testing

Tree-SHA512: 2f8f400ba3ac8dbd08622d564c3b3e5ff30768bd0eb559f2c4279c6c813e17cdde71b1c16f05742c5657b5238b4d592b48306f9f47d7dbdb57907e58dd99b47a

3 years agoMerge #918: Clean up configuration in gen_context
Jonas Nick [Mon, 19 Apr 2021 16:59:03 +0000 (16:59 +0000)]
Merge #918: Clean up configuration in gen_context

07067967ee9dcc4af10fd3a565ffb846a2593e92 add ECMULT_GEN_PREC_BITS to basic_config.h (Aaron Voisine)
a3aa2628c7b675814157556d774872755c9f1aba gen_context: Don't include basic-config.h (Tim Ruffing)

Pull request description:

ACKs for top commit:
  sipa:
    utACK 07067967ee9dcc4af10fd3a565ffb846a2593e92
  jonasnick:
    ACK 07067967ee9dcc4af10fd3a565ffb846a2593e92

Tree-SHA512: 4889b483a33ac54f6038a5a5db1ccd225b03e752c5724243db7345389372ecf043433fd5441199043fc8b74c963f13cbf6a7c8068367f9a105e2be93392f24e9

3 years agoadd ECMULT_GEN_PREC_BITS to basic_config.h
Aaron Voisine [Sat, 10 Apr 2021 18:37:08 +0000 (11:37 -0700)]
add ECMULT_GEN_PREC_BITS to basic_config.h

set ECMULT_GEN_PREC_BITS to the "auto" value of 4 in basic_config.h, so libsecp can be used without autoconf

3 years agogen_context: Don't include basic-config.h
Tim Ruffing [Thu, 15 Apr 2021 14:17:53 +0000 (16:17 +0200)]
gen_context: Don't include basic-config.h

Before this commit, gen_context.c both included libsecp256k1-config.h
and basic-config.h: The former only to obtain ECMULT_GEN_PREC_BITS
and the latter to obtain a basic working configuration to be able to
use the library.

This was inelegant and confusing: It meant that basic-config.h needs
to #undef all the macros defined in libsecp256k1-config.h. Moreover,
it meant that basic-config.h cannot define ECMULT_GEN_PREC_BITS,
essentially making this file specific for use in gen_context.c.

After this commit, gen_context.c include only libsecp256k1-config.h.
basic-config.h is not necessary anymore for the modules used in
gen_context.c because 79f1f7a made the preprocessor detect all the
relevant config options.

On the way, we remove an unused #define in basic-config.h.

3 years agoAdd unit tests for edge cases with delta=1/2 variant of divsteps
Pieter Wuille [Fri, 26 Mar 2021 05:50:15 +0000 (22:50 -0700)]
Add unit tests for edge cases with delta=1/2 variant of divsteps

3 years agoOptimization: only do 59 hddivsteps per iteration instead of 62
Pieter Wuille [Fri, 15 Jan 2021 23:20:39 +0000 (15:20 -0800)]
Optimization: only do 59 hddivsteps per iteration instead of 62

3 years agoUse modified divsteps with initial delta=1/2 for constant-time
Pieter Wuille [Fri, 1 Jan 2021 19:15:10 +0000 (11:15 -0800)]
Use modified divsteps with initial delta=1/2 for constant-time

Instead of using eta=-delta, use zeta=-(delta+1/2) to represent
delta. This variant only needs at most 590 iterations for 256-bit
inputs rather than 724 (by convex hull bounds analysis).

3 years agoFix typo in explanation
Pieter Wuille [Mon, 29 Mar 2021 23:33:36 +0000 (16:33 -0700)]
Fix typo in explanation

3 years agoMerge #889: fix uninitialized read in tests
Jonas Nick [Wed, 7 Apr 2021 12:52:49 +0000 (12:52 +0000)]
Merge #889: fix uninitialized read in tests

99a1cfec1740a914aa416a87fd0acbde5426b969 print warnings for conditional-uninitialized (PiRK)
3d2cf6c5bd35b0d72716b47bdd7e3892388aafc4 initialize variable in tests (PiRK)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 99a1cfec1740a914aa416a87fd0acbde5426b969 code inspection
  jonasnick:
    ACK 99a1cfec1740a914aa416a87fd0acbde5426b969

Tree-SHA512: 72f92f51c44210ab54f166920f540525db0e3d1f19a2fa56e4a6d157a38a582f9dc649d919cf3278482c9fd723021b07759284a8fccbc574b62a22aac0facf51

3 years agoMerge #903: Make argument of fe_normalizes_to_zero{_var} const
Jonas Nick [Fri, 26 Mar 2021 14:56:55 +0000 (14:56 +0000)]
Merge #903: Make argument of fe_normalizes_to_zero{_var} const

23c3fb629b905deebc4bcc9914bcfff7b9aedacd Make argument of fe_normalizes_to_zero{_var} const (Pieter Wuille)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 23c3fb629b905deebc4bcc9914bcfff7b9aedacd diff looks good
  jonasnick:
    ACK 23c3fb629b905deebc4bcc9914bcfff7b9aedacd

Tree-SHA512: a51894a9e59851dc4854e92e4200ef6d12a11f6785b903c23585cfff5ef8d369216f4121260fe8789d46d3e215f3c2baa42decae99ab9328e8081f5274e67fab

3 years agoMerge #907: changed import to use brackets <> for openssl
Jonas Nick [Fri, 26 Mar 2021 14:01:47 +0000 (14:01 +0000)]
Merge #907: changed import to use brackets <> for openssl

4504472269df06b8765b134d41f86619cdcdf8f6 changed import to use brackets <> for openssl as they are not local to the project (William Bright)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 4504472269df06b8765b134d41f86619cdcdf8f6
  jonasnick:
    ACK 4504472269df06b8765b134d41f86619cdcdf8f6

Tree-SHA512: e35c202835a82dab5fe9f2f75e7752e70b15d5d2ee7485790749f145b35e8e995c4978b4015c726387c24248a7efb636d28791fe882581a144a0ddfb27e14075

3 years agochanged import to use brackets <> for openssl as they are not local to the project
William Bright [Sat, 20 Mar 2021 23:59:51 +0000 (19:59 -0400)]
changed import to use brackets <> for openssl as they are not local to the project

3 years agoMerge #831: Safegcd inverses, drop Jacobi symbols, remove libgmp
Pieter Wuille [Thu, 18 Mar 2021 00:03:17 +0000 (17:03 -0700)]
Merge #831: Safegcd inverses, drop Jacobi symbols, remove libgmp

24ad04fc064e71abdf973e061c30eb1f3f78db39 Make scalar_inverse{,_var} benchmark scale with SECP256K1_BENCH_ITERS (Pieter Wuille)
ebc1af700f9ec6e96586152b7090a2a6494308c3 Optimization: track f,g limb count and pass to new variable-time update_fg_var (Peter Dettman)
b306935ac12bb24fd931d735b4dfc07f707e7447 Optimization: use formulas instead of lookup tables for cancelling g bits (Peter Dettman)
9164a1b6582e2fc833c760a3403d26b9b0b3b7b3 Optimization: special-case zero modulus limbs in modinv64 (Pieter Wuille)
1f233b3fa05eb29a744487e0682d925055fb0d4c Remove num/gmp support (Pieter Wuille)
20448b8d09a492afcfcae7721033c13a44a776fd Remove unused Jacobi symbol support (Pieter Wuille)
5437e7bdfbffddf69fdf7b4af7e997c78f5dafbf Remove unused scalar_sqr (Pieter Wuille)
aa9cc5218001f14f4312bde1058417d4b755fd11 Improve field/scalar inverse tests (Pieter Wuille)
1e0e885c8ac814c3621d9e43e66d60f25e324e8e Make field/scalar code use the new modinv modules for inverses (Pieter Wuille)
436281afdcb68991395f97338197d208212965e2 Move secp256k1_fe_inverse{_var} to per-impl files (Pieter Wuille)
aa404d53bef21d252a23171381d4bfda6e7e25c6 Move secp256k1_scalar_{inverse{_var},is_even} to per-impl files (Pieter Wuille)
08d54964e51f318ef0cc4ef09d64cfa5ec143c5c Improve bounds checks in modinv modules (Pieter Wuille)
151aac00d31ba5e94800376f6fda4193071168af Add tests for modinv modules (Pieter Wuille)
d8a92fcc4c65cf189ec7bd5298dad8479347c442 Add extensive comments on the safegcd algorithm and implementation (Pieter Wuille)
8e415acba25830da9c23a4dd5531ebfc6b65aae7 Add safegcd based modular inverse modules (Peter Dettman)
de0a643c3dc2c40a447e670cfa1c1683c79c9297 Add secp256k1_ctz{32,64}_var functions (Pieter Wuille)

Pull request description:

  This is a rebased and squashed version of #767, adding safegcd-based implementations of constant-time and variable-time modular inverses for scalars and field elements, by Peter Dettman. The PR is organized as follows:
  * **Add secp256k1_ctz{32,64}_var functions** Introduction of ctz functions to util.h (which use `__builtin_ctz` on recent GCC and Clang, but fall back to using a software emulation using de Bruijn on other platforms). This isn't used anywhere in this commit, but does include tests.
  * **Add safegcd based modular inverse modules** Add Peter Dettman's safegcd code from #767 (without some of his optimizations, which are moved to later commits), turned into separate modules by me.
  * **Add extensive comments on the safegcd algorithm and implementation** Add a long description of the algorithm and optimizations to `doc/safegcd_implementation.md`, as well as additional comments to the code itself. It is probably best to review this together with the previous commit (they're separated to keep authorship).
  * **Add tests for modinv modules** Adds tests on the modinv interface directly, for arbitrary moduli.
  * **Improve bounds checks in modinv modules** Adds a lot of sanity checking to the modinv modules.
  * **Move secp256k1_scalar_{inverse{_var},is_even} to per-impl files** A pure refactor to prepare for switching the field and scalar code to modinv.
  * **Make field/scalar code use the new modinv modules for inverses** Actually switch over.
  * **Add extra modular inverse tests** This adds modular inverse tests through the field/scalar interface, now that those use modinv.
  * **Remove unused Jacobi symbol support** No longer needed.
  * **Remove num/gmp support** Bye-bye.
  * 3 commits with further optimizations.

ACKs for top commit:
  gmaxwell:
    ACK 24ad04fc064e71abdf973e061c30eb1f3f78db39
  sanket1729:
    ACK 24ad04fc064e71abdf973e061c30eb1f3f78db39
  real-or-random:
    ACK 24ad04fc064e71abdf973e061c30eb1f3f78db39 careful code review, some testing

Tree-SHA512: 732fe29315965e43ec9a10ee8c71eceeb983c43fe443da9dc5380a5a11b5e40b06e98d6abf67b773b1de74571fd2014973c6376f3a0caeac85e0cf163ba2144b

3 years agoMake argument of fe_normalizes_to_zero{_var} const
Pieter Wuille [Fri, 12 Mar 2021 18:31:54 +0000 (10:31 -0800)]
Make argument of fe_normalizes_to_zero{_var} const

3 years agoMake scalar_inverse{,_var} benchmark scale with SECP256K1_BENCH_ITERS
Pieter Wuille [Fri, 22 Jan 2021 23:47:44 +0000 (15:47 -0800)]
Make scalar_inverse{,_var} benchmark scale with SECP256K1_BENCH_ITERS

3 years agoOptimization: track f,g limb count and pass to new variable-time update_fg_var
Peter Dettman [Wed, 16 Dec 2020 02:17:19 +0000 (18:17 -0800)]
Optimization: track f,g limb count and pass to new variable-time update_fg_var

The magnitude of the f and g variables generally goes down as the algorithm
progresses. Make use of this by keeping tracking how many limbs are used, and
when the number becomes small enough, make use of this to reduce the complexity
of arithmetic on them.

Refactored by: Pieter Wuille <[email protected]>

3 years agoOptimization: use formulas instead of lookup tables for cancelling g bits
Peter Dettman [Wed, 16 Dec 2020 00:19:08 +0000 (16:19 -0800)]
Optimization: use formulas instead of lookup tables for cancelling g bits

This only seems to be a win on 64-bit platforms, so only do it there.

Refactored by: Pieter Wuille <[email protected]>

3 years agoOptimization: special-case zero modulus limbs in modinv64
Pieter Wuille [Sat, 28 Nov 2020 23:58:22 +0000 (15:58 -0800)]
Optimization: special-case zero modulus limbs in modinv64

Both the field and scalar modulus can be written in signed{30,62} notation
with one or more zero limbs. Make use of this in the update_de function to
avoid a few wide multiplications when that is the case.

This doesn't appear to be a win in the 32-bit implementation, so only
do it for the 64-bit one.

3 years agoRemove num/gmp support
Pieter Wuille [Sun, 11 Oct 2020 23:04:58 +0000 (16:04 -0700)]
Remove num/gmp support

The whole "num" API and its libgmp-based implementation are now unused. Remove them.

3 years agoRemove unused Jacobi symbol support
Pieter Wuille [Sun, 11 Oct 2020 22:56:17 +0000 (15:56 -0700)]
Remove unused Jacobi symbol support

No exposed functions rely on Jacobi symbol computation anymore. Remove it; it can always
be brough back later if needed.

3 years agoRemove unused scalar_sqr
Pieter Wuille [Sun, 24 Jan 2021 03:24:33 +0000 (19:24 -0800)]
Remove unused scalar_sqr

3 years agoImprove field/scalar inverse tests
Pieter Wuille [Mon, 12 Oct 2020 06:20:32 +0000 (23:20 -0700)]
Improve field/scalar inverse tests

Add a new run_inverse_tests that replaces all existing field/scalar inverse tests,
and tests a few identities for fixed inputs, small numbers (-999...999), random
inputs (structured and unstructured), as well as comparing with the output of
secp256k1_fe_inv_all_var.

3 years agoMake field/scalar code use the new modinv modules for inverses
Pieter Wuille [Sun, 29 Nov 2020 22:02:01 +0000 (14:02 -0800)]
Make field/scalar code use the new modinv modules for inverses

3 years agoMove secp256k1_fe_inverse{_var} to per-impl files
Pieter Wuille [Sun, 11 Oct 2020 22:41:54 +0000 (15:41 -0700)]
Move secp256k1_fe_inverse{_var} to per-impl files

This temporarily duplicates the inversion code across the 5x52 and 10x26
implementations. Those implementations will be replaced in a next commit.

3 years agoMove secp256k1_scalar_{inverse{_var},is_even} to per-impl files
Pieter Wuille [Sun, 11 Oct 2020 22:30:37 +0000 (15:30 -0700)]
Move secp256k1_scalar_{inverse{_var},is_even} to per-impl files

This temporarily duplicates the inversion code across the 4x64 and 8x32
implementations. Those implementations will be replaced in a later commit.

3 years agoImprove bounds checks in modinv modules
Pieter Wuille [Wed, 23 Dec 2020 19:13:57 +0000 (11:13 -0800)]
Improve bounds checks in modinv modules

This commit adds functions to verify and compare numbers in signed{30,62} notation,
and uses that to do more extensive bounds checking on various variables in the modinv
code.

3 years agoAdd tests for modinv modules
Pieter Wuille [Wed, 23 Dec 2020 02:24:36 +0000 (18:24 -0800)]
Add tests for modinv modules

This adds tests for the modinv{32,64}_impl.h directly (before the functions are used
inside the field/scalar code). It uses a naive implementation of modular multiplication
and gcds in order to verify the modular inverses themselves.

3 years agoAdd extensive comments on the safegcd algorithm and implementation
Pieter Wuille [Fri, 4 Dec 2020 00:26:58 +0000 (16:26 -0800)]
Add extensive comments on the safegcd algorithm and implementation

This adds a long comment explaining the algorithm and implementation choices by building
it up step by step in Python.

Comments in the code are also reworked/added, with references to the long explanation.

3 years agoAdd safegcd based modular inverse modules
Peter Dettman [Sun, 29 Nov 2020 22:01:03 +0000 (14:01 -0800)]
Add safegcd based modular inverse modules

Refactored by: Pieter Wuille <[email protected]>

3 years agoAdd secp256k1_ctz{32,64}_var functions
Pieter Wuille [Mon, 12 Oct 2020 02:10:58 +0000 (19:10 -0700)]
Add secp256k1_ctz{32,64}_var functions

These functions count the number of trailing zeroes in non-zero integers.

3 years agoMerge #901: ci: Switch all Linux builds to Debian and more improvements
Tim Ruffing [Sun, 7 Mar 2021 21:16:20 +0000 (22:16 +0100)]
Merge #901: ci: Switch all Linux builds to Debian and more improvements

9361f360bb04156c7a0fa8f2664680b74d463ed5 ci: Select number of parallel make jobs depending on CI environment (Tim Ruffing)
28eccdf80641f71fada0ee4065c8127468162176 ci: Split output of logs into multiple sections (Tim Ruffing)
c7f754fe4d5e032fd150c4b9b985855e9fcaa521 ci: Run PRs on merge result instead of on the source branch (Tim Ruffing)
b994a8be3cf8ab0fc6a622980a9845bb82cc17db ci: Print information about binaries using "file" (Tim Ruffing)
f24e122d13db7061b1086ddfd21d3a1c5294213b ci: Switch all Linux builds to Debian (Tim Ruffing)

Pull request description:

  Best reviewed commit by commit

ACKs for top commit:
  jonasnick:
    ACK 9361f360bb04156c7a0fa8f2664680b74d463ed5
  sipa:
    utACK 9361f360bb04156c7a0fa8f2664680b74d463ed5

Tree-SHA512: fc754e8b57dc58058cebbf63a60ca76e08dbaefea1508ea27b7f962bce697c10033da3f57a35f731bc7cf3e210eb00e3b8985ae8b729d7bd83faee085b878b9c

3 years agoci: Select number of parallel make jobs depending on CI environment
Tim Ruffing [Wed, 3 Mar 2021 00:21:18 +0000 (01:21 +0100)]
ci: Select number of parallel make jobs depending on CI environment

This should improve compilation times on macOS. Things can certainly
be improved further, e.g., by running the benchmarks in parallel.

3 years agoci: Split output of logs into multiple sections
Tim Ruffing [Mon, 1 Mar 2021 23:09:05 +0000 (00:09 +0100)]
ci: Split output of logs into multiple sections

3 years agoci: Run PRs on merge result instead of on the source branch
Tim Ruffing [Mon, 1 Mar 2021 22:50:54 +0000 (23:50 +0100)]
ci: Run PRs on merge result instead of on the source branch

This is taken from Bitcoin Core's .cirrus.yml

3 years agoci: Print information about binaries using "file"
Tim Ruffing [Fri, 26 Feb 2021 16:36:34 +0000 (17:36 +0100)]
ci: Print information about binaries using "file"

3 years agoci: Switch all Linux builds to Debian
Tim Ruffing [Fri, 26 Feb 2021 14:52:40 +0000 (15:52 +0100)]
ci: Switch all Linux builds to Debian

The experiment of using Nix Shell was not really successful. Most
notably, Nix uses a bunch of wrapper scripts around compilers, which
make the build much less "pure". This may be useful but it's exactly
not what we want for CI. In particular, this resulted in gcc being used
for the "clang" builds because a wrapper script redefined the CC env
variable.

This now builds a single docker image (Debian) for all architectures
that we test in CI on Linux.

3 years agoMerge #891: build: Add workaround for automake 1.13 and older
Tim Ruffing [Tue, 2 Mar 2021 14:25:00 +0000 (15:25 +0100)]
Merge #891: build: Add workaround for automake 1.13 and older

f329bba244264fb5f2c952c11e614987519d0dbc build: Add workaround for automake 1.13 and older (Tim Ruffing)

Pull request description:

  Fixes #890.

ACKs for top commit:
  michaelfolkson:
    ACK f329bba244264fb5f2c952c11e614987519d0dbc

Tree-SHA512: 1ae3d1587abb402c2d3bb28d3a48aeff056f061e755d65d482204bb502b8427aad376c7319b4a694a5bf79c193acd3c88cb65928f0bc0e5c7587222e1315b6d0

3 years agoMerge #894: ctime_test: move context randomization test to the end
Jonas Nick [Mon, 22 Feb 2021 22:05:43 +0000 (22:05 +0000)]
Merge #894: ctime_test: move context randomization test to the end

7d3497cdc4c747bdd51db70f42fe218622c3169f ctime_test: move context randomization test to the end (Jonas Nick)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 7d3497cdc4c747bdd51db70f42fe218622c3169f diff looks good

Tree-SHA512: aef006c43df4cab254ee7de79cdd34c4e2f7a463f29d1da6d285006b32bb4e18d0b914a305f371b8b5f5a20594c37ee464eb1e59d1978db9b06bf6b642e651d8

3 years agoctime_test: move context randomization test to the end
Jonas Nick [Thu, 4 Feb 2021 23:17:09 +0000 (23:17 +0000)]
ctime_test: move context randomization test to the end

3 years agoprint warnings for conditional-uninitialized
PiRK [Sun, 31 Jan 2021 17:41:35 +0000 (18:41 +0100)]
print warnings for conditional-uninitialized

This compiler flag is available for clang but not gcc.

Test plan:

```
autogen.sh
./configure
make check
CC=clang ./configure
make check
```

If a variable is used uninitialized, the warning should look something
like:
```
  CC       src/tests-tests.o
src/tests.c:4336:15: warning: variable 'recid' may be uninitialized when used here [-Wconditional-uninitialized]
        CHECK(recid >= 0 && recid < 4);
              ^~~~~
./src/util.h:54:18: note: expanded from macro 'CHECK'
    if (EXPECT(!(cond), 0)) { \
                 ^~~~
./src/util.h:41:39: note: expanded from macro 'EXPECT'
                                      ^
src/tests.c:4327:14: note: initialize the variable 'recid' to silence this warning
    int recid;
             ^
              = 0
1 warning generated.
```

3 years agoinitialize variable in tests
PiRK [Fri, 29 Jan 2021 10:49:51 +0000 (11:49 +0100)]
initialize variable in tests

This was detected while running the tests with the `-Wconditional-uninitialized` flag

```
./autogen.sh
CC=clang CFLAGS="-Wconditional-uninitialized" ./configure
make check
```

The resulting warning is a false positive, but setting the value to -1
ensures that the CHECK below will fail if recid is never written to.

3 years agobuild: Add workaround for automake 1.13 and older
Tim Ruffing [Mon, 1 Feb 2021 21:54:09 +0000 (22:54 +0100)]
build: Add workaround for automake 1.13 and older

Fixes #890.

3 years agoMerge #882: Use bit ops instead of int mult for constant-time logic in gej_add_ge
Jonas Nick [Mon, 1 Feb 2021 10:23:05 +0000 (10:23 +0000)]
Merge #882: Use bit ops instead of int mult for constant-time logic in gej_add_ge

e491d06b98c9caa5eab74e38ba8419b9fb3b5015 Use bit ops instead of int mult for constant-time logic in gej_add_ge (Tim Ruffing)

Pull request description:

ACKs for top commit:
  sipa:
    utACK e491d06b98c9caa5eab74e38ba8419b9fb3b5015. Seems obviously better.
  elichai:
    ACK e491d06b98c9caa5eab74e38ba8419b9fb3b5015
  jonasnick:
    ACK e491d06b98c9caa5eab74e38ba8419b9fb3b5015

Tree-SHA512: 65977d3405e3b6c184c736d46898b615689b56f7562165114429dea49c0f9feb81d021cbe196c8a813b6239254b394cc24ac8d278dab37e521843a1bb0f70c47

4 years agoUse bit ops instead of int mult for constant-time logic in gej_add_ge
Tim Ruffing [Thu, 28 Jan 2021 15:57:17 +0000 (16:57 +0100)]
Use bit ops instead of int mult for constant-time logic in gej_add_ge

4 years agoMerge #864: Add support for Cirrus CI
Jonas Nick [Sat, 30 Jan 2021 10:07:45 +0000 (10:07 +0000)]
Merge #864: Add support for Cirrus CI

cc2a5451dc8ac8a3a9368e1a5b3a1488b15a8bc3 ci: Refactor Nix shell files (Jonas Nick)
2480e55c8f365eb15b703c75153766218ef8795f ci: Remove support for Travis CI (Tim Ruffing)
2b359f1c1d8f497629284864780d0684681e44dc ci: Enable simple cache for brewing valgrind on macOS (Tim Ruffing)
8c02e465c5ac2c8c35ce3aec45f88401df165ad0 ci: Add support for Cirrus CI (Tim Ruffing)

Pull request description:

ACKs for top commit:
  sipa:
    ACK cc2a5451dc8ac8a3a9368e1a5b3a1488b15a8bc3. Tested by introducing bugs: #883, #884, #885, #886, #887.
  jonasnick:
    ACK cc2a5451dc8ac8a3a9368e1a5b3a1488b15a8bc3

Tree-SHA512: c9e8a891c9bda48b3fc307c2a85d2e4aa180531d084edd778d41c034769661627538ab397efac3abfc1a71c2f0730a45350dd212d499fe475c90a2a1b3c61ac8

4 years agoci: Refactor Nix shell files
Jonas Nick [Fri, 29 Jan 2021 21:04:10 +0000 (21:04 +0000)]
ci: Refactor Nix shell files

4 years agoci: Remove support for Travis CI
Tim Ruffing [Thu, 28 Jan 2021 16:32:36 +0000 (17:32 +0100)]
ci: Remove support for Travis CI

So long, and thanks for all fish!

4 years agoci: Enable simple cache for brewing valgrind on macOS
Tim Ruffing [Thu, 14 Jan 2021 10:05:20 +0000 (11:05 +0100)]
ci: Enable simple cache for brewing valgrind on macOS

4 years agoci: Add support for Cirrus CI
Tim Ruffing [Tue, 22 Dec 2020 15:42:08 +0000 (16:42 +0100)]
ci: Add support for Cirrus CI

4 years agoMerge #880: Add parens around ROUND_TO_ALIGN's parameter.
Tim Ruffing [Tue, 26 Jan 2021 08:36:14 +0000 (09:36 +0100)]
Merge #880: Add parens around ROUND_TO_ALIGN's parameter.

b6f649889ae78573f1959f04172a8e1fe15beab7 Add parens around ROUND_TO_ALIGN's parameter. This makes the macro robust against a hypothetical ROUND_TO_ALIGN(foo ? sizeA : size B) invocation. (Russell O'Connor)

Pull request description:

  This makes the macro robust against a hypothetical `ROUND_TO_ALIGN(foo ? sizeA : size B)` invocation.

  See also <https://wiki.sei.cmu.edu/confluence/display/c/PRE01-C.+Use+parentheses+within+macros+around+parameter+names>.

ACKs for top commit:
  sipa:
    ACK b6f649889ae78573f1959f04172a8e1fe15beab7. This is the way.
  jonasnick:
    utACK b6f649889ae78573f1959f04172a8e1fe15beab7
  real-or-random:
    utACK b6f649889ae78573f1959f04172a8e1fe15beab7

Tree-SHA512: 6a2685f959e8ae472259e5ea75fe12e8e6213f56f5aec7603a896c294e6a8833caae25c412607d9c9a3125370a7765a3e506127b101a1b87203f95e326f6c6c6

4 years agoAdd parens around ROUND_TO_ALIGN's parameter.
Russell O'Connor [Mon, 25 Jan 2021 16:43:45 +0000 (11:43 -0500)]
Add parens around ROUND_TO_ALIGN's parameter.
This makes the macro robust against a hypothetical ROUND_TO_ALIGN(foo ? sizeA : size B) invocation.

4 years agoMerge #877: Add missing secp256k1_ge_set_gej_var decl.
Jonas Nick [Mon, 25 Jan 2021 14:00:41 +0000 (14:00 +0000)]
Merge #877: Add missing secp256k1_ge_set_gej_var decl.

482e4a9cfcecad28c3b7e601667b3b41949f47fe Add missing secp256k1_ge_set_gej_var decl. (Russell O'Connor)

Pull request description:

ACKs for top commit:
  sipa:
    utACK 482e4a9cfcecad28c3b7e601667b3b41949f47fe
  real-or-random:
    utACK https://github.com/bitcoin-core/secp256k1/pull/877/commits/482e4a9cfcecad28c3b7e601667b3b41949f47fe
  jonasnick:
    ACK 482e4a9cfcecad28c3b7e601667b3b41949f47fe

Tree-SHA512: 02195390fb79f08bcfd655dc56115ea37df42c1ad8f1123b26e7426e387d9658a3bb18fe9951140fc4dd78ce222b84d8b75ce77aec884675e0c26a2005dd2ddc

4 years agoMerge #874: Remove underscores from header defs.
Jonas Nick [Mon, 25 Jan 2021 13:57:35 +0000 (13:57 +0000)]
Merge #874: Remove underscores from header defs.

fb390c5299e999e06b7dff9e77e373600fae9fdf Remove underscores from header defs. This makes them consistent with other files and avoids reserved identifiers. (Russell O'Connor)

Pull request description:

ACKs for top commit:
  real-or-random:
    utACK fb390c5299e999e06b7dff9e77e373600fae9fdf
  jonasnick:
    ACK fb390c5299e999e06b7dff9e77e373600fae9fdf

Tree-SHA512: f49da79c0a90d1e82494821e7cf6f61c66bc377a3f37b2d4787ef19d2126e000627bfe4a76aa1c5bfffeb1382054aa824a7e9ab5d73c19d876b0828722c73854

4 years agoMerge #878: Remove unused secp256k1_fe_inv_all_var
Jonas Nick [Mon, 25 Jan 2021 13:39:48 +0000 (13:39 +0000)]
Merge #878: Remove unused secp256k1_fe_inv_all_var

75d2ae149ef37d3aa42fdefd1529aad89859816c Remove unused secp256k1_fe_inv_all_var (Pieter Wuille)

Pull request description:

ACKs for top commit:
  practicalswift:
    cr ACK 75d2ae149ef37d3aa42fdefd1529aad89859816c: patch looks correct
  real-or-random:
    utACK https://github.com/bitcoin-core/secp256k1/commit/75d2ae149ef37d3aa42fdefd1529aad89859816c
  jonasnick:
    utACK 75d2ae149ef37d3aa42fdefd1529aad89859816c

Tree-SHA512: 6f548a436c6dcb275493e73e6afa23fd1b79392cc3071878f98735732ac9c93971e5c92736c3fe50eaae90a200e1a435e9be9f14d1a69251c83876a6e3c46d41

4 years agoMerge #875: Avoid casting (void**) values.
Jonas Nick [Mon, 25 Jan 2021 13:35:53 +0000 (13:35 +0000)]
Merge #875: Avoid casting (void**) values.

27306186045955803ca4070783c6a28853003e6a Avoid casting (void**) values. Replaced with an expression that only casts (void*) values. (Russell O'Connor)

Pull request description:

ACKs for top commit:
  sipa:
    utACK 27306186045955803ca4070783c6a28853003e6a
  real-or-random:
    utACK https://github.com/bitcoin-core/secp256k1/pull/875/commits/27306186045955803ca4070783c6a28853003e6a
  jonasnick:
    utACK 27306186045955803ca4070783c6a28853003e6a

Tree-SHA512: bdc1e9eefa10f79b744ef6ae83f379faff7bce9fb428c3bcfcc3f6e4e252e5c6543efbe0f84760709850948cbc8a432772c76a6c5f6b8cd18cb2d862b324912d

4 years agoRemove unused secp256k1_fe_inv_all_var
Pieter Wuille [Sun, 24 Jan 2021 04:16:51 +0000 (20:16 -0800)]
Remove unused secp256k1_fe_inv_all_var

4 years agoAdd missing secp256k1_ge_set_gej_var decl.
Russell O'Connor [Sun, 24 Jan 2021 00:12:19 +0000 (19:12 -0500)]
Add missing secp256k1_ge_set_gej_var decl.

4 years agoAvoid casting (void**) values.
Russell O'Connor [Sat, 23 Jan 2021 20:22:54 +0000 (15:22 -0500)]
Avoid casting (void**) values.
Replaced with an expression that only casts (void*) values.

4 years agoRemove underscores from header defs.
Russell O'Connor [Sat, 23 Jan 2021 19:48:35 +0000 (14:48 -0500)]
Remove underscores from header defs.
This makes them consistent with other files and avoids reserved identifiers.

This page took 0.082646 seconds and 4 git commands to generate.