aboutsummaryrefslogtreecommitdiff
path: root/src/uint256.h
AgeCommit message (Collapse)Author
2020-12-31scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-10-12Add txrequest modulePieter Wuille
This adds a new module (unused for now) which defines TxRequestTracker, a data structure that maintains all information about transaction requests, and coordinates requests.
2020-09-28scripted-diff: Replace UINT256_ONE() with uint256::ONEAnthony Towns
-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-
2020-09-28uint256: Update constructors to c++11, make ONE staticAnthony Towns
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.
2020-07-30Make uint256 Span-convertible by adding ::data()Pieter Wuille
2020-07-30scripted-diff: rename base_blob::data to m_dataPieter Wuille
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-
2020-01-23refactor: define a UINT256_ONE global constantAndrew Chow
Instead of having a uint256 representations of one scattered throughout where it is used, define it globally in uint256.h
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-10-15Remove unused includespracticalswift
2018-09-18uint256: Remove unnecessary crypto/common.h useKarl-Johan Alm
2018-07-27Update copyright headers to 2018DrahtBot
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
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-11-11Merge #10749: Use compile-time constants instead of unnamed enumerations ↵MarcoFalke
(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
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-16Declare single-argument (non-converting) constructors "explicit"practicalswift
In order to avoid unintended implicit conversions.
2017-07-26Use compile-time constants instead of unnamed enumerations (remove "enum hack")practicalswift
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-11-07Make GetSerializeSize a wrapper on top of CSizeComputerPieter Wuille
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.
2016-05-17Use SipHash-2-4 for CCoinsCache indexPieter Wuille
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.
2016-05-17Add SipHash-2-4 primitives to hashPieter Wuille
2016-03-18Improve COutPoint less operatorJoão Barbosa
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-11-25uint256::GetCheapHash bigendian compatibilitydaniel
2015-01-05uint256->arith_uint256 blob256->uint256Wladimir J. van der Laan
Introduce new opaque implementation of `uint256`, move old "arithmetic" implementation to `arith_uint256.
2015-01-05Temporarily add SetNull/IsNull/GetCheapHash to base_uintWladimir J. van der Laan
Also add a stub for arith_uint256 and its conversion functions, for now completely based on uint256. Eases step-by-step migration to blob.
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-11-21Convert remaining comments in /src to doxygen formatMichael Ford
- 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
2014-09-14header include cleanupPhilip Kaufmann
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-04Use memcmp for uint256 equality/inequalityPieter Wuille
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-07-14Use unordered_map for CCoinsViewCache with salted hashPieter Wuille
2014-06-28Move non-trivial uint256.h methods to uint256.cppPieter Wuille
2014-05-09Deduplicate uint* comparison operator logicPieter Wuille
2014-05-09Move {Get,Set}Compact from bignum to uint256Pieter Wuille
2014-05-09Add multiplication and division to uint160/uint256Pieter Wuille
2014-05-09Exception instead of assigning 0 in case of wrong vector lengthPieter Wuille
2014-05-09Deduplicate shared code between uint160 and uint256Pieter Wuille
2013-12-25Unittests for uint256.hThomas Holenstein
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.
2013-12-25Changed Get64(.) to GetLow64()Thomas Holenstein
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.
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-11-04Merge pull request #3076 from lano1106/uint256_utilWladimir J. van der Laan
Make util phexdigit array reusable
2013-10-27Make util phexdigit array reusableOlivier Langlois
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 <olivier@olivierlanglois.net>
2013-10-20Bump Year Number to 2013super3
2013-09-18Replace printf with LogPrintf / LogPrintGavin Andresen
2013-05-07Specified base_uint component sizeWilliam Yager
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".
2013-04-12Use a uint256 for bnChainWorkPieter Wuille
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.
2013-01-16Add const versions of base_uint.end()/begin(), make size() const.Matt Corallo
2012-09-10HexStr: don't build a vector<char> firstWladimir J. van der Laan
Also const correctness for lookup tables in hex functions throughout the code.