HomePhabricator

Only create signatures with even S, and verification mode to check.
a81cd96805ceUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Only create signatures with even S, and verification mode to check.

To fix a minor malleability found by Sergio Lerner (reported here:
https://bitcointalk.org/index.php?topic=8392.msg1245898#msg1245898)

The problem is that if (R,S) is a valid ECDSA signature for a given
message and public key, (R,-S) is also valid. Modulo N (the order
of the secp256k1 curve), this means that both (R,S) and (R,N-S) are
valid. Given that N is odd, S and N-S have a different lowest bit.
We solve the problem by forcing signatures to have an even S value,
excluding one of the alternatives.

This commit just changes the signing code to always produce even S
values, and adds a verification mode to check it. This code is not
enabled anywhere yet. Existing tests in key_tests.cpp verify that
the produced signatures are still valid.

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Dec 26 2012, 20:10
Pieter Wuille <pieterw@google.com>Committed on Aug 15 2013, 22:17
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING4323bfeafda4: Merge pull request #2776 from jgarzik/keypoolsize
Branches
Unknown
Tags
Unknown

Event Timeline

Pieter Wuille <pieterw@google.com> committed rSTAGINGa81cd96805ce: Only create signatures with even S, and verification mode to check. (authored by Pieter Wuille <pieter.wuille@gmail.com>).Aug 15 2013, 22:17