aboutsummaryrefslogtreecommitdiff
path: root/src/uint256.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.
* 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.
* Merge pull request #1126 from drizztbsd/masterPieter Wuille2012-04-211-0/+1
|\ | | | | Fix build with gcc 4.7
| * Add missing includes. (Fix bulding under GCC 4.7)Timothy Redaelli2012-04-201-0/+1
| |
* | Fix bugs on 'unsigned char' platforms.Dwayne C. Litzenberger2012-04-181-1/+1
|/ | | | | | | | | | | | | | | | | | In ISO C++, the signedness of 'char' is undefined. On some platforms (e.g. ARM), 'char' is an unsigned type, but some of the code relies on 'char' being signed (as it is on x86). This is indicated by compiler warnings like this: bignum.h: In constructor 'CBigNum::CBigNum(char)': bignum.h:81:59: warning: comparison is always true due to limited range of data type [-Wtype-limits] util.cpp: In function 'bool IsHex(const string&)': util.cpp:427:28: warning: comparison is always false due to limited range of data type [-Wtype-limits] In particular, IsHex erroneously returned true regardless of the input characters, as long as the length of the string was a positive multiple of 2. Note: For testing, it's possible using GCC to force char to be unsigned by adding the -funsigned-char parameter to xCXXFLAGS.
* Further reduce header dependenciesPieter Wuille2012-04-171-5/+6
| | | | | | | This commit removes the dependency of serialize.h on PROTOCOL_VERSION, and makes this parameter required instead of implicit. This is much saner, as it makes the places where changing a version number can have an influence obvious.
* Move proto version to version.h. Reduce header deps a bit more.Jeff Garzik2012-04-171-2/+3
|
* Fix loop index var types, fixing many minor sign comparison warningsJeff Garzik2012-04-151-1/+1
| | | | | foo.size() typically returns an unsigned integral type; make loop variables match those types' signedness.
* fix warnings: array subscript is of type 'char' [-Wchar-subscripts]Wladimir J. van der Laan2012-04-151-1/+1
|
* Begin doxygen-compatible commentsPieter Wuille2012-03-261-2/+5
|
* CAddrMan: stochastic address managerPieter Wuille2012-02-241-0/+4
| | | | | | | | | Design goals: * Only keep a limited number of addresses around, so that addr.dat does not grow without bound. * Keep the address tables in-memory, and occasionally write the table to addr.dat. * Make sure no (localized) attacker can fill the entire table with his nodes/addresses. See comments in addrman.h for more detailed information.
* Fix #616: remove base_uint::operator&=(uint64 b)Pieter Wuille2012-02-191-7/+0
|
* Update all copyrights to 2012Gavin Andresen2012-02-071-1/+1
|
* Network stack refactorPieter Wuille2012-01-061-1/+3
| | | | | | | | | | | | | | | This introduces CNetAddr and CService, respectively wrapping an (IPv6) IP address and an IP+port combination. This functionality used to be part of CAddress, which also contains network flags and connection attempt information. These extra fields are however not always necessary. These classes, along with logic for creating connections and doing name lookups, are moved to netbase.{h,cpp}, which does not depend on headers.h. Furthermore, CNetAddr is mostly IPv6-ready, though IPv6 functionality is not yet enabled for the application itself.
* Revert "Use standard C99 (and Qt) types for 64-bit integers"Wladimir J. van der Laan2011-12-211-20/+21
| | | | This reverts commit 21d9f36781604e4ca9fc35dc65265593423b73e9.
* Use standard C99 (and Qt) types for 64-bit integersLuke Dashjr2011-12-201-21/+20
|
* Cleanup: removed dead code, and use C99 typedefs for int64 (supported by all ↵Gavin Andresen2011-12-191-8/+0
| | | | modern c++ compilers)
* Implement BIP 14 : separate protocol version from client versionGavin Andresen2011-12-191-3/+3
|