aboutsummaryrefslogtreecommitdiff
path: root/src/key.h
Commit message (Collapse)AuthorAgeFilesLines
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Get rid of nType and nVersionPieter Wuille2016-11-071-2/+2
| | | | | | | | | | | 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.
* wallet: Get rid of LockObject and UnlockObject calls in key.hWladimir J. van der Laan2016-10-191-18/+9
| | | | | | | | | | | | 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.
* Merge #8321: [trivial] Switched constants to sizeof()Wladimir J. van der Laan2016-07-281-12/+16
|\ | | | | | | fbc6070 [trivial] Switched constants to sizeof() (Thomas Snider)
| * [trivial] Switched constants to sizeof()Thomas Snider2016-07-181-12/+16
| |
* | remove outdated legacy codelizhi2016-07-241-3/+0
|/ | | CheckSignatureElement is not used,it be replaced by eccrypto::CheckSignatureElement.
* add bip32 pubkey serializationJonas Schnelli2016-04-141-2/+19
| | | | CExtPubKey should be serializable like CPubKey
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* Merge pull request #6034Wladimir J. van der Laan2015-05-061-6/+4
|\ | | | | | | | | 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)
| * chaincodes: abstract away more chaincode behaviorCory Fields2015-05-061-3/+3
| | | | | | | | [squashme] replace struct CCainCode with a typedef uint256 ChainCode
| * Abstract chaincodes into CChainCodePieter Wuille2015-05-021-5/+3
| | | | | | | | | | | | # Conflicts: # src/key.cpp # src/key.h
* | Update key.cpp to use new libsecp256k1Pieter Wuille2015-05-041-1/+7
|/ | | | | | | | | | | | | | | 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.
* Switch test case signing to RFC6979 extra entropyPieter Wuille2015-03-271-2/+1
| | | | | Instead of manually tweaking the deterministic nonce post-generation, pass the test case number in as extra entropy to RFC6979.
* allocators: split allocators and pagelockerCory Fields2015-03-201-1/+1
| | | | | Pagelocker is only needed for secure (usually wallet) operations, so don't make the zero-after-free allocator depend on it.
* Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* Merge pull request #5227Wladimir J. van der Laan2014-12-011-2/+6
|\ | | | | | | | | | | | | | | | | 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)
| * Deterministic signingPieter Wuille2014-11-201-2/+6
| |
* | Merge pull request #5224Wladimir J. van der Laan2014-11-241-0/+6
|\ \ | | | | | | | | | | | | f321d6b Add key generation/verification to ECC sanity check (Pieter Wuille) d0c41a7 Add sanity check after key generation (Pieter Wuille)
| * | Add sanity check after key generationPieter Wuille2014-11-231-0/+6
| |/ | | | | | | | | | | | | 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.
* / minor style cleanup after HTTP rest interface mergePhilip Kaufmann2014-11-201-1/+2
|/ | | | - no code changes
* Do signature-s negation inside the testsPieter Wuille2014-11-101-1/+1
| | | | To avoid the need for libsecp256k1 to expose such functionality.
* Fixing warning C4099: 'CExtPubKey' : type name first seen using 'class' now ↵ENikS2014-11-061-1/+1
| | | | seen using 'struct'
* minor code style cleanup after recent mergesPhilip Kaufmann2014-11-041-1/+1
| | | | | - add a missing license header - correct some header orderings etc.
* boost: moveonly: split CPubKey and friends to new filesCory Fields2014-10-311-182/+3
|
* Update comments in key to be doxygen compatibleMichael Ford2014-10-281-61/+78
|
* script: move CScriptID to standard.h and add a ctor for creating them from ↵Cory Fields2014-10-171-8/+0
| | | | | | | | | | | | | | | | 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();
* Add automatic script test generation, and actual checksig testsPieter Wuille2014-09-261-1/+1
|
* Apply clang-format on some infrequently-updated filesPieter Wuille2014-09-191-52/+79
|
* Merge pull request #4779Wladimir J. van der Laan2014-09-011-1/+1
|\ | | | | | | 093303a add missing header end comments (Philip Kaufmann)
| * add missing header end commentsPhilip Kaufmann2014-08-281-1/+1
| | | | | | | | | | | | - 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
* | Fix a few "Uninitialized scalar field" warningsWladimir J. van der Laan2014-08-281-1/+1
|/ | | | | | Fix a few warnings reported by Coverity. None of these is critical, but making sure that class fields are initialized can avoid heisenbugs.
* key.cpp: fail with a friendlier message on missing ssl EC supportAndrew Poelstra2014-06-031-0/+3
| | | | | | | | | | | | | | | | | | | | | 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.
* remove CPubKey::VerifyCompact( ) which is never usedKamil Domanski2014-05-201-4/+0
|
* Also switch the (unused) verification code to low-s instead of even-s.Pieter Wuille2014-03-101-0/+3
| | | | | | | | 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.
* Document that CPubKey.IsValid() is consensus criticalPeter Todd2014-02-251-1/+3
|
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-3/+5
| | | | | | | | | 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.
* fix wrong memcmp() usage in CKey::operator==Philip Kaufmann2013-10-281-3/+4
| | | | | | - 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
* improve wallet load time by removing duplicated calls to EC_KEY_check_key ↵patrick s2013-08-281-0/+3
| | | | | | and adding a hash for vchPubKey/vchPrivKey entries in wallet.dat backwards compatible with previous wallet.dat format
* BIP32 derivation implementationPieter Wuille2013-07-151-0/+46
|
* Make signature cache store CPubKeysPieter Wuille2013-05-301-4/+3
|
* CSecret/CKey -> CKey/CPubKey split/refactorPieter Wuille2013-05-301-92/+131
|
* Make CPubKey statically allocatedPieter Wuille2013-05-301-14/+71
|
* Split off hash.h from util.hPieter Wuille2012-12-181-1/+1
|
* Compact serialization for scriptsPieter Wuille2012-10-201-2/+1
| | | | | | | | | | | Special serializers for script which detect common cases and encode them much more efficiently. 3 special cases are defined: * Pay to pubkey hash (encoded as 21 bytes) * Pay to script hash (encoded as 21 bytes) * Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes) Other scripts up to 121 bytes require 1 byte + script length. Above that, scripts up to 16505 bytes require 2 bytes + script length.
* update comment, secure_allocator is defined in allocators.hWladimir J. van der Laan2012-09-151-1/+1
|
* Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddressPieter Wuille2012-05-241-2/+23
| | | | | | | | | | | | | | | | | This introduces internal types: * CKeyID: reference (hash160) of a key * CScriptID: reference (hash160) of a script * CTxDestination: a boost::variant of the former two CBitcoinAddress is retrofitted to be a Base58 encoding of a CTxDestination. This allows all internal code to only use the internal types, and only have RPC and GUI depend on the base58 code. Furthermore, the header dependencies are a lot saner now. base58.h is at the top (right below rpc and gui) instead of at the bottom. For the rest: wallet -> script -> keystore -> key. Only keystore still requires a forward declaration of CScript. Solving that would require splitting script into two layers.
* Encapsulate public keys in CPubKeyPieter Wuille2012-05-241-2/+37
|
* Merge branch 'optimize'Gavin Andresen2012-05-221-245/+23
|\
| * Refactor: move code from key.h to key.cppGavin Andresen2012-05-171-245/+23
| |
* | Update License in File HeadersFordy2012-05-181-1/+1
|/ | | | | | I originally created a pull to replace the "COPYING" in crypter.cpp and crypter.h, but it turned out that COPYING was actually the correct file.