aboutsummaryrefslogtreecommitdiff
path: root/src/test/bench.c
AgeCommit message (Collapse)Author
2023-01-19Fix compiler warnings about unused variablesDavid Goulet
Fixes #40743 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-06-05Run "make autostyle."Nick Mathewson
2019-02-14Add a benchmark for our several PRNGs.Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-12-14Add a benchmark for parsing a microdescriptorNick Mathewson
2018-11-05Use subsystems manager for subsystems used in tests.Nick Mathewson
2018-09-11Consdiff: use lengths on inputs so they don't need NUL at the endNick Mathewson
This is part of #27244, so that we can safely mmap consensus documents.
2018-09-05Try to fix new coverity warnings in unit tests.Nick Mathewson
2018-08-21When enabling NSS, disable OpenSSL.Nick Mathewson
We used to link both libraries at once, but now that I'm working on TLS, there's nothing left to keep OpenSSL around for when NSS is enabled. Note that this patch causes a couple of places that still assumed OpenSSL to be disabled when NSS is enabled - tor-gencert - pbkdf2
2018-07-31Make sure NSS is initialized before running benchmarksNick Mathewson
2018-07-11Move the initialization and cleanup parts of crypto.cNick Mathewson
These are now part of crypto_init.c. The openssl-only parts now live in crypto_openssl_mgt.c. I recommend reviewing this patch with -b and --color-moved.
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-01Extract more constants from or.hNick Mathewson
2018-07-01Remove needless includes from or.hNick Mathewson
or.h should really include only the minimum of stuff from or/*, common/*, and lib/*.
2018-07-01Combine DH_BYTES and DH_KEY_LEN; put them in a lib/defs header.Nick Mathewson
2018-06-26Finish renaming digestset_contains to digestset_probably_containsNick Mathewson
Since bloom filters are probabilistic, it's nice to make it clear that the "contains" operation can have false positives.
2018-06-26Refactor bloom filter logic not to be digest-specific.Nick Mathewson
Now the address-set code and the digest-set code share the same backend. Closes ticket 26510
2018-06-22Remove bloom filters, order statistics, and bitarrays from container.hNick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Extract cell type and their queues into new headersNick Mathewson
Since packed_cell and destroy_cell exist only to be queued, they go in the same headers as the queues.
2018-06-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-04-05Merge remote-tracking branch 'public/split_relay_crypto'Nick Mathewson
2018-03-19tests: Fix crash on win32 due to uninitialised mutex in bench.c.Gisle Vanem
Signed-off-by: Isis Lovecruft <isis@torproject.org>
2018-03-17Extract the cryptographic parts of crypt_path_t and or_circuit_t.Nick Mathewson
Additionally, this change extracts the functions that created and freed these elements. These structures had common "forward&reverse stream&digest" elements, but they were initialized and freed through cpath objects, and different parts of the code depended on them. Now all that code is extacted, and kept in relay_crypto.c
2018-03-17Move relay-crypto functions from relay.[ch] to relay_crypto.[ch]Nick Mathewson
This should help us improve modularity, and should also make it easier for people to experiment with other relay crypto strategies down the road. This commit is pure function movement.
2018-03-17Extract the crypto parts of circuit_package_relay_cell.Nick Mathewson
2018-01-16Repair a crash bug in src/test/benchNick Mathewson
This was caused because of the new KeyDirectory and CacheDirectory options not being set. Bugfix on 0.3.3.0-alpha; not in any released Tor.
2017-10-18Move tor_git_revision into a new module.Nick Mathewson
At first, we put the tor_git_revision constant in tor_main.c, so that we wouldn't have to recompile config.o every time the git revision changed. But putting it there had unintended side effect of forcing every program that wanted to link libor.a (including test, test-slow, the fuzzers, the benchmarks, etc) to declare their own tor_git_revision instance. That's not very nice, especially since we want to start supporting others who want to link against Tor (see 23846). So, create a new git_revision.c file that only contains this constant, and remove the duplicated boilerplate from everywhere else. Part of implementing ticket 23845.
2017-09-15Merge branch 'scan-build-032'Nick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-12Fix warnings about passing uninitialized buffers into functionsNick Mathewson
Most of these buffers were never actually inspected, but it's still bad style.
2017-04-25Use atomic counters for compressor allocation.Nick Mathewson
2017-03-16Merge branch 'prop140_21643_diff_only_squashed'Nick Mathewson
2017-03-16Avoid all needless memory copies when computing consensus diffs.Nick Mathewson
Previously, we operated on smartlists of NUL-terminated strings, which required us to copy both inputs to produce the NUL-terminated strings. Then we copied parts of _those_ inputs to produce an output smartlist of NUL-terminated strings. And finally, we concatenated everything into a final resulting string. This implementation, instead, uses a pointer-and-extent pattern to represent each line as a pointer into the original inputs and a length. These line objects are then added by reference into the output. No actual bytes are copied from the original strings until we finally concatenate the final result together. Bookkeeping structures and newly allocated strings (like ed commands) are allocated inside a memarea, to avoid needless mallocs or complicated should-I-free-this-or-not bookkeeping. In my measurements, this improves CPU performance by something like 18%. The memory savings should be much, much higher.
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-18Fix a memory leak in bench.cNick Mathewson
2016-09-16Simplify the crypto_cipher_t interface and structureNick Mathewson
Previously, the IV and key were stored in the structure, even though they mostly weren't needed. The only purpose they had was to support a seldom-used API where you could pass NULL when creating a cipher in order to get a random key/IV, and then pull that key/IV back out. This saves 32 bytes per AES instance, and makes it easier to support different key lengths.
2016-09-06checkSpace.pl now forbids more identifiers.Nick Mathewson
The functions it warns about are: assert, memcmp, strcat, strcpy, sprintf, malloc, free, realloc, strdup, strndup, calloc. Also, fix a few lingering instances of these in the code. Use other conventions to indicate _intended_ use of assert and malloc/realloc/etc.
2016-07-28Fix all -Wshadow warnings on LinuxNick Mathewson
This is a partial fix for 18902.
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-02-27Update the copyright year.Nick Mathewson
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-25Make crypto_seed_rng() and crypto_rand() less scary.Nick Mathewson
These functions must really never fail; so have crypto_rand() assert that it's working okay, and have crypto_seed_rng() demand that callers check its return value. Also have crypto_seed_rng() check RAND_status() before returning.
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.