399 Commits

Author SHA1 Message Date
Brian Smith
c14c355f51 Use resolver v2. 2022-01-16 17:43:40 -08:00
Brian Smith
8d78cb2c01 wasm32: Add a wasm32_unknown_unknown_js feature to control use of web APIs.
Planning ahead for when WASI is to be supported, require the user to opt into
using web APIs for thw wasm32-unknown-unknown target with a new feature, since
wasm32-unknown-unknown could be used for either web or non-web environments.

Don't bother updating the tests to use this new flag, since the tests aren't
part of the "public API" of *ring*. When we add support for other WebAssembly
environments (e.g. WASI) we'll update the tests then.
2021-10-06 15:53:02 -07:00
Brian Smith
d97ae1fd08 wasm32: Make wasm32_c the default and only mode; remove the "wasm32_c" feature.
Always require a C compilare for wasm32, instead of trying to provide a subset
of the functionality.
2021-10-06 15:53:02 -07:00
Brian Smith
511740c29f RSA: Replace RsaSubjectPublicKey::{modulus,exponent} with rsa::Public::{Modulus,Exponent}::be_bytes().
This is a step towards removing the heap-allocated and usually-unnecessary
`public_key: RsaSubjectPublicKey` field. The new API allows the caller to
better control how it stores/allocates the component values. This also removes
a couple of infallible `unwrap()`s.

This is a step towards removing `io::Positive` from the public API.

This is a breaking API change.
2021-09-24 14:08:08 -07:00
Brian Smith
022f4dbe8e Bump libc version requirement. 2021-08-23 20:14:17 -07:00
Brian Smith
bf3e8582d6 Bump wasm-bindgen-test to 0.3.26. 2021-08-23 20:14:17 -07:00
Brian Smith
d77d152546 Bump web-sys to 0.3.51. 2021-08-23 20:14:17 -07:00
Brian Smith
e33675400a Bump once_cell to 1.8.0. 2021-08-23 20:14:17 -07:00
Brian Smith
9e6ea77bf1 Bump Criterion.rs version. 2021-08-23 20:14:17 -07:00
Jeremy Soller
dae1918124 Use /dev/urandom for SecureRandom on Redox 2021-08-16 12:54:43 -07:00
Brian Smith
ace62da913 Require cc-rs 1.0.69 or later to improve aarch64-pc-windows-msvc compatibility.
Alexander Ovchinnikov (@Alovchin91) wrote:
> [C]ould you please also upgrade cc to 1.0.69? This version contains fixes to
> find MSVC tools on Windows ARM.
2021-08-16 12:53:56 -07:00
Alexander Ovchinnikov
ceb5b90f6e Enable building and running on Windows ARM64
I agree to license my contributions to each file under the terms given at the top of each file I changed.

Co-authored-by: Marc-André Moreau <marcandre.moreau@gmail.com>
2021-08-16 12:28:42 -07:00
Brian Smith
539ac049a8 Upgrade spin to the latest version. 2021-08-15 15:30:54 -07:00
Brian Smith
188cc043f7 Use untrusted 0.9. 2021-07-13 15:54:42 -07:00
ComplexSpaces
b23e560b27 Port crypto-bench AEAD benchmarks to *ring*
I agree to license my contributions to each file under the terms given
at the top of each file I changed.

Add AEAD decryption benchmarks
2021-07-06 15:27:26 -07:00
Brian Smith
908eaf0322 Remove src/rsa/convert_nist_rsa_test_vectors.py from Cargo crate.
It isn't useful for it to be in the crate, as it isn't used in any part of the
build or tests.
2021-06-24 14:53:04 -07:00
Brian Smith
1ca07dd267 Cargo.toml: Use globs for *.rs and *_tests.txt so we don't have to list each one. 2021-06-24 14:53:04 -07:00
Brian Smith
1e18a1c292 RSA: Move verification::Key to public::Key.
Take a step towards having RSA keys support encryption/decryption
in addition to signing/verification.

No functional changes are intended.

Some documentation was moved around.
2021-06-24 12:58:14 -07:00
Joel Galenson
ae1e9dd64e Add missing test file to Cargo's includes.
This should allow tests to pass on the crates.io release.
2021-06-23 09:58:34 -07:00
Brian Smith
d32c304b3d Factor RsaPublicKeyComponents out of rsa::verification. 2021-06-03 11:33:11 -07:00
Brian Smith
7c9927e6b1 Cargo.toml: Clarify version number.
0.17.0-alpha.9 was released off the b/0.17.0-alpha.9 branch. Similarly for
0.17.0-alpha.10 on the b/0.17.0-alpha.10 branch.

Having the version number on the main branch say "0.17.0-alpha.9" or any
version number like that is confusing and misleading. We have to have a
version number, so use one that's clearer while we work on finishing
0.17.0.
2021-05-04 16:17:34 -07:00
Brian Smith
e898b00d53 Build: Derive FFI symbol prefix and FFI lib prefix from Cargo.toml "links".
Now "links" in Cargo.toml is the only thing that needs to be manually modified
when the prefix changes.

build.rs enforces that the package name and version are consistent with the
"links" field.
2021-05-03 16:28:56 -07:00
Brian Smith
badca90d14 Simplify assembly pre-generation mechanism.
Eliminate the extra Cargo.toml that was used just for this feature. It was
too error-prone to keep it in sync with the real Cargo.toml. Having one
Cargo.toml will allow us to reliably use the `CARGO_MANIFEST_LINKS` value
to keep the symbol prefix in sync with the `links` field in Cargo.toml in
the near future.
2021-05-03 13:36:20 -07:00
Brian Smith
7886603cee Use some variant of "ring core" instead of "GFp" as a prefix for everything.
"GFp_" isn't in the code at all anymore.
2021-05-02 22:09:07 -07:00
Brian Smith
384f7d056b Replace manual FFI symbol prefixing with automatic symbol prefixing.
Revert the names used in the BoringSSL C/asm code to the names used in
BoringSSL. This substantially reduces the diff between *ring* and
BoringSSL for these files.

Use a variant of BoringSSL's symbol prefixing machinery to semi-
automatically prefix FFI symbols with the `GFp_` prefix. The names aren't
all exactly the same as before, because previously we *replaced* a
symbol's original prefix with the `GFp_` prefix; now we're prepending
`GFp_`. In the future we'll use a different prefix entirely.

This paves the way for using different prefixes for each version so that
multiple versions of *ring* can be linked into an executable at once.
2021-05-02 22:09:07 -07:00
Brian Smith
2a6b7484dc Internals: Polyfill array_map. 2021-03-22 21:59:51 -07:00
Brian Smith
e8620224e6 AEAD: Move each key type into its own submodule.
Encapsulate each key type in its own module.
2021-02-24 20:15:26 -08:00
Brian Smith
64e9a5490a AEAD: Move LessSafeKey code into a submodule. 2021-02-24 20:15:26 -08:00
Brian Smith
c6d8f58ad0 Add a Rust ChaCha20 implementation.
See the comments in fallback.rs for more details on the origin.
2021-02-23 18:39:36 +00:00
Brian Smith
501fc4eeaa Replace *ring*'s P-256 arithmetic with BoringSSL's P-256 arithmetic.
Use Fiat Crypto for non-x86_64 platforms, like BoringSSL. Continue
using the nistz256 code on Windows, differently from BoringSSL.

Make *ring* more consistent with BoringSSL.
2021-02-10 12:20:26 -08:00
Brian Smith
275551e2db Separate Counter and Iv for AES-CTR & ChaCha20; clarify alignment.
Ensure we're always passing in u32-aligned values to `GFp_ChaCha20_ctr32`.

Get rid of the attempt to abstract away the difference between ChaCha20
and AES-CTR w.r.t. counters and IVs. The abstraction wasn't actually used
by any shared code. The AES-CTR (GCM) code does endian conversion in the
assembly so endian conversion cannot easily be deferred to later. For
ChaCha20, it makes more sense to do endian conversion at the time of
`Counter`/`Iv` construction. Despite the slight duplication of logic in
having two `Counter` types and two `Iv` types, this is actually a net
reduction of code. If we ever have a third implementation of these types
we can apply the Rule of Three to factor out the commonality.
2021-02-09 08:53:09 -08:00
Brian Smith
5186d53e6b Remove reference to removed module polyfill::convert. 2021-02-09 07:24:26 -08:00
Brian Smith
27a045642a Dependencies: Require latest libc. 2021-02-01 16:19:08 -08:00
Brian Smith
62d90f7d50 Dependencies: Require latest cc-rs. 2021-02-01 16:19:08 -08:00
Brian Smith
9cc0d45f4d 0.16.20. 2021-02-01 13:14:08 -08:00
Brian Smith
a0017634b2 Merge branch 'main' into b/merge-boringssl-integrated-chacha-x86_64 2021-01-26 14:29:23 -08:00
Vlad Krasnov
34424d829d Enable the integrated assembly x86-64 ChaCha20-Poly1305 implementation from BoringSSL 2021-01-26 10:12:14 -08:00
Brian Smith
628acbeff5 Document all features in docs.rs. 2021-01-07 15:00:13 -08:00
Brian Smith
8a49b70789 0.16.19 2020-12-01 16:40:40 -08:00
Michael Neumann
432909280d Fix compilation on DragonFly
This superseeds issue #966.

Tested-on: DragonFly 5.8.1
2020-11-30 11:06:34 -08:00
Brian Smith
b7af159154 0.16.18. 2020-11-26 11:55:14 -08:00
Brian Smith
5efd675f51 Fix BSD --no-default-features build.
`once_cell` is a required, not optional, dependency, on these platforms.
2020-11-24 01:05:14 -08:00
Brian Smith
6c0346954b 0.16.17. 2020-11-23 15:22:47 -08:00
Brian Smith
8888f95e21 Require libc 0.2.80 or later.
0.2.80 is the version I used to test *ring* 0.16.16.

Rumors are that libc 0.2.73 had changes to support aarch64-apple-darwin.
2020-11-18 11:35:31 -08:00
Brian Smith
1ea08f2646 Require once_cell 1.5.2 or later.
This is the version I used to test *ring* 0.16.16.
2020-11-18 11:35:31 -08:00
Brian Smith
3cb597782b Update the cc dependency to 1.0.62.
Apparently 1.0.60 has changes specifically to support aarch64-apple-darwin.
2020-11-18 11:35:31 -08:00
Brian Smith
4ad0b814ef 0.16.16. 2020-11-18 01:18:46 -08:00
Brian Smith
9d0f731ca9 0.16.16-alpha.1 2020-11-18 01:18:46 -08:00
Brian Smith
f19c4f626b Remove dead crypto/fipsmodule/modes/internal.h. 2020-11-17 23:55:28 -08:00
Brian Smith
49065e846e cpu.rs: Clarify conditions under which runtime CPU feature detection is done.
Clarify that, on ARM/Aarch64, runtime feature detection is done only for Linux (including
Android) and Fuchsia. Reduce some of the duplication between Linux and Fuchsia; probably we should
do more later.
2020-11-17 16:46:33 -08:00