aboutsummaryrefslogtreecommitdiff
path: root/src/uint256.h
Commit message (Collapse)AuthorAgeFilesLines
* Add txrequest modulePieter Wuille2020-10-121-0/+1
| | | | | | This adds a new module (unused for now) which defines TxRequestTracker, a data structure that maintains all information about transaction requests, and coordinates requests.
* scripted-diff: Replace UINT256_ONE() with uint256::ONEAnthony Towns2020-09-281-2/+0
| | | | | | | -BEGIN VERIFY SCRIPT- sed -i '/inline.* UINT256_ONE() {/,+1d' src/uint256.h sed -i 's/UINT256_ONE()/uint256::ONE/' $(git grep -l UINT256_ONE) -END VERIFY SCRIPT-
* uint256: Update constructors to c++11, make ONE staticAnthony Towns2020-09-281-7/+10
| | | | | | | | | Replace the memset with C++11 value/aggregate initialisation of the m_data array, which still ensures the unspecified values end up as zero-initialised. This then allows changing UINT256_ONE() from dynamically allocating an object, to a simpler referencing a static allocation.
* Make uint256 Span-convertible by adding ::data()Pieter Wuille2020-07-301-0/+3
|
* scripted-diff: rename base_blob::data to m_dataPieter Wuille2020-07-301-13/+13
| | | | | | | | This is in preparation for exposing a ::data member function. -BEGIN VERIFY SCRIPT- sed -i "s/\([^.]\|other.\)data/\1m_data/g" src/uint256.h src/uint256.cpp -END VERIFY SCRIPT-
* refactor: define a UINT256_ONE global constantAndrew Chow2020-01-231-0/+2
| | | | | Instead of having a uint256 representations of one scattered throughout where it is used, define it globally in uint256.h
* scripted-diff: Bump copyright of files changed in 2019MarcoFalke2019-12-301-1/+1
| | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* Remove unused includespracticalswift2019-10-151-1/+0
|
* uint256: Remove unnecessary crypto/common.h useKarl-Johan Alm2018-09-181-11/+0
|
* Update copyright headers to 2018DrahtBot2018-07-271-1/+1
|
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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-
* Merge #10749: Use compile-time constants instead of unnamed enumerations ↵MarcoFalke2017-11-111-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | (remove "enum hack") 1e65f0f33 Use compile-time constants instead of unnamed enumerations (remove "enum hack") (practicalswift) Pull request description: Use compile-time constants instead of unnamed enumerations (remove "enum hack"). Tree-SHA512: 1b6ebb2755398c5ebab6cce125b1dfc39cbd1504d98d55136b32703fe935c4070360ab3b2f52b1da48ba9f3b01082d204f3d87c92ccb5c8c333731f7f972e128
| * Use compile-time constants instead of unnamed enumerations (remove "enum hack")practicalswift2017-07-261-1/+1
| |
* | Remove some unused functions and methodsPieter Wuille2017-09-211-2/+0
| | | | | | | | | | | | | | 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.
* | Declare single-argument (non-converting) constructors "explicit"practicalswift2017-08-161-2/+2
|/ | | | In order to avoid unintended implicit conversions.
* 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.
* Make GetSerializeSize a wrapper on top of CSizeComputerPieter Wuille2016-11-071-5/+0
| | | | | | | | | | | Given that in default GetSerializeSize implementations created by ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid of the specialized GetSerializeSize methods everywhere, and just use CSizeComputer. This removes a lot of code which isn't actually used anywhere. For CCompactSize and CVarInt this actually removes a more efficient size computing algorithm, which is brought back in a later commit.
* Use SipHash-2-4 for CCoinsCache indexPieter Wuille2016-05-171-5/+0
| | | | | This is ~1.7x slower than the Lookup3-of-Xor-with-salt construct we were using before, but it is a primitive designed for exactly this.
* Add SipHash-2-4 primitives to hashPieter Wuille2016-05-171-0/+13
|
* Improve COutPoint less operatorJoão Barbosa2016-03-181-3/+5
|
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* uint256::GetCheapHash bigendian compatibilitydaniel2015-11-251-4/+2
|
* uint256->arith_uint256 blob256->uint256Wladimir J. van der Laan2015-01-051-267/+72
| | | | | Introduce new opaque implementation of `uint256`, move old "arithmetic" implementation to `arith_uint256.
* Temporarily add SetNull/IsNull/GetCheapHash to base_uintWladimir J. van der Laan2015-01-051-0/+20
| | | | | | | Also add a stub for arith_uint256 and its conversion functions, for now completely based on uint256. Eases step-by-step migration to blob.
* Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* Convert remaining comments in /src to doxygen formatMichael Ford2014-11-211-23/+26
| | | | | | | | | | - Update comments in checkpoints to be doxygen compatible - Update comments in checkqueue to be doxygen compatible - Update coins to be doxygen compatible - Fix comment typo in crypter.h - Update licenses/copyright dates Closes #5325 #5184 #5183 #5182
* header include cleanupPhilip Kaufmann2014-09-141-1/+1
| | | | - ensures alphabetical ordering for includes etc. in source file headers
* Use memcmp for uint256 equality/inequalityPieter Wuille2014-09-041-2/+3
|
* 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
* Use unordered_map for CCoinsViewCache with salted hashPieter Wuille2014-07-141-1/+3
|
* Move non-trivial uint256.h methods to uint256.cppPieter Wuille2014-06-281-245/+17
|
* Deduplicate uint* comparison operator logicPieter Wuille2014-05-091-69/+20
|
* Move {Get,Set}Compact from bignum to uint256Pieter Wuille2014-05-091-0/+70
|
* Add multiplication and division to uint160/uint256Pieter Wuille2014-05-091-0/+70
|
* Exception instead of assigning 0 in case of wrong vector lengthPieter Wuille2014-05-091-5/+10
|
* Deduplicate shared code between uint160 and uint256Pieter Wuille2014-05-091-241/+65
|
* Unittests for uint256.hThomas Holenstein2013-12-251-150/+0
| | | | | | Unit tests for uint256.h. The file uint160_tests.cpp is no longer needed. The ad-hoc tests which were in uint256.h are also no longer needed. The new tests achieve 100% coverage.
* Changed Get64(.) to GetLow64()Thomas Holenstein2013-12-251-3/+4
| | | | | | | The function Get64(.) has a bug in case the width is not divisible by 64. Since it is only ever used as Get64(0) this simply changes it to this special case. Additionally, an assert is added, and a cast to prevent a compiler error.
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-60/+57
| | | | | | | | | 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.
* Merge pull request #3076 from lano1106/uint256_utilWladimir J. van der Laan2013-11-041-6/+9
|\ | | | | Make util phexdigit array reusable
| * Make util phexdigit array reusableOlivier Langlois2013-10-271-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | class template base_uint had its own private lookup table. This is saving 256 bytes per instantiation. The result is not spectacular as bitcoin-qt has only shrinked of about 1Kb but it is still valid improvement. Also, I have replaced a for loop with a memset() call. Made CBigNum::SetHex() use the new HexDigit() function. Signed-off-by: Olivier Langlois <[email protected]>
* | Bump Year Number to 2013super32013-10-201-1/+1
|/
* Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-47/+47
|
* Specified base_uint component sizeWilliam Yager2013-05-071-2/+3
| | | | | | | A base_uint used to be made of an array of unsigned ints. This works fine on most platforms, but might not work on certain present or future platforms. The code breaks if an unsigned int is 16 or 64 bits, so it's important to be specific. Also changed "u" to "you".
* Use a uint256 for bnChainWorkPieter Wuille2013-04-121-0/+10
| | | | | | | | | Every block index entry currently requires a separately-allocated CBigNum. By replacing them with uint256, it's just 32 bytes extra in CBlockIndex itself. This should save us a few megabytes in RAM, and less allocation overhead.
* Add const versions of base_uint.end()/begin(), make size() const.Matt Corallo2013-01-161-1/+11
|
* HexStr: don't build a vector<char> firstWladimir J. van der Laan2012-09-101-1/+1
| | | | Also const correctness for lookup tables in hex functions throughout the code.
* 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.