aboutsummaryrefslogtreecommitdiff
path: root/src/key.cpp
AgeCommit message (Collapse)Author
2017-07-08Fix subscript[0] potential bugs in key.cppJeremy Rubin
2017-04-26Remove unused C++ code not covered by unit testspracticalswift
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
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-09-27Do not shadow variablesPavel Janík
2016-05-29Always require OS randomness when generating secret keysPieter Wuille
2016-04-14add bip32 pubkey serializationJonas Schnelli
CExtPubKey should be serializable like CPubKey
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-11-13Update key.cpp to new secp256k1 APIPieter Wuille
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-02keys: remove libsecp256k1 verification until it's actually supportedCory Fields
This was added a while ago for testing purposes, but was never intended to be used. Remove it until upstream libsecp256k1 decides that verification is stable/ready.
2015-01-06Use libsecp256k1's RFC6979 implementationPieter Wuille
2015-01-05Use arith_uint256 where necessaryWladimir J. van der Laan
Also add conversion from/to uint256 where needed.
2015-01-05Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
2015-01-04Merge pull request #5508Pieter Wuille
146c0a7 Add RandAddSeedPerfmon to MakeNewKey (21E14)
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-18Add RandAddSeedPerfmon to MakeNewKey21E14
2014-12-11Update Bitcoin for libsecp256k1 API changePieter Wuille
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-28Resize after succesful resultPieter Wuille
2014-11-23Add key generation/verification to ECC sanity checkPieter 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-20Split up crypto/sha2Pieter Wuille
2014-11-18Use libsecp256k1 in key.cppPieter Wuille
2014-11-10Do signature-s negation inside the testsPieter Wuille
To avoid the need for libsecp256k1 to expose such functionality.
2014-10-31boost: moveonly: split CPubKey and friends to new filesCory Fields
2014-10-31boost: moveonly: move BIP32Hash to hash.hCory Fields
2014-10-31boost: moveonly: create eccryptoverify.h|cpp and move helper functions thereCory Fields
Eventually (after 0.10) these files will hold the logic for crypto verification routines, and CKey/CPubKey will call into them.
2014-10-28Update comments in keystore to be doxygen compatibleMichael Ford
2014-10-28Update comments in key to be doxygen compatibleMichael Ford
2014-10-27boost: code movement only: split CECKey into separate filesCory Fields
2014-10-27boost: remove CPubKey dependency from CECKey. Follow-up of e405aa48Cory Fields
2014-10-15boost: remove CPrivKey dependency from CECKeyCory Fields
This allows CECKey to be used without directly depending on the secure allocators
2014-09-26Add automatic script test generation, and actual checksig testsPieter Wuille
2014-09-06Fixing compiler warning C4800: 'type' forcing value to bool 'true' or 'false'ENikS
2014-09-01Fixing Compiler Error C2466ENikS
2014-07-09add GetRandBytes() as wrapper for RAND_bytes()Philip Kaufmann
- add a small wrapper in util around RAND_bytes() and replace with GetRandBytes() in the code to log errors from calling RAND_bytes() - remove OpenSSL header rand.h where no longer needed
2014-07-01libsecp256k1 integrationPieter Wuille
2014-06-26ensure clean and consistent "namespace" usagePhilip Kaufmann
- remove some missplaced ; - ensure end of a namespace is clearly visible - use same formatting when using namespace
2014-06-21Move crypto implementations to src/crypto/Pieter Wuille
2014-06-21Add a built-in SHA256/SHA512 implementation.Pieter Wuille
This also moves the HMAC-SHA512 implementation to sha2.cpp.
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.
2013-12-02Sanitize assert usage and refuse to compile with NDEBUG.Gregory Maxwell
There were quite a few places where assert() was used with side effects, making operation with NDEBUG non-functional. This commit fixes all the cases I know about, but also adds an #error on NDEBUG because the code is untested without assertions and may still have vulnerabilities if used without assert.