HomePhabricator

Remove unnecessary sign variable from wnaf_const

Description

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

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D7595

Details

Provenance
Jonas Nick <jonasd.nick@gmail.com>Authored on Apr 17 2020, 18:05
deadalnixCommitted on Sep 27 2020, 23:07
deadalnixPushed on Sep 27 2020, 23:07
Reviewer
Restricted Project
Differential Revision
D7595: Remove unnecessary sign variable from wnaf_const
Parents
rABC760e82920097: Recovery signing: add to constant time test, and eliminate non ct operators
Branches
Unknown
Tags
Unknown