summaryrefslogtreecommitdiff
path: root/src/test/test_crypto.c
AgeCommit message (Collapse)Author
2016-02-27Update the copyright year.Nick Mathewson
2016-02-23Merge branch 'bug17795'Nick Mathewson
2016-02-10Another automated rename.Nick Mathewson
Also simplify crypto_common_digests() to have no loop.
2016-02-10Rename crypto_digest_all, and digests_t.Nick Mathewson
They are no longer "all" digests, but only the "common" digests. Part of 17795. This is an automated patch I made with a couple of perl one-liners: perl -i -pe 's/crypto_digest_all/crypto_common_digests/g;' src/*/*.[ch] perl -i -pe 's/\bdigests_t\b/common_digests_t/g;' src/*/*.[ch]
2016-02-03Make crypto/rng_engine test pass on libressl. Bug not in any released tor.Nick Mathewson
2016-02-03Make Tor build happily with OpenSSL master and libressl.Nick Mathewson
Also tested with 1.0.0t and 1.0.2f. Closes ticket 19784. Closes most of 17921. (Still need to make some tests pass.)
2016-01-15Whitespace cleanupNick Mathewson
2015-12-23Unit tests for crypto_force_rand_ssleay().Nick Mathewson
Part of 16794.
2015-12-23Always test both ed25519 backends.Nick Mathewson
Part of #16794
2015-12-20Appease "make check-spaces"Nick Mathewson
2015-12-20Add the randomized large buffer test for SHA-3 incremental hashing.Yawning Angel
This creates a random 100 KiB buffer, and incrementally hashes (SHA3-512) between 1 and 5 * Rate bytes in a loop, comparing the running digest with the equivalent one shot call from the start of the buffer.
2015-12-19Add `crypto_xof_t` and assorted routines, backed by SHAKE256.Yawning Angel
This is an eXtendable-Output Function with the following claimed security strengths against *all* adversaries: Collision: min(d/2, 256) Preimage: >= min(d, 256) 2nd Preimage: min(d, 256) where d is the amount of output used, in bits.
2015-12-19Add the SHA-3 hash functions to common/crypto.h.Yawning Angel
* DIGEST_SHA3_[256,512] added as supported algorithms, which do exactly what is said on the tin. * test/bench now benchmarks all of the supported digest algorithms, so it's possible to see just how slow SHA-3 is, though the message sizes could probably use tweaking since this is very dependent on the message size vs the SHA-3 rate.
2015-11-27Unit test the full length of SHA256 and SHA512 digeststeor (Tim Wilson-Brown)
Bugfix on a tor version before the refactoring in git commit cea12251995d (23 Sep 2009). Patch by "teor".
2015-11-26Merge remote-tracking branch 'teor/rand-failure-modes-v2'Nick Mathewson
2015-11-26Fix buffer size in sha512 unit testNick Mathewson
Nobody likes a stack overflow, even in unit tests. Closes 17699; but not in any released tor.
2015-11-26Add unit tests that check for common RNG failure modesteor (Tim Wilson-Brown)
Check that crypto_rand doesn't return all zeroes, identical values, or incrementing values (OpenSSL's rand_predictable feature).
2015-11-24add SHA512 support to cryptoGeorge Tankersley
2015-07-16Break some wide linesNick Mathewson
2015-07-06Integrate and enable ed25519-donna.Yawning Angel
The runtime sanity checking is slightly different from the optimized basepoint stuff in that it uses a given implementation's self tests if available, and checks if signing/verification works with a test vector from the IETF EdDSA draft. The unit tests include a new testcase that will fuzz donna against ref0, including the blinding and curve25519 key conversion routines. If this is something that should be done at runtime (No?), the code can be stolen from there. Note: Integrating batch verification is not done yet.
2015-07-06Integrate the accelerated Curve25519 scalar basemult.Yawning Angel
Integration work scavanged from nickm's `ticket8897_9663_v2` branch, with minor modifications. Tor will still sanity check the output but now also attempts to catch extreme breakage by spot checking the optimized implementation vs known values from the NaCl documentation. Implements feature 9663.
2015-05-28Merge branch '12498_ed25519_keys_v6'Nick Mathewson
Fixed numerous conflicts, and ported code to use new base64 api.
2015-05-28Implement ed25519-signed descriptorsNick Mathewson
Now that we have ed25519 keys, we can sign descriptors with them and check those signatures as documented in proposal 220.
2015-05-20Merge branch 'bug16034_no_more_openssl_098_squashed'Nick Mathewson
Conflicts: src/test/testing_common.c
2015-05-20Now that OpenSSL 0.9.8 is dead, crypto_seed_rng() needs no argsNick Mathewson
It needed an argument before because it wasn't safe to call RAND_poll() on openssl 0.9.8c if you had already opened more fds than would fit in fd_set.
2015-04-28Add "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.Yawning Angel
These commands allow for the creation and management of ephemeral Onion ("Hidden") services that are either bound to the lifetime of the originating control connection, or optionally the lifetime of the tor instance. Implements #6411.
2015-04-23Merge remote-tracking branch 'public/bug15745_027_03'Nick Mathewson
2015-04-23Fix some implicit conversion warningsNick Mathewson
2015-04-23Use a custom Base64 encoder with more control over the output format.Yawning Angel
2015-04-21Add test for random-int-in-rangeNick Mathewson
2015-01-23Split the slow unit tests into their own binaryNick Mathewson
This can run in parallel with the faster ones and the other tests.
2015-01-14Basic unit test for condition variables.Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-12Fix wide lines (from 13172)Nick Mathewson
2014-11-12Replace operators used as macro arguments with OP_XX macrosNick Mathewson
Part of fix for 13172
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-10-27Remove configure option to disable curve25519Sebastian Hahn
By now, support in the network is widespread and it's time to require more modern crypto on all Tor instances, whether they're clients or servers. By doing this early in 0.2.6, we can be sure that at some point all clients will have reasonable support.
2014-09-29Whitespace fixesNick Mathewson
2014-09-29Stop test & bench build failures with --disable-curve25519teor
Ensure test & bench code that references curve25519 is disabled by the appropriate macros. tor now builds with and without --disable-curve25519.
2014-09-25Merge branch 'ed25519_ref10_squashed'Nick Mathewson
Conflicts: src/common/include.am src/ext/README
2014-09-25Add a reference implementation of our ed25519 modificationsNick Mathewson
Also, use it to generate test vectors, and add those test vectors to test_crypto.c This is based on ed25519.py from the ed25519 webpage; the kludgy hacks are my own.
2014-09-25Draft implementation for ed25519 key blinding, as in prop224Nick Mathewson
This implementation allows somebody to add a blinding factor to a secret key, and a corresponding blinding factor to the public key. Robert Ransom came up with this idea, I believe. Nick Hopper proved a scheme like this secure. The bugs are my own.
2014-09-25Add curve25519->ed25519 key conversion per proposal 228Nick Mathewson
For proposal 228, we need to cross-certify our identity with our curve25519 key, so that we can prove at descriptor-generation time that we own that key. But how can we sign something with a key that is only for doing Diffie-Hellman? By converting it to the corresponding ed25519 point. See the ALL-CAPS warning in the documentation. According to djb (IIUC), it is safe to use these keys in the ways that ntor and prop228 are using them, but it might not be safe if we start providing crazy oracle access. (Unit tests included. What kind of a monster do you take me for?)
2014-09-25Add encode/decode functions for ed25519 public keysNick Mathewson
2014-09-25Another ed25519 tweak: store secret keys in expanded formatNick Mathewson
This will be needed/helpful for the key blinding of prop224, I believe.
2014-09-25Add Ed25519 support, wrappers, and tests.Nick Mathewson
Taken from earlier ed25519 branch based on floodyberry's ed25519-donna. Tweaked so that it applies to ref10 instead.
2014-09-25Merge branch 'libscrypt_trunnel_squashed'Nick Mathewson
Conflicts: src/test/test_crypto.c
2014-09-25Add tests for failing cases of crypto_pwboxNick Mathewson
2014-09-25Test a full array of s2k flags with pwbox test.Nick Mathewson
Suggested by yawning.
2014-09-25Use preferred key-expansion means for pbkdf2, scrypt.Nick Mathewson
Use HKDF for RFC2440 s2k only.