22 Commits

Author SHA1 Message Date
Jonas Nick
8298c0c79b Merge commits 'c8aa516b 0a40a486 d8a24632 85b00a1c 59547943 5dcc6f8d 07752831 3ef94aa5 1253a277 64b34979 ac83be33 0e5cbd01 e0508ee9 587239db 1ac7e31c d0ad5814 912b7ccc 8746600e ' into temp-merge-1093
Revert: util: Remove endianness detection
2022-03-30 15:00:03 +00:00
Tim Ruffing
1253a27756
Merge bitcoin-core/secp256k1#1033: Add _fe_half and use in _gej_add_ge and _gej_double
e848c3799c4f31367c3ed98d17e3b7de504d4c6e Update sage files for new formulae (Peter Dettman)
d64bb5d4f3fbd48b570d847c9389b9cf8f3d9abc Add fe_half tests for worst-case inputs (Peter Dettman)
4eb8b932ff8e64f8de3ae8ecfebeab1e84ca420e Further improve doubling formula using fe_half (Peter Dettman)
557b31fac36529948709d4bfcc00ad3acb7e83b9 Doubling formula using fe_half (Pieter Wuille)
2cbb4b1a424d9dee12a4e11f0479410b7e4cc930 Run more iterations of run_field_misc (Pieter Wuille)
9cc5c257eddc2d7614985be60bee29cf2bec65fb Add test for secp256k1_fe_half (Pieter Wuille)
925f78d55e112cd00f1e2867886bdc751a5d6606 Add _fe_half and use in _gej_add_ge (Peter Dettman)

Pull request description:

  - Trades 1 _half for 3 _mul_int and 2 _normalize_weak

  Gives around 2-3% faster signing and ECDH, depending on compiler/platform.

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

Tree-SHA512: 81a6c93b3d983f1b48ec8e8b6f262ba914215045a95415147f41ee6e85296aa4d0cbbad9f370cdf475571447baad861d2cc8e0b04a71202d48959cb8a098f584
2022-02-21 11:00:08 +01:00
Tim Ruffing
ebb1beea78 sage: Ensure that constraints are always fastfracs
Even if they are constants created in the formula functions. We now
lift integer constants to fastfracs.
2022-02-04 15:39:44 +01:00
Tim Ruffing
77cfa98dbc sage: Normalize sign of polynomial factors in prover
The prover, when run on recent sage versions,  failed to prove some of its
goals due to a change in sage. This commit adapts our code accordingly.
The prover passes again after this commit.
2022-02-04 15:37:32 +01:00
Tim Ruffing
eae75869cf sage: Exit with non-zero status in case of failures 2022-02-04 15:37:32 +01:00
Peter Dettman
e848c3799c Update sage files for new formulae
- formula_secp256k1_gej_double_var
- formula_secp256k1_gej_add_ge
2022-02-01 17:51:13 +07:00
Tim Ruffing
b54d843eac sage: Fix printing of errors
Python 3 often returns iterable map objects where Python 2 returned
list. We can just them down to lists explicitly.

Overlooked in 13c88efed0005eb6745a222963ee74564054eafb.
2022-01-31 15:17:46 +01:00
Tim Ruffing
e108d0039c sage: Fix incompatibility with sage 9.4
`allexprs` is already the product all numerators. Don't take it's
numerator again.

Fixes #1067.
2022-01-31 12:15:16 +01:00
Jonas Nick
72c8deac03 Merge commits with sync-upstream.sh
da0092bc 10f9bd84 297ce820 f34b5cae 920a0e5f 9526874d aa1b889b 20d791ed 3e7b2ea1 21c188b3 8fa41201 515a5dbd c74a7b7e 74c34e72 7006f1b9 ea5e8a9c 793ad901 2e5e4b67 fecf436d 49f608de 49002274 6ad908aa 4f01840b 61ae37c6 486205aa 5d0dbef0 0559fc6e be6944ad a69df3ad b39d431a 0b83b203 09971a3f 9281c9f4 423b6d19 a310e79e 39a36db9 a1102b12

Deal with
  - secp256k1_test_rng removal in commit
    77a19750b46916b93bb6a08837c26f585bd940fa
  - ecmult_gen context simplification after making table static in commit
    3b0c2185eab0fe5cb910fffee4c88e134f6d3cad
2022-01-02 16:11:15 +00:00
Pieter Wuille
044d956305 Fix G.y parity in sage code 2021-10-20 10:14:13 -04:00
Jonas Nick
d4ca81f48e Merge commits 'dc6e5c3a 2d9e7175 b61f9da5 98dac878 8c727b90 328aaef2 f2d9aeae b732701f db726782 5671e5f3 a4abaab7 659d0d47 f8c0b57e 24d1656c 3a8b47bc ebdba03c 4c3ba88c ' into temp-merge-901
Also add -zkp modules to .cirrus.yml.
2021-03-08 13:35:16 +00:00
Dimitris Apostolou
07aa4c70ff
Fix insecure links 2020-12-18 00:24:22 +02:00
Jonas Nick
e1756dfddc Merge commits '3a106966 8f0c6f15 ' into temp-merge-851 2020-12-04 11:50:18 +00:00
Tim Ruffing
329a2e0a3f sage: Add script for generating scalar_split_lambda constants 2020-12-03 11:56:09 +01:00
Tim Ruffing
f554dfc708 sage: Reorganize files
* Move curve parameters to separate file
 * Rename main prover script for clarity
2020-11-25 13:50:40 +01:00
Frédéric Chapoton
13c88efed0 Convert Sage code to Python 3 (as used by Sage >= 9)
Co-authored-by: Tim Ruffing <crypto@timruffing.de>
2020-11-23 15:56:22 +01:00
Jonas Nick
b0917f3de1 Merge remote-tracking branch 'upstream/master' into temp-merge-835 2020-11-05 20:21:38 +00:00
Pieter Wuille
b110c106fa Change exhaustive test groups so they have a point with X=1
This enables testing overflow is correctly encoded in the recid, and
likely triggers more edge cases.

Also introduce a Sage script to generate the parameters.
2020-09-18 14:01:15 -07:00
Pieter Wuille
360e218043 Constant-time generator module 2020-07-24 14:49:33 +02:00
Dimitris Tsapakidis
8c7ea22d54 Fixed multiple typos 2017-09-24 17:53:13 -07:00
practicalswift
73aca8364f Fix typo: "exectured" → "executed" 2017-01-29 18:36:08 +01:00
Pieter Wuille
03d4611c81 Add sage verification script for the group laws 2015-11-29 16:03:07 +01:00