aboutsummaryrefslogtreecommitdiff
path: root/src/bignum.h
Commit message (Collapse)AuthorAgeFilesLines
* Move bignum.h to test/Pieter Wuille2014-05-091-179/+0
|
* Reduce bignum.h now it is only needed for scriptnum_testsPieter Wuille2014-05-091-353/+2
|
* Move {Get,Set}Compact from bignum to uint256Pieter Wuille2014-05-091-65/+0
|
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-17/+22
| | | | | | | | | 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-3/+3
|\ | | | | Make util phexdigit array reusable
| * Make util phexdigit array reusableOlivier Langlois2013-10-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
|/
* Use a uint256 for bnChainWorkPieter Wuille2013-04-121-1/+1
| | | | | | | | | 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.
* Fix two typos in main.hfanquake2012-12-171-1/+3
| | | | Break one long comment down into 3 lines so it's readable.
* Merge pull request #1825 from roques/bignum2Gavin Andresen2012-12-121-14/+54
|\ | | | | Bignum2
| * reimplement CBigNum's compact encoding of difficulty targetsChristian von Roques2012-09-171-14/+54
| | | | | | | | | | Use shifts instead of going through the MPI representation of BIGNUMs. Be careful to keep the meaning of 0x00800000 as sign bit.
* | 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.
* fix OpenSSL not written as proper noun in some commentsPhilip Kaufmann2012-07-211-1/+1
|
* Merge pull request #1497 from luke-jr/bugfix_neguintGregory Maxwell2012-07-111-9/+3
|\ | | | | CBigNum: Convert negative int64 values in a more well-defined way
| * CBigNum: Convert negative int64 values in a more well-defined wayLuke Dashjr2012-06-181-9/+3
| | | | | | | | Since the minimum signed integer cannot be represented as positive so long as its type is signed, and it's not well-defined what happens if you make it unsigned before negating it, we instead increment the negative integer by 1, convert it, then increment the (now positive) unsigned integer by 1 to compensate
* | Merge branch 'signbugs' of https://github.com/wizeman/bitcoinGavin Andresen2012-06-181-4/+18
|\| | | | | | | Resolved minor conflict in main.cpp
| * Fix signed subtraction overflow in CBigNum::setint64().Ricardo M. Correia2012-05-141-1/+9
| | | | | | | | | | | | | | | | As noticed by sipa (Pieter Wuille), this can happen when CBigNum::setint64() is called with an integer value of INT64_MIN (-2^63). When compiled with -ftrapv, the program would crash. Otherwise, it would execute an undefined operation (although in practice, usually the correct one).
| * Don't overflow signed ints in CBigNum::setint64().Ricardo M. Correia2012-05-141-5/+11
| | | | | | | | | | | | | | CBigNum::setint64() does 'n <<= 8', where n is of type "long long". This leads to shifting onto and past the sign bit, which is undefined behavior in C++11 and can cause problems in the future.
* | 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.
* Add casts for unavoidable signed/unsigned comparisonsJeff Garzik2012-04-231-2/+2
| | | | | At these code sites, it is preferable to cast rather than change a variable's type.
* Prefer 'unsigned int' for loop index variables tested against ::size()Jeff Garzik2012-04-221-1/+1
| | | | | | | | | C++ STL ::size() generally returns unsigned, which implies that "int idx" style of loop variable will generate a signed-vs-unsigned comparison warning when testing the loop exit condition "idx < blah.size()" Update areas of the bitcoin code where loop variables may be more properly and correctly defined as unsigned.
* Fix bugs on 'unsigned char' platforms.Dwayne C. Litzenberger2012-04-181-2/+3
| | | | | | | | | | | | | | | | | | 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.
* Remove headers.hPieter Wuille2012-04-171-1/+1
|
* fix warnings: array subscript is of type 'char' [-Wchar-subscripts]Wladimir J. van der Laan2012-04-151-1/+1
|
* fixed typo in comment in netbase.h and bignum.hPhilip Kaufmann2012-03-301-1/+1
|
* Begin doxygen-compatible commentsPieter Wuille2012-03-261-2/+3
|
* Workaround for BN_bn2mpi reading/writing out of boundsPieter Wuille2012-02-181-1/+1
| | | | | | | | When OpenSSL's BN_bn2mpi is passed a buffer of size 4, valgrind reports reading/writing one byte past it. I am unable to find evidence of this behaviour in BN_bn2mpi's source code, so it may be a spurious warning. However, this change is harmless, as only the bignum with value 0 results in an mpi serialization of size 4.
* Update all copyrights to 2012Gavin Andresen2012-02-071-1/+1
|
* Revert "Use standard C99 (and Qt) types for 64-bit integers"Wladimir J. van der Laan2011-12-211-7/+5
| | | | This reverts commit 21d9f36781604e4ca9fc35dc65265593423b73e9.
* Use standard C99 (and Qt) types for 64-bit integersLuke Dashjr2011-12-201-5/+7
|
* Use std::numeric_limits<> for typesafe INT_MAX/etcGavin Andresen2011-12-191-2/+2
|
* Implement BIP 14 : separate protocol version from client versionGavin Andresen2011-12-191-3/+3
|
* Unify copyright notices.Matt Corallo2011-08-091-0/+1
| | | | | | To a variation on: // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2011 The Bitcoin developers
* Demystify a few magic numbers.Doug Huff2011-06-061-0/+3
|
* make bitcoin include files more modularWladimir J. van der Laan2011-05-151-5/+7
|
* directory re-organization (keeps the old build system)Jaromil2011-04-231-0/+532
there is no internal modification of any file in this commit files are moved into directories according to established standards in sourcecode distribution; these directories contain: src - Files that are used in constructing the executable binaries, but are not installed. doc - Files in HTML and text format that document usage, quirks of the implementation, and contributor checklists. locale - Files that contain human language translation of strings used in the program contrib - Files contributed from distributions or other third party implementing scripts and auxiliary programs