Commit ba5ec2d
Remove unnecessary sign variable from wnaf_const
Summary:
* Fix test_constant_wnaf for -1 and add a test for it.
Before, test_constant_wnaf used scalar_cadd_bit to correct for the skew. But
this function does not correctly deal with overflows which is why num = -1
couldn't be tested.
This commit also adds tests for 0, 1/2 and 1/2-1 as they are corner cases
in constant_wnaf.
* Remove unnecessary sign variable from wnaf_const
This is a backport of libsecp256k1 [[bitcoin-core/secp256k1#741 | PR741]]
Test Plan:
ninja check-secp256k1
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D75951 parent 760e829 commit ba5ec2d
2 files changed
+33
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | | - | |
116 | | - | |
117 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
118 | 124 | | |
119 | 125 | | |
120 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3231 | 3231 | | |
3232 | 3232 | | |
3233 | 3233 | | |
| 3234 | + | |
3234 | 3235 | | |
3235 | 3236 | | |
3236 | 3237 | | |
| |||
3261 | 3262 | | |
3262 | 3263 | | |
3263 | 3264 | | |
3264 | | - | |
| 3265 | + | |
| 3266 | + | |
3265 | 3267 | | |
3266 | 3268 | | |
3267 | 3269 | | |
| |||
3373 | 3375 | | |
3374 | 3376 | | |
3375 | 3377 | | |
| 3378 | + | |
3376 | 3379 | | |
3377 | 3380 | | |
3378 | 3381 | | |
3379 | 3382 | | |
3380 | 3383 | | |
3381 | 3384 | | |
3382 | | - | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
3383 | 3404 | | |
3384 | 3405 | | |
3385 | 3406 | | |
| |||
0 commit comments