dash/test/util/data
Wladimir J. van der Laan 90154c6074
Merge #13666: Always create signatures with Low R values
e306be742932d4ea5aca0ea4768e54b2fc3dc6a0 Use 72 byte dummy signatures when watching only inputs may be used (Andrew Chow)
48b1473c898129a99212e2db36c61cf93625ea17 Use 71 byte signature for DUMMY_SIGNATURE_CREATOR (Andrew Chow)
18dfea0dd082af18dfb02981b7ee1cd44d514388 Always create 70 byte signatures with low R values (Andrew Chow)

Pull request description:

  When creating signatures for transactions, always make one which has a 32 byte or smaller R and 32 byte or smaller S value. This results in signatures that are always less than 71 bytes (32 byte R + 32 byte S + 6 bytes DER + 1 byte sighash) with low R values. In most cases, the signature will be 71 bytes.

  Because R is not mutable in the same way that S is, a low R value can only be found by trying different nonces. RFC 6979 for deterministic nonce generation has the option to specify additional entropy, so we simply use that and add a uin32_t counter which we increment in order to try different nonces. Nonces are sill deterministically generated as the nonce used will the be the first one where the counter results in a nonce that results in a low R value. Because different nonces need to be tried, time to produce a signature does increase. On average, it takes twice as long to make a signature as two signatures need to be created, on average, to find one with a low R.

  Having a fixed size signature makes size calculations easier and also saves half a byte of transaction size, on average.

  DUMMY_SIGNATURE_CREATOR has been modified to produce 71 byte dummy signatures instead of 72 byte signatures.

Tree-SHA512: 3cd791505126ce92da7c631856a97ba0b59e87d9c132feff6e0eef1dc47768e81fbb38bfbe970371bedf9714b7f61a13a5fe9f30f962c81734092a4d19a4ef33
2021-07-06 20:29:32 +03:00
..
bitcoin-util-test.json Merge pull request #3882 from PastaPastaPasta/backports-0.17-pr25 2020-12-19 00:35:31 -06:00
blanktxv1.hex
blanktxv1.json Add missing tx type to TxToUniv (#3069) 2019-08-28 10:54:44 +03:00
blanktxv2.hex
blanktxv2.json Add missing tx type to TxToUniv (#3069) 2019-08-28 10:54:44 +03:00
tt-delin1-out.hex
tt-delin1-out.json Merge #11420: Bump univalue subtree and fix json formatting in tests 2020-01-12 17:01:40 -06:00
tt-delout1-out.hex
tt-delout1-out.json Merge #11420: Bump univalue subtree and fix json formatting in tests 2020-01-12 17:01:40 -06:00
tt-locktime317000-out.hex
tt-locktime317000-out.json Merge #11420: Bump univalue subtree and fix json formatting in tests 2020-01-12 17:01:40 -06:00
tx394b54bb.hex
txcreate1.hex
txcreate1.json Merge #11420: Bump univalue subtree and fix json formatting in tests 2020-01-12 17:01:40 -06:00
txcreate2.hex
txcreate2.json Add missing tx type to TxToUniv (#3069) 2019-08-28 10:54:44 +03:00
txcreatedata1.hex
txcreatedata1.json Merge #11420: Bump univalue subtree and fix json formatting in tests 2020-01-12 17:01:40 -06:00
txcreatedata2.hex
txcreatedata2.json Merge #11420: Bump univalue subtree and fix json formatting in tests 2020-01-12 17:01:40 -06:00
txcreatedata_seq0.hex
txcreatedata_seq0.json Add missing tx type to TxToUniv (#3069) 2019-08-28 10:54:44 +03:00
txcreatedata_seq1.hex
txcreatedata_seq1.json Merge #11420: Bump univalue subtree and fix json formatting in tests 2020-01-12 17:01:40 -06:00
txcreatemultisig1.hex
txcreatemultisig1.json Merge #11420: Bump univalue subtree and fix json formatting in tests 2020-01-12 17:01:40 -06:00
txcreatemultisig2.hex
txcreatemultisig2.json Add missing tx type to TxToUniv (#3069) 2019-08-28 10:54:44 +03:00
txcreateoutpubkey1.hex
txcreateoutpubkey1.json Add missing tx type to TxToUniv (#3069) 2019-08-28 10:54:44 +03:00
txcreatescript1.hex
txcreatescript1.json Add missing tx type to TxToUniv (#3069) 2019-08-28 10:54:44 +03:00
txcreatescript2.hex
txcreatescript2.json Add missing tx type to TxToUniv (#3069) 2019-08-28 10:54:44 +03:00
txcreatesignv1.hex Merge #13666: Always create signatures with Low R values 2021-07-06 20:29:32 +03:00
txcreatesignv1.json Merge #13666: Always create signatures with Low R values 2021-07-06 20:29:32 +03:00
txcreatesignv2.hex