summaryrefslogtreecommitdiff
path: root/src/common/crypto.h
AgeCommit message (Collapse)Author
2018-06-21Split crypto and tls libraries into directoriesNick Mathewson
I am calling the crypto library "crypt_ops", since I want higher-level crypto things to be separated from lower-level ones. This library will hold only the low-level ones, once we have it refactored.
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Remove dmalloc support; closes #26426Nick Mathewson
Dmalloc hasn't seen a release in over a decade, and there are much better tools to use these days.
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-05-08Refactor crypto.[ch] into smaller DH module.Fernando Fernandez Mancera
Add two new files (crypto_dh.c, crypto_dh.h) as new module of crypto.[ch]. This new module includes all functions and dependencies related to DH operations. Those have been removed from crypto.[ch]. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-04-18crypto: Move declaration of crypto_init_siphash_key() into crypto.h.Isis Lovecruft
On second thought, this is a global initialisation function and doesn't conceptually have much to do with getting/using randomnesses.
2018-04-06crypto: Remove unnecessary includes from src/common/crypto.[ch]Isis Lovecruft
* FIXES part of #24658: https://bugs.torproject.org/24658
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-02-16Move crypto_pk_obsolete_* functions into RSA module.Fernando Fernandez Mancera
We moved the crypto_pk_obselete_* functions into crypto_rsa.[ch] because they fit better with the RSA module. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-02-03Add xof functions into crypto_digest.[ch]Fernando Fernandez Mancera
Added xof functions and operations into xof+digest module. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-02-03Refactor crypto.[ch] into smaller xof+digest module.Fernando Fernandez Mancera
Add two new files (crypto_digest.c, crypto_digest.h) as new module of crypto.[ch]. This new module includes all functions and dependencies related to digest and xof operations. Those have been removed from crypto.[ch]. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-26Refactor crypto.[ch] into smaller RSA module.Fernando Fernandez Mancera
Add two new files (crypto_rsa.c, crypto_rsa.h) as new module of crypto.[ch]. This new module includes all functions and dependencies related to RSA operations. Those have been removed from crypto.[ch]. All new changes related to RSA operations must be done in these files. Follows #24658 Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-23Merge remote-tracking branch 'ffmancera/bug24658-openssl'Nick Mathewson
2018-01-08Refactor crypto.[ch] into smaller OpenSSL module.Fernando Fernandez Mancera
Add two new files (crypto_openssl.c, crypto_openssl.h) as new module of crypto.[ch]. This new module includes all functions and dependencies related to OpenSSL management. Those have been removed from crypto.[ch]. All new changes related to OpenSSL management must be done in these files. Follows #24658 Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-12-08Fix wide lines introduced by previous patch.Nick Mathewson
2017-12-08Replace all FREE_AND_NULL* uses to take a type and a free function.Nick Mathewson
This commit was made mechanically by this perl script: \#!/usr/bin/perl -w -i -p next if /^#define FREE_AND_NULL/; s/\bFREE_AND_NULL\((\w+),/FREE_AND_NULL\(${1}_t, ${1}_free_,/; s/\bFREE_AND_NULL_UNMATCHED\(/FREE_AND_NULL\(/;
2017-11-17Make all the crypto free() functions macros that clear their targetsNick Mathewson
2017-09-19Add a BASE32_DIGEST_LEN defineDavid Goulet
Use this value instead of hardcoded values of 32 everywhere. This also addresses the use of REND_DESC_ID_V2_LEN_BASE32 in hs_lookup_last_hid_serv_request() for the HSDir encoded identity digest length which is accurate but semantically wrong. Fixes #23305. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-07-24Rename the hybrid_encrypt/decrypt functions; label them as dangerousNick Mathewson
We need to keep these around for TAP and old-style hidden services, but they're obsolete, and we shouldn't encourage anyone to use them. So I've added "obsolete" to their names, and a comment explaining what the problem is. Closes ticket 23026.
2017-07-07Hide crypto_digest_t again and use an accessor for tests.George Kadianakis
2017-07-07test: Crypto groundwork for e2e circuit unittests.George Kadianakis
- Move some crypto structures so that they are visible by tests. - Introduce a func to count number of hops in cpath which will be used by the tests. - Mark a function as mockable.
2017-03-31Isolate dmalloc/openssl bridge code to crypto.cNick Mathewson
This makes it so main.c, and the rest of src/or, no longer need to include any openssl headers.
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.