HomePhabricator

Make randomization of a non-signing context a noop

Description

Make randomization of a non-signing context a noop

Summary:
Before this commit secp256k1_context_randomize called illegal_callback
when called on a context not initialized for signing. This is not
documented. Moreover, it is not desirable because non-signing contexts
may use randomization in the future.

This commit makes secp256k1_context_randomize a noop in this case. This
is safe because the context cannot be used for signing anyway.

This fixes #573 and it fixes rust-bitcoin/rust-secp256k1#82.

This is a backport of secp256k1's PR587

Depends on D4971

Test Plan:

ninja check-secp256k1

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Tim Ruffing <crypto@timruffing.de>Authored on Jan 27 2019, 12:17
deadalnixCommitted on Jan 17 2020, 11:41
deadalnixPushed on Jan 17 2020, 12:05
Reviewer
Restricted Project
Differential Revision
D4980: Make randomization of a non-signing context a noop
Parents
rSTAGING0cf6dd3618ab: add static context object which has no capabilities
Branches
Unknown
Tags
Unknown