aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorSebastian Falbesoner <[email protected]>2019-08-29 12:58:18 +0200
committerSebastian Falbesoner <[email protected]>2019-08-29 13:34:20 +0200
commit798a589aff64b83a0844688a661f4bd987c3340c (patch)
tree119eb7a50c726b702febbe97969fd57e78cb7b5a /src/httpserver.cpp
parentMerge #16556: Fix systemd service file configuration directory setup (diff)
downloaddiscoin-798a589aff64b83a0844688a661f4bd987c3340c.tar.xz
discoin-798a589aff64b83a0844688a661f4bd987c3340c.zip
wallet: extract PubKey from P2PK script with Solver
The function ExtractPubKey() checks if a given script matches the P2PK pattern (<PubKey> OP_CHECKSIG), extracts the PubKey and additionally checks if it is cryptographically valid (full validation with ECC library via .IsFullyValid()). Currently this is done manually in the following order: 1) check if first script OP is data push with valid PubKey length (first part of pattern match), extract PubKey 2) create CPubKey object with extracted PubKey 3) fully validate public key 4) check if last script OP is OP_CHECKSIG (second part of pattern match) Using Solver, the pattern matching and PubKey extraction can be done via a single step, leading to the following simplified order with shorter code: 1) check if given script matches P2PK pattern with Solver (also contains valid PubKey length check), extracts Pubkey 2) create CPubKey object with extracted Pubkey 3) fully validate public key
Diffstat (limited to 'src/httpserver.cpp')
0 files changed, 0 insertions, 0 deletions