373 Commits

Author SHA1 Message Date
Brian Smith
3f5739e098 Factor out ring::input into the untrusted crate. 2016-06-05 12:31:17 -10:00
Brian Smith
6aab77f178 Fix doctests by adding back rustc-serialize dev-dependency. 2016-05-31 11:15:26 -10:00
Brian Smith
1f020f30a3 Add and remove some comments about the build configuration. 2016-05-29 18:26:12 -10:00
Brian Smith
09c976cbed Enable debug symbols for release builds.
Now optimized-with-debug-symbols builds work correctly on -msvc,
as of Rust 1.9 and maybe earlier.
2016-05-28 09:30:48 -10:00
Brian Smith
7749647a18 Stop dev-dependency on rustc_serialize for tests.
`cargo test -p ring` will build and run the tests, but apparently without
installing *ring*'s dev-dependencies. Thus, we need to eliminate the
dev-dependencies to make that work.
2016-05-27 01:13:50 -10:00
Brian Smith
7e97b263f7 Expose X25519 key agreement as ring::agreement::X25519. 2016-05-23 11:27:33 -10:00
Brian Smith
a281f58027 Make SecureRandom sharable between threads; share /dev/urandom handle.
Because `SecureRandom::fill` took `&mut self`, it wasn't possible to
have multiple *usable* references to a `SecureRandom`. Change it so
that `fill` takes non-mutable `&self` so that multi-thread sharing
works.
2016-05-19 16:47:55 -10:00
Brian Smith
0462247918 Use getrandom on Linux when available. 2016-05-19 08:58:02 -10:00
Brian Smith
5784be658d Don't log test vectors during tests by default.
The test library, by default, buffers all the output until the test
completes. This can use up a lot of memory--too much memory for some
embedded targets--so make it an opt-in thing.
2016-04-15 22:46:04 -10:00
Brian Smith
542b03b5d3 Tempoarily disable doctests to fix cross-compilation. 2016-01-30 17:29:52 -10:00
Brian Smith
8aa601e87a Switch back to using an official release of the num crate.
The patch in the private copy we were using was added in the 0.1.30
release, so our private copy is no longer needed.
2016-01-08 17:57:49 -10:00
Brian Smith
cefad3d8ba Add the no_heap feature to disable heap-using functionality.
The RSA doctest had to be disabled temporarily until
https://github.com/rust-lang/rust/pull/30372 makes it to the stable
Rust channel (Rust 1.8).

Some of the tests and the test framework in |ring::file_test| are still
using the heap. This will be fixed separately.
2016-01-07 19:02:29 -10:00
Brian Smith
2750be38e4 Remove dependency on the rand crate and its many dependencies.
This dependency was through `num`, and it is only a dev-dependency, but
it looks scary, it makes the build slower, and it makes *ring* more
prone to breakage.
2016-01-07 17:08:37 -10:00
Brian Smith
18a41e5523 Remove unused dependency on the time crate.
This dependency was added in 2e887d11 when examples/fastpkbdf2_bench
was added. However, the benchmarking stuff was moved to
https://github.com/briansmith/crypto-bench a long time ago.
2016-01-07 15:34:04 -10:00
Brian Smith
dd33195126 Update num crate dependency, reduce required features to bigint. 2016-01-05 15:58:20 -10:00
Brian Smith
14e0bc8a80 Construct |EC_GROUP|s at build time instead of at runtime.
Avoid the overhead of constructing |EC_GROUP| instances at runtime,
including in particular the |BN_MONT_CTX| and Montgomery-encoded
parts. This allows us to identify curves with |EC_GROUP*| again
instead of identifying them by pointers to functions that allocate
an |EC_GROUP|.
2015-11-28 12:11:00 -10:00
Brian Smith
6402548afd Make |cargo test| without |release| use the "dev" profile.
Otherwise, there's no way to run the tests in debug mode. The release
mode tests can be run with `cargo test --release`.
2015-11-07 17:15:20 -10:00
Brian Smith
cfe6cc7951 Make the bench, release, and test profile configs match.
Otherwise, we're not testing or measuring the release configuration.
2015-10-26 18:32:29 -10:00
Brian Smith
ca92130f39 Make |time| and |rustc-serialize| dev-dependencies.
This makes it clearer that these are not actually used in the library
proper, but just in the testing code.
2015-10-25 12:33:15 -10:00
Brian Smith
377f611859 Add |ring::c| to define C types, removing libc crate dependency.
The libc crate is full of badness and we need almost none of it. We
don't want to use the C standard library at all from Rust and we
definitely don't want to force users of *ring* to have to link to the
C standard library. (The C code inherited from BoringSSL depends on the
C standard library, but we've removed a lot of those dependencies and
we'll continue to do so.)

Also the definition of |libc::size_t| as an alias for a type that isn't
implicitly convertable to |usize| was forcing us to do a lot of
unnecessary casting, which is inherently danger-prone and thus
dangerous.
2015-10-22 19:58:04 -10:00
Brian Smith
2e887d11cb Add examples/fastpkbdf2_bench.
This allows for performance comparisons between *ring* and other
implementations. I think the benchmark is too noisy. Unfortunately,
|cargo bench| doesn't work well for measuring this because
|cargo bench| insists on doing a huge number of iterations, which means
that each run takes too long in a edit-compile-measure cycle.
2015-10-12 10:31:56 -10:00
Brian Smith
0b23f8cf9e Rename the C library to "ring-core", rename Rust crate to "ring".
The Rust crate can't be named "ring" if it links to a C library called
"ring".
2015-08-26 21:18:41 -07:00
Brian Smith
20b97a69a9 Rust: Add API for calculating digests (SHA-256, etc.). 2015-08-26 21:18:37 -07:00