aboutsummaryrefslogtreecommitdiff
path: root/src/test/crypto_tests.cpp
AgeCommit message (Collapse)Author
2018-07-27Update copyright headers to 2018DrahtBot
2018-05-29Specialized double sha256 for 64 byte inputsPieter Wuille
2018-05-03Make it clear which functions that are intended to be translation unit localpracticalswift
Do not share functions that are meant to be translation unit local with other translation units. Use internal linkage for those consistently.
2018-04-11test: Fix sign for expected valuesKarl-Johan Alm
A number of BOOST_CHECK_EQUAL calls would result in warnings about signs.
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
2017-12-12Merge #11516: crypto: Add test cases covering the relevant HMAC-SHA{256,512} ↵Wladimir J. van der Laan
key length boundaries a3f5657 Add test cases covering the relevant key length boundaries: 64 bytes +/- 1 byte for HMAC-SHA256 and 128 bytes +/- 1 byte for HMAC-SHA512 (practicalswift) Pull request description: * Add test cases covering the relevant key length boundaries: 64 bytes +/- 1 byte for HMAC-SHA256 and 128 bytes +/- 1 byte for HMAC-SHA512. * ~~Avoid creating a one-past-the-end pointer in the case of key length 64 (HMAC-SHA256) and key length 128 (HMAC-SHA512).~~ * ~~Avoid performing a noop memset call (zero length argument) in the case of key length 64 (HMAC-SHA256) and key length 128 (HMAC-SHA512).~~ Tree-SHA512: 48ff9ab79d41aab97b5b8f6496cc08a39955a07eb424f74ada6440d3b168b6204d3527fa677e175c47e40142f9d62c7456ae162e5a2f5b557e90fb353beef1d0
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-10-18Add test cases covering the relevant key length boundaries: 64 bytes +/- 1 ↵practicalswift
byte for HMAC-SHA256 and 128 bytes +/- 1 byte for HMAC-SHA512
2017-09-08Changing &vec[0] to vec.data(), what 9804 missedMeshCollider
2017-06-08Merge #10545: Use list initialization (C++11) for maps/vectors instead of ↵Wladimir J. van der Laan
boost::assign::map_list_of/list_of 3fb81a8 Use list initialization (C++11) for maps/vectors instead of boost::assign::map_list_of/list_of (practicalswift) Tree-SHA512: 63a9ac9ec5799472943dce1cd92a4b14e7f1fe12758a5fc4b1efceaf2c85a4ba71dad5ccc50813527f18b192e7714c076e2478ecd6ca0d452b24e88416f872f7
2017-06-07scripted-diff: Use new naming style for insecure_rand* functionsPieter Wuille
-BEGIN VERIFY SCRIPT- sed -i 's/\<insecure_randbits(/InsecureRandBits(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randbool(/InsecureRandBool(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randrange(/InsecureRandRange(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randbytes(/InsecureRandBytes(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_rand256(/InsecureRand256(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_rand(/InsecureRand32(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<seed_insecure_rand(/SeedInsecureRand(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp -END VERIFY SCRIPT-
2017-06-07Replace more rand() % NUM by randrangesPieter Wuille
2017-06-06Use list initialization (C++11) for maps/vectors instead of ↵practicalswift
boost::assign::map_list_of/list_of
2017-06-05Merge test_random.h into test_bitcoin.hPieter Wuille
2017-03-29Add a FastRandomContext::randrange and use itPieter Wuille
2017-03-29Add ChaCha20Pieter Wuille
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-11-07test: Fix test_random includesMarcoFalke
2016-10-17Kill insecure_random and associated global stateWladimir J. van der Laan
There are only a few uses of `insecure_random` outside the tests. This PR replaces uses of insecure_random (and its accompanying global state) in the core code with an FastRandomContext that is automatically seeded on creation. This is meant to be used for inner loops. The FastRandomContext can be in the outer scope, or the class itself, then rand32() is used inside the loop. Useful e.g. for pushing addresses in CNode or the fee rounding, or randomization for coin selection. As a context is created per purpose, thus it gets rid of cross-thread unprotected shared usage of a single set of globals, this should also get rid of the potential race conditions. - I'd say TxMempool::check is not called enough to warrant using a special fast random context, this is switched to GetRand() (open for discussion...) - The use of `insecure_rand` in ConnectThroughProxy has been replaced by an atomic integer counter. The only goal here is to have a different credentials pair for each connection to go on a different Tor circuit, it does not need to be random nor unpredictable. - To avoid having a FastRandomContext on every CNode, the context is passed into PushAddress as appropriate. There remains an insecure_random for test usage in `test_random.h`.
2016-09-27Do not shadow variablesPavel Janík
2016-05-13crypto: add aes cbc testsCory Fields
2016-05-13Add ctaes-based constant time AES implementationPieter Wuille
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-03-12tests: add a BasicTestingSetup and apply to all testsWladimir J. van der Laan
Make sure that chainparams and logging is properly initialized. Doing this for every test may be overkill, but this initialization is so simple that that does not matter. This should fix the travis issues.
2015-01-06Use libsecp256k1's RFC6979 implementationPieter Wuille
2014-12-16Remove references to X11 licenceMichael Ford
2014-11-20Add the RFC6979 PRNGPieter Wuille
2014-11-20Add HMAC-SHA256Pieter Wuille
2014-11-20Split up crypto/sha2Pieter Wuille
2014-09-23Fixing out of bounds asses errorENikS
2014-08-26Split up util.cpp/hWladimir J. van der Laan
Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
2014-07-09move rand functions from util to new random.h/.cppPhilip Kaufmann
2014-06-21Add <Hasher>::OUTPUT_SIZEPieter Wuille
2014-06-21Extend and move all crypto tests to crypto_tests.cppPieter Wuille