aboutsummaryrefslogtreecommitdiff
path: root/src/key.h
AgeCommit message (Collapse)Author
2018-05-19scripted-diff: Rename master key to seedJohn Newbery
-BEGIN VERIFY SCRIPT- ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' test | xargs sed -i "s:\<$1\>:$2:g"; } ren GenerateNewHDMasterKey GenerateNewSeed ren DeriveNewMasterHDKey DeriveNewSeed ren SetHDMasterKey SetHDSeed ren hdMasterKeyID hd_seed_id ren masterKeyID seed_id ren SetMaster SetSeed ren hdmasterkeyid hdseedid ren hdmaster hdseed -END VERIFY SCRIPT-
2018-01-23Make CKey::Load references constRussell Yanofsky
No change in behavior, this just prevents CKey::Load arguments from looking like outputs.
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
2017-12-20Merge #10657: Utils: Improvements to ECDSA key-handling codeWladimir J. van der Laan
63179d0 Scope the ECDSA constant sizes to CPubKey / CKey classes (Jack Grigg) 1ce9f0a Ensure that ECDSA constant sizes are correctly-sized (Jack Grigg) 48abe78 Remove redundant `= 0` initialisations (Jack Grigg) 17fa391 Specify ECDSA constant sizes as constants (Jack Grigg) e4a1086 Update Debian copyright list (Jack Grigg) e181dbe Add comments (Jack Grigg) a3603ac Fix potential overflows in ECDSA DER parsers (Jack Grigg) Pull request description: Mostly trivial, but includes fixes to potential overflows in the ECDSA DER parsers. Cherry-picked from Zcash PR https://github.com/zcash/zcash/pull/2335 Tree-SHA512: 8fcbd51b0bd6723e5d33fa5d592f7cb68ed182796a9b837ecc8217991ad69d6c970258617dc00eb378c8caa4cec5d6b304d9d2c066acd40cda98e4da68e0caa4
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
2017-10-04Scope the ECDSA constant sizes to CPubKey / CKey classesJack Grigg
2017-09-21Remove some unused functions and methodsPieter Wuille
In the case of CKey's destructor, it seems to have been an oversight in f4d1fc259 not to delete it. At this point, it results in the move constructors/assignment operators for CKey being deleted, which may have a performance impact.
2017-08-17Add length check for CExtKey deserializationJonas Schnelli
2017-07-17Specify ECDSA constant sizes as constantsJack Grigg
2017-04-26Remove unused C++ code not covered by unit testspracticalswift
2017-03-18Trivial: Fix typo in key.h commentMichael Goldstein
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-11-07Get rid of nType and nVersionPieter Wuille
Remove the nType and nVersion as parameters to all serialization methods and functions. There is only one place where it's read and has an impact (in CAddress), and even there it does not impact any of the recursively invoked serializers. Instead, the few places that need nType or nVersion are changed to read it directly from the stream object, through GetType() and GetVersion() methods which are added to all stream classes.
2016-10-19wallet: Get rid of LockObject and UnlockObject calls in key.hWladimir J. van der Laan
Replace these with vectors allocated from the secure allocator. This avoids mlock syscall churn on stack pages, as well as makes it possible to get rid of these functions. Please review this commit and the previous one carefully that no `sizeof(vectortype)` remains in the memcpys and memcmps usage (ick!), and `.data()` or `&vec[x]` is used as appropriate instead of &vec.
2016-07-28Merge #8321: [trivial] Switched constants to sizeof()Wladimir J. van der Laan
fbc6070 [trivial] Switched constants to sizeof() (Thomas Snider)
2016-07-24remove outdated legacy codelizhi
CheckSignatureElement is not used,it be replaced by eccrypto::CheckSignatureElement.
2016-07-18[trivial] Switched constants to sizeof()Thomas Snider
2016-04-14add bip32 pubkey serializationJonas Schnelli
CExtPubKey should be serializable like CPubKey
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-05-06Merge pull request #6034Wladimir J. van der Laan
a574899 chaincodes: abstract away more chaincode behavior [squashme] replace struct CCainCode with a typedef uint256 ChainCode (Cory Fields) 8cf1485 Abstract chaincodes into CChainCode (Pieter Wuille)
2015-05-06chaincodes: abstract away more chaincode behaviorCory Fields
[squashme] replace struct CCainCode with a typedef uint256 ChainCode
2015-05-04Update key.cpp to use new libsecp256k1Pieter Wuille
libsecp256k1's API changed, so update key.cpp to use it. Libsecp256k1 now has explicit context objects, which makes it completely thread-safe. In turn, keep an explicit context object in key.cpp, which is explicitly initialized destroyed. This is not really pretty now, but it's more efficient than the static initialized object in key.cpp (which made for example bitcoin-tx slow, as for most of its calls, libsecp256k1 wasn't actually needed). This also brings in the new blinding support in libsecp256k1. By passing in a random seed, temporary variables during the elliptic curve computations are altered, in such a way that if an attacker does not know the blind, observing the internal operations leaks less information about the keys used. This was implemented by Greg Maxwell.
2015-05-02Abstract chaincodes into CChainCodePieter Wuille
# Conflicts: # src/key.cpp # src/key.h
2015-03-27Switch test case signing to RFC6979 extra entropyPieter Wuille
Instead of manually tweaking the deterministic nonce post-generation, pass the test case number in as extra entropy to RFC6979.
2015-03-20allocators: split allocators and pagelockerCory Fields
Pagelocker is only needed for secure (usually wallet) operations, so don't make the zero-after-free allocator depend on it.
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-01Merge pull request #5227Wladimir J. van der Laan
4cdaa95 Resize after succesful result (Pieter Wuille) 9d8604f Header define style cleanups (Pieter Wuille) a53fd41 Deterministic signing (Pieter Wuille) 3060e36 Add the RFC6979 PRNG (Pieter Wuille) a8f5087 Add HMAC-SHA256 (Pieter Wuille) 36fa4a7 Split up crypto/sha2 (Pieter Wuille)
2014-11-24Merge pull request #5224Wladimir J. van der Laan
f321d6b Add key generation/verification to ECC sanity check (Pieter Wuille) d0c41a7 Add sanity check after key generation (Pieter Wuille)
2014-11-23Add sanity check after key generationPieter Wuille
Add a sanity check to prevent cosmic rays from flipping a bit in the generated public key, or bugs in the elliptic curve code. This is simply done by signing a (randomized) message, and verifying the result.
2014-11-20Deterministic signingPieter Wuille
2014-11-20minor style cleanup after HTTP rest interface mergePhilip Kaufmann
- no code changes
2014-11-10Do signature-s negation inside the testsPieter Wuille
To avoid the need for libsecp256k1 to expose such functionality.
2014-11-06Fixing warning C4099: 'CExtPubKey' : type name first seen using 'class' now ↵ENikS
seen using 'struct'
2014-11-04minor code style cleanup after recent mergesPhilip Kaufmann
- add a missing license header - correct some header orderings etc.
2014-10-31boost: moveonly: split CPubKey and friends to new filesCory Fields
2014-10-28Update comments in key to be doxygen compatibleMichael Ford
2014-10-17script: move CScriptID to standard.h and add a ctor for creating them from ↵Cory Fields
CScripts This allows for a reversal of the current behavior. This: CScript foo; CScriptID bar(foo.GetID()); Becomes: CScript foo; CScriptID bar(foo); This way, CScript is no longer dependent on CScriptID or Hash();
2014-09-26Add automatic script test generation, and actual checksig testsPieter Wuille
2014-09-19Apply clang-format on some infrequently-updated filesPieter Wuille
2014-09-01Merge pull request #4779Wladimir J. van der Laan
093303a add missing header end comments (Philip Kaufmann)
2014-08-28add missing header end commentsPhilip Kaufmann
- ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files
2014-08-28Fix a few "Uninitialized scalar field" warningsWladimir J. van der Laan
Fix a few warnings reported by Coverity. None of these is critical, but making sure that class fields are initialized can avoid heisenbugs.
2014-06-03key.cpp: fail with a friendlier message on missing ssl EC supportAndrew Poelstra
Previously if bitcoind is linked with an OpenSSL which is compiled without EC support, this is seen as an assertion failure "pKey != NULL" at key.cpp:134, which occurs after several seconds. It is an esoteric piece of knowledge to interpret this as "oops, I linked with the wrong OpenSSL", and because of the delay it may not even be noticed. The new output is : OpenSSL appears to lack support for elliptic curve cryptography. For more information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries : Initialization sanity check failed. Bitcoin Core is shutting down. which occurs immediately after attempted startup. This also blocks in an InitSanityCheck() function which currently only checks for EC support but should eventually do more. See #4081.
2014-05-20remove CPubKey::VerifyCompact( ) which is never usedKamil Domanski
2014-03-10Also switch the (unused) verification code to low-s instead of even-s.Pieter Wuille
a81cd968 introduced a malleability breaker for signatures (using an even value for S). In e0e14e43 this was changed to the lower of two potential values, rather than the even one. Only the signing code was changed though, the (for now unused) verification code wasn't adapted.
2014-02-25Document that CPubKey.IsValid() is consensus criticalPeter Todd
2013-11-10Cleanup code using forward declarations.Brandon Dahler
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
2013-10-28fix wrong memcmp() usage in CKey::operator==Philip Kaufmann
- add a check for CKey::size() of a and b (size can be 0 or 32) - change the fixed value in memcmp() to use a.size() instead - fixes #3090
2013-08-28improve wallet load time by removing duplicated calls to EC_KEY_check_key ↵patrick s
and adding a hash for vchPubKey/vchPrivKey entries in wallet.dat backwards compatible with previous wallet.dat format
2013-07-15BIP32 derivation implementationPieter Wuille