lbrycrd/src
Wladimir J. van der Laan 2115cba9c6
Merge #13666: Always create signatures with Low R values
e306be7429 Use 72 byte dummy signatures when watching only inputs may be used (Andrew Chow)
48b1473c89 Use 71 byte signature for DUMMY_SIGNATURE_CREATOR (Andrew Chow)
18dfea0dd0 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
2018-08-13 12:07:20 +02:00
..
bench Merge #13666: Always create signatures with Low R values 2018-08-13 12:07:20 +02:00
compat Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
config
consensus Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
crypto Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
index Break circular dependency: init -> * -> init by extracting shutdown.h 2018-06-25 00:08:49 -04:00
interfaces Ignore unknown config file options for now 2018-07-30 18:01:20 -07:00
leveldb Merge leveldb subtree 2018-08-09 11:31:45 -04:00
obj
obj-test
policy Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
primitives Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
qt qt: Translations update before 0.17 branch 2018-08-13 11:00:17 +02:00
rpc Use pushKV in some new PSBT RPCs. 2018-08-09 18:08:45 +02:00
script Merge #13666: Always create signatures with Low R values 2018-08-13 12:07:20 +02:00
secp256k1 Bump secp256k1 subtree 2017-09-29 16:02:39 +02:00
support Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
test Merge #13666: Always create signatures with Low R values 2018-08-13 12:07:20 +02:00
univalue univalue: Bump subtree 2018-02-10 09:55:54 -05:00
wallet Merge #13666: Always create signatures with Low R values 2018-08-13 12:07:20 +02:00
zmq Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
.clang-format Fix inconsistent namespace formatting guidelines 2018-04-13 15:37:20 -04:00
addrdb.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
addrdb.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
addrman.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
addrman.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
amount.h
arith_uint256.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
arith_uint256.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
base58.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
base58.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
bech32.cpp Tighten up bech32::Decode(); add tests. 2018-04-12 17:52:33 -07:00
bech32.h Fix missing or inconsistent include guards 2018-03-22 16:23:04 +01:00
bitcoin-cli-res.rc
bitcoin-cli.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
bitcoin-tx-res.rc
bitcoin-tx.cpp [docs] Reformat -help output for help2man 2018-08-04 16:17:13 +02:00
bitcoind-res.rc
bitcoind.cpp [docs] Reformat -help output for help2man 2018-08-04 16:17:13 +02:00
blockencodings.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
blockencodings.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
bloom.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
bloom.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
chain.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
chain.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
chainparams.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
chainparams.h Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
chainparamsbase.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
chainparamsbase.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
chainparamsseeds.h Fix a-vs-an typos 2018-02-11 10:48:15 +01:00
checkpoints.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
checkpoints.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
checkqueue.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
clientversion.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
clientversion.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
coins.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
coins.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
compat.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
compressor.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
compressor.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
core_io.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
core_memusage.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
core_read.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
core_write.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
cuckoocache.h Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion 2018-03-27 00:37:20 +02:00
dbwrapper.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
dbwrapper.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
fs.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
fs.h
hash.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
hash.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
httprpc.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
httprpc.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
httpserver.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
httpserver.h Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
indirectmap.h
init.cpp shutdown: Stop threads before resetting ptrs 2018-08-06 16:35:41 -04:00
init.h Break circular dependency: init -> * -> init by extracting shutdown.h 2018-06-25 00:08:49 -04:00
key.cpp Merge #13666: Always create signatures with Low R values 2018-08-13 12:07:20 +02:00
key.h Merge #13666: Always create signatures with Low R values 2018-08-13 12:07:20 +02:00
key_io.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
key_io.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
keystore.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
keystore.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
limitedmap.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
logging.cpp Merge #13149: Handle unsuccessful fseek(...):s 2018-05-07 13:39:19 +02:00
logging.h logging: remove unused return value from LogPrintStr 2018-05-02 11:25:20 +02:00
Makefile.am Output descriptors module 2018-07-27 11:52:45 -07:00
Makefile.bench.include Merge #13586: refactor: add benchmarks to bech32::Encode/Decode 2018-07-11 11:44:10 +02:00
Makefile.leveldb.include
Makefile.qt.include scripted-diff: Remove trailing whitespaces 2018-07-24 20:46:23 +01:00
Makefile.qttest.include crypto: cleanup sha256 build 2018-06-06 17:36:53 -04:00
Makefile.test.include Descriptor tests 2018-07-27 11:52:45 -07:00
memusage.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
merkleblock.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
merkleblock.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
miner.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
miner.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
net.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
net.h Merge #13907: Introduce a maximum size for locators. 2018-08-10 19:52:13 +02:00
net_processing.cpp Merge #13907: Introduce a maximum size for locators. 2018-08-10 19:52:13 +02:00
net_processing.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
netaddress.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
netaddress.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
netbase.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
netbase.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
netmessagemaker.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
noui.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
noui.h
outputtype.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
outputtype.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
pow.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
pow.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
prevector.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
protocol.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
protocol.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
pubkey.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
pubkey.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
random.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
random.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
rest.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
reverse_iterator.h scripted-diff: Remove trailing whitespaces 2018-07-24 20:46:23 +01:00
reverselock.h
scheduler.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
scheduler.h Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
serialize.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
shutdown.cpp Break circular dependency: init -> * -> init by extracting shutdown.h 2018-06-25 00:08:49 -04:00
shutdown.h Break circular dependency: init -> * -> init by extracting shutdown.h 2018-06-25 00:08:49 -04:00
span.h Add more methods to Span class 2018-07-27 11:52:18 -07:00
streams.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
sync.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
sync.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
threadinterrupt.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
threadinterrupt.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
threadsafety.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
timedata.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
timedata.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
tinyformat.h Fix typos 2018-03-21 08:34:44 +02:00
torcontrol.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
torcontrol.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
txdb.cpp Return void instead of bool for functions that cannot fail 2018-07-27 13:19:03 +02:00
txdb.h Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
txmempool.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
txmempool.h Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
ui_interface.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
ui_interface.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
uint256.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
uint256.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
undo.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
util.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
util.h Merge #12257: [wallet] Use destination groups instead of coins in coin select 2018-07-24 16:34:03 +02:00
utilmemory.h Extract MakeUnique into utilmemory.h 2018-07-17 13:56:21 -04:00
utilmoneystr.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
utilmoneystr.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
utilstrencodings.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
utilstrencodings.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
utiltime.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
utiltime.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
validation.cpp Merge #13527: policy: Remove promiscuousmempoolflags 2018-08-07 15:45:37 +02:00
validation.h Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
validationinterface.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
validationinterface.h Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
version.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
versionbits.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
versionbits.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
walletinitinterface.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
warnings.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
warnings.h Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00