Page MenuHomePhabricator

Remove unnecessary sign variable from wnaf_const
ClosedPublic

Authored by deadalnix on Sun, Sep 27, 22:42.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABCba5ec2d4634f: 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 PR741

Test Plan
ninja check-secp256k1

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Sun, Sep 27, 23:05