396 Commits

Author SHA1 Message Date
Brian Smith
acbf75b912 Remove AES key wrap tests & cipher_test.txt.
The AES key wrap code is gone and so is the stuff that
cipher_test.txt tested.
2016-10-01 16:39:28 -10:00
Brian Smith
8f144603a9 Bump version number for backward-incompatible API change. 2016-09-12 11:42:01 -10:00
Dirkjan Ochtman
1fe852c10c 0.4.3: Allow unused_unsafe (until Rust 1.13 goes stable).
See changes in 8b7bb0cf6b649870bdf3150a3122e6ebe2962d24 for more info.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-09-11 10:23:50 -10:00
Brian Smith
8b7bb0cf6b 0.4.2: Fix build breakaged caused by Rust language change.
Rust Nightly now doesn't allow using an extern "C" static value unless
the reference is wrapped in `unsafe { }`, so do that.
2016-09-11 09:18:05 -10:00
Brian Smith
5778edbb5a 0.4.1 release. 2016-09-10 22:26:48 -10:00
Brian Smith
5b75fb123f Refactor RSA signing API to allow concurrent use of RSAKeyPair. 2016-08-27 10:50:49 -10:00
Brian Smith
5212701f46 Fix build breakage with Rust Nightly.
`drop_with_repr_extern` was removed when Drop flags were removed.
2016-08-26 23:15:24 -10:00
Brian Smith
e10b057679 Rust 1.11.0 or later is required; bump leftmost version number.
Rust 1.11.0 is required since some tests are using the form of
`assert!` that takes a custom error message, which is new in Rust
1.11.0.

Also fix includes in Cargo.toml. Also remove pregenerated/*, which
don't need to be in version control, but which can't be in .gitignore
(if they are, then `cargo package` and `cargo publish` don't work).
2016-08-24 00:38:29 -10:00
Brian Smith
68ad8a4f47 Improve crates.io description. 2016-08-15 15:50:02 -10:00
Brian Smith
8fcfeb315e Windows: Copy pregenerated asm lib to lib dir.
Cargo/rustc wasn't resolving "pregenerated" to an absolute path, so
while the previous scheme for finding the pregenerated libraries worked
for "sh mk/package.sh", it didn't work when building other libraries,
when the current working directory isn't the *ring* source directory.
2016-08-15 15:24:09 -10:00
Brian Smith
d59b70cec3 Windows: Don't require msbuild.exe to be in %PATH%. 2016-08-15 13:27:43 -10:00
Brian Smith
caa4df6e68 Prepare for publishing on crates.io. 2016-08-15 12:38:08 -10:00
Brian Smith
086963a21a Add documentation links. 2016-08-12 10:31:06 -10:00
Brian Smith
ac848e11c5 Use ring::error::Unspecified instead of () as the error type.
This may help users of *ring* map *ring* errors into their own error
types.
2016-08-11 09:09:22 -10:00
Brian Smith
5eecb9d677 Refactor dev/urandom fallback.
Make the fallback to dev/urandom a default feature, renaming it to have
the right sense. Make the dependency on lazy_static a Unix-only
dependency in Cargo.toml.
2016-07-28 16:46:16 -10:00
Brian Smith
d8c25bd7ff Remove the dependency on rustc_serialize. 2016-07-03 10:42:22 -10:00
Brian Smith
cf6dfad269 Remove the dependency on the num crate.
Now we don't have to trust that `num` is doing the math correctly. The
code generator is going away anyway. It's a good idea in theory but in
practice it wasn't worth its complexity.
2016-07-03 10:38:08 -10:00
Brian Smith
abfb6c9470 Require the rsa_signing feature for RSA signing. 2016-07-03 08:35:25 -10:00
Brian Smith
04c6cbf47d Depend on untrusted 0.2 from crates.io instead of from GitHub. 2016-07-02 17:09:10 -10:00
Brian Smith
4d5539d21d Add benchmarks for inversion mod n. 2016-06-28 20:03:52 -10:00
Alex Elsayed
8c8f4e1ff8 Change "no_heap" feature to "use_heap"; enable by default.
Cargo features are additive - Cargo presumes that it is safe to
enable a feature if _any_ dependent requires it, and that doing
so will not break crates that do not require it. As a result,
features that reduce the API surface - as no_heap did - violate
Cargo's invariants and can cause spooky failures at a distance.

Converting to a use_heap feature that enables APIs that may
allocate, and enabling it by default, preserves the current
behavior for users who simply depend on *ring* while better
fitting in to the Cargo ecosystem.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-06-19 18:54:32 -10:00
Brian Smith
eb761c1f30 Disable debug info in release builds to work around rustc bug. 2016-06-06 13:36:08 -10:00
Brian Smith
77450031a1 Enable doctests again.
It seems doctests are disabled when cross-compiling as of
https://github.com/rust-lang/cargo/pull/2485. Thus, we don't need this
workaround any more.
2016-06-06 12:50:13 -10:00
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