summaryrefslogtreecommitdiff
path: root/src/common/crypto.h
AgeCommit message (Collapse)Author
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-30Merge branch 'combined-fuzzing-v4'Nick Mathewson
2017-01-30Make a bunch of signature/digest-checking functions mockableNick Mathewson
2017-01-11Merge branch 'bug20569_030_02_squashed'Nick Mathewson
2017-01-11hs: Use AES-256 for v3 descriptorDavid Goulet
That key size is taken from proposal 224 thus specified in the protocol. Closes #20569 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-14crypto: Change crypto_mac_sha3_256 to use the key length in the constructionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-14prop224 prepwork: Introduce HMAC-SHA3 function.George Kadianakis
2016-09-16Add support for AES256 and AES192Nick Mathewson
(This will be used by prop224)
2016-09-16Remove a needless level of indirection from crypto_cipher_tNick Mathewson
Now that crypto_cipher_t only contains a pointer, it no longer has any reason for an independent existence.
2016-09-11Merge remote-tracking branch 'public/solaris_warnings_028'Nick Mathewson
2016-09-09Chop another ~93 RSA key generations out of the unit testsNick Mathewson
We have a mock for our RSA key generation function, so we now wire it to pk_generate(). This covers all the cases that were not using pk_generate() before -- all ~93 of them.
2016-07-28Fix a large pile of solaris warnings for bug 19767.Nick Mathewson
In nearly all cases, this is a matter of making sure that we include orconfig.h before we include any standard c headers.
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-05-23Expose crypto_digest_algorithm_get_length from crypto.cNick Mathewson
Also, use it in routerparse.c
2016-05-16Improve test coverage of our strongest-rng code.Nick Mathewson
2016-02-27Update the copyright year.Nick Mathewson
2016-02-23Merge branch 'bug17795'Nick Mathewson
2016-02-10Whitespace fixesNick 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-06changing output of crypto_cipher_crypt_inplace from int to voidHassan Alsibyani
2016-01-27Restrict the meaning of digests_t to sha1+sha256.Nick Mathewson
This saves CPU and RAM when handling consensuses and x509 certs. Closes ticket 17795; bug not in any released tor.
2016-01-08Merge remote-tracking branch 'public/feature16794_more'Nick Mathewson
2015-12-29Remove the (now-unused) digest_algorithm_bitfield_tNick Mathewson
2015-12-23Unit tests for crypto_force_rand_ssleay().Nick Mathewson
Part of 16794.
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-12-10Merge remote-tracking branch 'public/feature17694_strongest_027'Nick Mathewson
2015-12-08Always hash crypto_strongest_rand() along with some prngNick Mathewson
(before using it for anything besides feeding the PRNG) Part of #17694
2015-11-25Merge branch 'bug17686_v2_027'Nick Mathewson
2015-11-25Now that crypto_rand() cannot fail, it should return void.Nick Mathewson
2015-11-25Add crypto-initializer functions to those whose return values must be checkedNick Mathewson
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-11-24add SHA512 support to cryptoGeorge Tankersley
2015-10-02Fix "make check-spaces"Nick Mathewson
2015-09-15Add tests for tortls.cOla Bini
2015-08-12Add crypto_rand_unmocked, which is crypto_rand without mocking.Yawning Angel
There is odd issues with calling crypto_rand from our copy of ed25519-donna, due to mocking that are not easily resolved.
2015-07-31Move formatting functions around.Nick Mathewson
The base64 and base32 functions used to be in crypto.c; crypto_format.h had no header; some general-purpose functions were in crypto_curve25519.c. This patch makes a {crypto,util}_format.[ch], and puts more functions there. Small modules are beautiful!
2015-05-28Merge branch '12498_ed25519_keys_v6'Nick Mathewson
Fixed numerous conflicts, and ported code to use new base64 api.
2015-05-28Implement proposal 228: cross-certification with onion keysNick Mathewson
Routers now use TAP and ntor onion keys to sign their identity keys, and put these signatures in their descriptors. That allows other parties to be confident that the onion keys are indeed controlled by the router that generated the descriptor.
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-23Fix some conversion problemsNick Mathewson
2015-04-23Merge remote-tracking branch 'public/bug15745_027_03'Nick Mathewson
2015-04-23Merge branch 'feature15652_squashed'Nick Mathewson
2015-04-23Use a custom Base64 encoder with more control over the output format.Yawning Angel
2015-04-21Add crypto_rand_int_range() and use itDavid Goulet
Incidently, this fixes a bug where the maximum value was never used when only using crypto_rand_int(). For instance this example below in rendservice.c never gets to INTRO_POINT_LIFETIME_MAX_SECONDS. int intro_point_lifetime_seconds = INTRO_POINT_LIFETIME_MIN_SECONDS + crypto_rand_int(INTRO_POINT_LIFETIME_MAX_SECONDS - INTRO_POINT_LIFETIME_MIN_SECONDS); Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-15Fix spaces in crypto.h and test-memwipe.cteor