23 Commits

Author SHA1 Message Date
Brian Smith
da23dc037e Use small Curve25519 for wasm32 & other non-{aarch64,x86_64}.
Enable `ring::agreement` for wasm32 targets using the small
implementation of Curve25519.

Use the small Curve25519 implementation of Curve25519 (and
P-256) for all targets except for Aarch64 and x86-64.

Besides being smaller, the small implementations are likely
more resistant to compiler-introduced side-channels, which
is especially important for the wasm32 virtual machine and
other targets that we don't QA as thoroughly as AAarch64
and x86-64.

Bring in the previously-removed definition of `fe_mul_llt`
from BoringSSL as of commit
8d71d244c0debac4079beeb02b5802fde59b94bd.
2023-10-14 16:49:57 -07:00
Tom Dryer
2afc921340 Allow accessing signature::UnparsedPublicKey bytes
Implement `AsRef<[u8]>` for `signature::UnparsedPublicKey`, making it
possible to access the bytes of the public key. For consistency, I did
the same for `agreement::UnparsedPublicKey`, although it already has a
`bytes` method. `agreement::PublicKey` already uses the `AsRef<[u8]>`
approach.

Also, add missing `Debug` implementation for
`signature::UnparsedPublicKey`.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2023-10-06 11:07:03 -07:00
Brian Smith
155231fb01 signature: Enable Ed25519 support for wasm32 targets.
Ed25519 was disabled for WebAssembly due to some unrelated issues with
getting the X25519 code working in WebAssembly. Temporarily remove the
`agreement` API when targetting WebAssembly to work around those issues
in a way that lets us enabled Ed25519.
2022-04-06 12:54:49 -07:00
Brian Smith
f2488d6118 Agreement: Stop requiring the KDF to return a Result.
Many (most?) KDFs are infallible, so optimize for that case. If the KDF
is fallible then the result will be `Ok(Err(_))` which is messy.

This eliminates the `error_value` parameter.
2021-02-04 19:06:25 -08:00
Brian Smith
b9d7d089d9 Remove #![forbid(warnings)]; reply on Clippy in CI/CD instead.
The newest Rust Nightly is getting stricter about `forbid(warnings)`
which breaks the build.

Use "deny" instead of "forbid". And only deny when running Clippy in
CI/CD, so that when hacking on *ring* we don't have to deal with
warnings right away; we now only have to deal with them when we're ready
to submit a change to be merged.
2020-12-03 17:40:33 -08:00
Brian Smith
d58e2dadde Agreement tests: Make clippy happy about an assertion. 2020-12-03 17:40:33 -08:00
Brian Smith
ded14f067e Agreement Tests: Remove unneeded lifetime annotations. 2020-11-11 16:46:41 -08:00
Brian Smith
898a93f632 Tests: Silence some Clippy warnings. 2020-11-11 16:46:41 -08:00
Brian Smith
bc2d01adfb Agreement tests: Address clippy::needless_return. 2020-11-11 16:46:41 -08:00
Brian Smith
f15828a7a6 Stop disabling legacy_directory_ownership to fix Rust 1.41 beta channel builds. 2019-12-23 18:41:07 -06:00
Brian Smith
fe1a947b59 0.16.7: & -> &dyn in agreement_tests.rs to fix beta/nightly build. 2019-08-11 16:08:00 -10:00
Brian Smith
2fe7ed15d4 Improve usability of ring::agreement.
Implement `Debug` and `algorithm()` accessors.

Add tests for traits.
2019-08-11 14:46:48 -10:00
Brian Smith
7071dda618 Replace use_heap feature with alloc and std features; use alloc crate. 2019-07-09 21:15:18 -10:00
Brian Smith
f0d4d21e85 Use stable rustfmt. 2019-04-10 09:33:38 -10:00
Brian Smith
888bdd506f Remove untrusted from the ring::agreement API. 2019-04-05 16:21:41 -10:00
Brian Smith
ab0726d0cd Embed test data into test executables.
Embed test data files into test executables so that file I/O isn't
necessary during tests. This allows the tests to run on platforms that
don't have file I/O. It also makes it easier to run the tests on a
separate (virtual) machine from the build machine since the test
automation no longer needs to keep track of the test files.
2019-02-02 13:21:02 -10:00
Brian Smith
be3f13aeef Better encapsulate ECC key parts. 2018-12-21 12:22:42 -10:00
Brian Smith
2843931bb7 Switch to Rust 2018 Edition.
Switch to Rust 2018 Edition. Fix up some build breakage for different
configurations that were found in the process of testing this,
particularly `--no-default-features`.
2018-12-08 21:39:17 -10:00
Brian Smith
6e98bf0568 Reformat tests/, except AEAD tests.
AEAD tests will be reformatted later.
2018-11-15 16:17:49 -10:00
Brian Smith
72f5e2ebf0 Avoid trying to disable removed fat_ptr_transmutes antifeature.
The antifeature was removed from rustc in 2014, according to a new warning,
so this was doing nothing.
2017-12-24 09:50:10 -10:00
Brian Smith
118c634c2e Be stricter with lints in tests/agreement_tests.rs. 2017-08-27 12:31:01 -10:00
Brian Smith
c035ea67e1 Move iterated X25519 test to tests/agreement_tests.rs. 2017-06-08 12:01:33 -10:00
Brian Smith
f95cf64e57 Move agreement functional tests to tests/agreement_tests.rs.
Also remove ring::agreement::EphemeralKeyPair::from_test_vector().
2017-06-08 12:01:26 -10:00