aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto_curve25519.c
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-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-04-06refactor: Remove unnecessary `#include "crypto.h"` throughout codebase.Isis Lovecruft
* FIXES part of #24658: https://bugs.torproject.org/24658
2018-04-06crypto: Alphabetise some #includes in /src/common/crypto*.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-03Include crypto_digest.h in order to solve dependency issues.Fernando Fernandez Mancera
Included crypto_digest.h in some files in order to solve xof+digest module dependency issues. Removed crypto.h where it isn't needed anymore. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2017-09-28Move around some LCOV_EXCLs in src/commonNick Mathewson
Apparently, my compiler now generates coverage markers for label-only lines, so we need to exclude those too if they are meant to be unreachable.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-11comment fix from pastlyNick Mathewson
2016-10-17Fix a syntax problemNick Mathewson
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-05-16Mark unreachable lines in crypto_curve25519.cNick Mathewson
Also, resolve a bug in test_ntor_cl.c
2016-03-26Do not treat "DOCDOC" as doxygen.Nick Mathewson
2016-02-27Update the copyright year.Nick Mathewson
2016-02-27Add a brief file-level description for everything in src/commonNick 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-25Now that crypto_rand() cannot fail, it should return void.Nick Mathewson
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-07-16Fix most check-spaces issuesNick Mathewson
2015-07-14Make file-reading and key-reading preserve errnoNick Mathewson
This is an important part of #16582.
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-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
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-09-25Fix on that last fix.Nick Mathewson
2014-09-25Fix warnings on 32-bit builds.Nick Mathewson
When size_t is the most memory you can have, make sure that things referring to real parts of memory are size_t, not uint64_t or off_t. But not on any released Tor.
2014-09-25Comments and tweaks based on review by asnNick Mathewson
Add some documentation Rename "derive" -> "blind" Check for failure on randombytes().
2014-09-25Support for writing ed25519 public/private components to disk.Nick Mathewson
This refactors the "== type:tag ==" code from crypto_curve25519.c
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.
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-03-23Avoid clang warnings from implicit off_t->size_t castNick Mathewson
2013-02-07Tolerate curve25519 backends where the high bit of the pk isn't ignoredNick Mathewson
Right now, all our curve25519 backends ignore the high bit of the public key. But possibly, others could treat the high bit of the public key as encoding out-of-bounds values, or as something to be preserved. This could be used to distinguish clients with different backends, at the cost of killing a circuit. As a workaround, let's just clear the high bit of each public key indiscriminately before we use it. Fix for bug 8121, reported by rransom. Bugfix on 0.2.4.8-alpha.
2013-02-04Fix compilation with --disable-curve25519 optionNick Mathewson
The fix is to move the two functions to format/parse base64 curve25519 public keys into a new "crypto_format.c" file. I could have put them in crypto.c, but that's a big file worth splitting anyway. Fixes bug 8153; bugfix on 0.2.4.8-alpha where I did the fix for 7869.
2013-01-31typo in crypto_curve25519.c comment, spotted by rransomNick Mathewson
2013-01-16Check for nacl headers in nacl/ subdirNick Mathewson
Fix for bug 7972
2013-01-16Update the copyright date to 201.Nick Mathewson
2013-01-15Clean up odds and endsRoger Dingledine
2013-01-05Make the = at the end of ntor-onion-key optional.Nick Mathewson
Makes bug 7869 more easily fixable if we ever choose to do so.
2013-01-03Check all crypto_rand return values for ntor.Nick Mathewson
2013-01-03Use safe_mem_is_zero for checking curve25519 output for 0-nessNick Mathewson
This should make the intent more explicit. Probably needless, though.
2013-01-02Move curve25519 keypair type to src/common; give it functionsNick Mathewson
This patch moves curve25519_keypair_t from src/or/onion_ntor.h to src/common/crypto_curve25519.h, and adds new functions to generate, load, and store keypairs.
2013-01-02Refactor strong os-RNG into its own functionNick Mathewson
Previously, we only used the strong OS entropy source as part of seeding OpenSSL's RNG. But with curve25519, we'll have occasion to want to generate some keys using extremely-good entopy, as well as the means to do so. So let's! This patch refactors the OS-entropy wrapper into its own crypto_strongest_rand() function, and makes our new curve25519_secret_key_generate function try it as appropriate.
2013-01-02Add a wrapper around, and test and build support for, curve25519.Nick Mathewson
We want to use donna-c64 when we have a GCC with support for 64x64->uint128_t multiplying. If not, we want to use libnacl if we can, unless it's giving us the unsafe "ref" implementation. And if that isn't going to work, we'd like to use the portable-and-safe-but-slow 32-bit "donna" implementation. We might need more library searching for the correct libnacl, especially once the next libnacl release is out -- it's likely to have bunches of better curve25519 implementations. I also define a set of curve25519 wrapper functions, though it really shouldn't be necessary. We should eventually make the -donna*.c files get build with -fomit-frame-pointer, since that can make a difference.