Tim Ruffing
e626f00d1e
Merge commits 'b314cf28 1f1bb78b 40f50d0f c891c5c2 ea47c82e e7210393 c1b49664 5814d848 07687e81 10e6d29b d3e29db8 e2c9888e 4197d667 5e9a4d7a 77af1da9 1a81df82 1ad5185c efe85c70 79e09451 d373bf6d 74b7c3b5 a9db9f2d 44378867 3bf4d68f e4af41c6 ' into temp-merge-1249
2024-01-23 16:04:45 +01:00
Sebastian Falbesoner
1ddd76af0a
bench: add --help option to bench_internal
2023-11-24 02:33:40 +01:00
Pieter Wuille
115fdc7232
Remove unused secp256k1_wnaf_const
2023-11-04 15:55:12 -04:00
Pieter Wuille
2140da9cd5
Add secp256k1_scalar_half for halving scalars (+ tests/benchmarks).
...
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com >
Co-authored-by: Tim Ruffing <crypto@timruffing.de >
2023-11-04 15:54:08 -04:00
Jonas Nick
7a07f3d33f
Merge commits '3bab71cf 4258c54f 566faa17 9ce9984f 04bf3f67 5be353d6 2e035af2 5b0444a3 a6f4bcf6 5ec1333d f6bef03c 1f33bb2b 1c895367 6b7e5b71 596b336f 4b84f4bf 024a4094 222ecaf6 4b0f711d 3c818388 f30c7486 1cf15ebd 24c768ae 341cc197 c63ec88e 54d34b6c 073d98a0 9eb6934f ab5a9171 fb3a8063 006ddc1f 3353d3c7 b54a0672 7d4f86d2 e8295d07 3e3d125b acf5c55a ' into temp-merge-1312
2023-07-24 20:15:07 +00:00
Jonas Nick
0d540ec942
Merge commits '88e80722 ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
2023-07-20 16:29:40 +00:00
Jonas Nick
6c54db1987
Merge commits '2286f809 751c4354 477f02c4 e3f84777 5c789dcd 8c949f56 21ffe4b2 ' into temp-merge-1055
2023-07-18 12:51:17 +00:00
Jonas Nick
9a981068ce
Merge commits '8b013fce 485f608f 44c2452f cd470333 accadc94 43756da8 ' into temp-merge-1115
2023-07-17 12:01:46 +00:00
Pieter Wuille
5b32602295
Split fe_set_b32 into reducing and normalizing variants
2023-05-11 13:49:33 -04:00
Pieter Wuille
6be01036c8
Add secp256k1_fe_is_square_var function
...
The implementation calls the secp256k1_modinvNN_jacobi_var code, falling back
to computing a square root in the (extremely rare) case it failed converge.
2023-02-28 15:57:32 -05:00
Andrew Poelstra
0a6006989f
Revert "Remove unused scalar_sqr"
...
This reverts commit 5437e7bdfb .
2023-01-23 10:18:21 -08:00
Jonas Nick
620ba3d74b
benchmarks: fix bench_scalar_split
...
scalar_split_lambda requires that the input pointer is different to both output
pointers. Without this fix, the internal benchmarks crash when compiled with
-DVERIFY.
This was introduced in commit 362bb25608 (which
requires configuring with --enable-endomorphism to exhibit the crash).
2023-01-19 18:12:31 +00:00
Pieter Wuille
e03ef86559
Make all non-API functions (except main) static
2023-01-09 12:02:27 -05:00
Jonas Nick
8d7a9a8eda
benchmarks: Switch to NONE contexts
2022-12-07 10:54:43 +00:00
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
Peter Dettman
2f984ffc45
Save negations in var-time group addition
...
- Updated _gej_add_var, _gej_add_ge_var, _gej_add_zinv_var
- 2 fewer _fe_negate in each method
- Updated operation counts and standardize layout
- Added internal benchmark for _gej_add_zinv_var
- Update sage files (fixed by Tim Ruffing)
2022-03-28 23:40:55 +07:00
Peter Dettman
925f78d55e
Add _fe_half and use in _gej_add_ge
...
- Trades 1 _half for 3 _mul_int and 2 _normalize_weak
- Updated formula and comments in _gej_add_ge
- Added internal benchmark for _fe_half
2022-01-31 19:41:01 +07: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
77a19750b4
- ecmult_gen context simplification after making table static in commit
3b0c2185ea
2022-01-02 16:11:15 +00:00
Jonas Nick
23e2f66726
bench: don't return 1 in have_flag() if argc = 1
...
This makes the semantic of have_flag more clear and fixes a bug
that was introduced in
2fe1b50df1
Add ecmult_gen, ecmult_const and ecmult to benchmark
where the behavior introduced by this commit was already assumed. If
bench_ecmult was called without arguments, have_flag("simple") returned 1 and no
scratch space was allocated which led to very wrong output.
2021-10-24 19:43:20 +00:00
siv2r
26a255beb6
Shared benchmark format for command line and CSV outputs
...
1. add `print_output_table_header_row` func to print the table header for benchmark output
2. modify the following benchmarks to include the table header
- bench_ecdh.c
- bench_ecmult.c
- bench_internal.c
- bench_recover.c
- bench_schnorrsig.c
- bench_sign.c
- bench_verify.c
2021-10-19 21:25:37 +05:30
Jonas Nick
d27e459861
Revert "Remove unused Jacobi symbol support"
...
This reverts commit 20448b8d09 .
The removed functions secp256k1_ge_set_xquad and secp256k1_fe_is_quad_var
are required for some modules in secp256k1-zkp.
2021-06-14 20:24:08 +00:00
William Bright
3c90bdda95
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
2021-05-05 09:24:05 -04:00
Gregory Maxwell
ae9e648526
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.
2021-05-01 19:27:27 +00:00
Pieter Wuille
24ad04fc06
Make scalar_inverse{,_var} benchmark scale with SECP256K1_BENCH_ITERS
2021-03-15 13:01:56 -07:00
Pieter Wuille
1f233b3fa0
Remove num/gmp support
...
The whole "num" API and its libgmp-based implementation are now unused. Remove them.
2021-03-15 13:01:52 -07:00
Pieter Wuille
20448b8d09
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.
2021-03-12 10:06:18 -08:00
Pieter Wuille
5437e7bdfb
Remove unused scalar_sqr
2021-03-12 10:06:18 -08:00
Dimitris Apostolou
07aa4c70ff
Fix insecure links
2020-12-18 00:24:22 +02:00
Pieter Wuille
4232e5b7da
Rip out non-endomorphism code
2020-10-13 11:31:13 -07:00
Pieter Wuille
cb5524adc5
Add benchmark for secp256k1_ge_set_gej_var
2020-09-09 18:40:23 -07:00
Pieter Wuille
5c6af60ec5
Make jacobi benchmarks vary inputs
...
Also make the num_jacobi benchmark use the scalar order as modulus,
instead of a random number.
2020-09-09 18:40:16 -07:00
Pieter Wuille
d0fdd5f009
Randomize the Z coordinates in bench_internal
...
Also increase the number of fe inputs.
2020-09-09 18:30:05 -07:00
Pieter Wuille
c7a3424c5f
Rename bench_internal variables
...
The _x and _y suffices are confusing; they don't actually correspond
to X and Y coordinates. Instead replace them with arrays.
2020-09-09 18:30:05 -07:00
Pieter Wuille
7c068998ba
Compile-time check assumptions on integer types
2020-08-14 16:12:49 -07:00
Elichai Turkel
ca4906b02e
Pass num of iters to benchmarks as variable, and define envvar
2020-03-13 11:48:01 +02:00
Elichai Turkel
362bb25608
Modified bench_scalar_split so it won't get optimized out
2019-10-28 16:50:09 +02:00
Elichai Turkel
73a30c6b58
Added accumulators and checks on benchmarks so they won't get optimized out
2019-10-28 16:50:07 +02:00
Tim Ruffing
8979ec0d9a
Pass scalar by reference in secp256k1_wnaf_const()
...
After this change, no struct or union is passed by value in the
entire codebase. This makes it easier to compile the library with
CompCert.
2019-05-14 11:43:54 +02:00
Gregory Maxwell
b76e45d5d6
Make bench_internal obey secp256k1_fe_sqrt's contract wrt aliasing.
...
Bench_internal was previously incorrect but wasn't detected by
-DVERIFY until PR #551 .
2019-02-21 05:58:33 +00:00
Andrew Poelstra
7c1b91ba4b
parameterize ecmult_const over input size
2018-04-05 21:05:13 +00:00
Jonas Nick
a58f543f5a
Add flags for choosing algorithm in ecmult_multi benchmark
2017-12-07 20:13:04 +00:00
Pieter Wuille
d1dc9dfc0a
Get rid of reserved _t in type names
2017-09-27 15:03:20 -07:00
Pieter Wuille
926836ad36
Make secp256k1_fe_sqrt constant time
2016-07-09 14:23:44 +02:00
Pieter Wuille
e6e9805fc4
Add function for testing quadratic residue field/group elements.
2016-07-04 13:55:04 +02:00
Peter Dettman
efd953a7a7
Add Jacobi symbol test via GMP
...
Also add native Jacobi symbol test (Andrew)
Rebased-by: Andrew Poelstra
Rebased-by: Pieter Wuille
2016-07-04 13:16:35 +02:00
Pieter Wuille
dd891e0ed5
Get rid of _t as it is POSIX reserved
2015-09-21 21:03:37 +02:00
Gregory Maxwell
912f203fc5
Eliminate a few unbraced statements that crept into the code.
...
Also avoids some easily avoided multiple-returns.
2015-09-21 17:21:35 +00:00
Pieter Wuille
2f77487012
Add context building benchmarks
2015-08-27 01:14:28 +02:00
Andrew Poelstra
92e53fc4c8
Implement endomorphism optimization for secp256k1_ecmult_const
2015-08-01 10:57:36 -05:00
Andrew Poelstra
ed35d43a0c
Make secp256k1_scalar_add_bit conditional; make secp256k1_scalar_split_lambda_var constant time
...
This has the effect of making `secp256k1_scalar_mul_shift_var` constant
time in both input scalars. Keep the _var name because it is NOT constant
time in the shift amount.
As used in `secp256k1_scalar_split_lambda_var`, the shift is always
the constant 272, so this function becomes constant time, and it
loses the `_var` suffix.
2015-08-01 10:57:36 -05:00