54 Commits

Author SHA1 Message Date
Brian Smith
1c476cd20c AEAD tests: Address wasm32-wasi build warning & clarify use. 2023-10-14 16:50:18 -07:00
JanKaul
2019d8482f Add support for wasm32-wasi.
[The files changed in this commit were part of the original PR. The
original PR also changed other files, but those changes were removed.]
2023-10-14 16:50:18 -07:00
Brian Smith
dc25ad9022 2021 Edition: Remove now-redundant imports. 2022-10-20 23:03:50 -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
ComplexSpaces
2896a014de Add open_in_place_separate_tag API to LessSafeKey
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2021-09-16 13:24:26 -07:00
Brian Smith
be3443f5c6 Appease Clippy 1.54. 2021-08-02 21:46:17 -07:00
Jack O'Connor
fcbeeabb8b implement Clone for LessSafeKey
OpeningKey and SealingKey intentionally avoid implementing Clone,
because they're attached to a fixed nonce sequence that should be
unique. LessSafeKey isn't attached to a nonce sequence, though, and
making it Clone lets callers avoid repeating key setup work.
2021-05-04 15:20:02 -07:00
Brian Smith
2b4d07c177 AEAD tests: Fix warning for non-wasm32 targets. 2021-04-29 16:07:38 -07:00
Brian Smith
9accd874cb WebAssembly: Reduce boilerplate for running tests in WebAssembly.
Skip `digest_tests.rs` since it doesn't get built by wasm-bindgen
correctly when we do this.
2021-04-20 18:22:20 -07:00
Brian Smith
e48c324695 AEAD tests: Add tests for seal_in_place_separate_tag(). 2021-02-24 05:14:07 +00:00
Brian Smith
29b5727bc1 AEAD test: Add tests for open_in_place(). 2021-02-24 05:14:07 +00:00
Brian Smith
e49a8da4e5 AEAD tests: Further refactor tests to reduce repetition. 2021-02-24 05:14:07 +00:00
Brian Smith
16e1b77f3b AEAD tests: Split test_aead into multiple functions. 2021-02-24 05:14:07 +00:00
Brian Smith
ffa5a9f88f AEAD tests: Refactor to reduce boilerplate. 2021-02-24 05:14:07 +00:00
Brian Smith
0664f59420 AEAD tests: Remove unnecessary prefixes in some test functions. 2021-02-24 05:14:07 +00:00
Brian Smith
930b97b0c9 AEAD: Make Aad implement common traits if the underlying type does. 2021-02-24 00:49:15 +00: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
d2ff5d1b3e Tests: Remove unneeded use of Result. 2021-02-11 11:20:16 -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
a2fec64d10 AEAD tests: Use Vec::resize() to make Clippy happy. 2020-12-03 17:40:33 -08:00
Brian Smith
bd7f4ca82d AEAD tests: Take Clippy's advice regarding op_ref. 2020-11-11 16:46:41 -08:00
Brian Smith
5fe025b16e AEAD tests: Remove useless let () =. 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
0d5ab53e50 Simplify wasm32 test conditional uses. 2020-05-28 11:12:37 -05:00
Brian Smith
0c5f61b14f Merge BoringSSL c556d87: Add aes_nohw.c fallback AES implementation.
Add the BoringSSL aes_nohw implementation with minimal changes needed to
build. Enable the AES-GCM AEAD tests for wasm32 targets gated on the "wasm_c"
feature.
2020-05-28 10:51:03 -05: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
7adacd3070 Revert "Add support for random nonce generation to ring::aead."
This reverts commit 88d5aa7fd072d50be716abae4339be8463d665bb. It was a breaking change
in 0.16.8, which wasn't intended. Defaulting the parameter worked for many projects but
apparently not `biscuit` and some others.
2019-08-30 05:46:15 -10:00
Brian Smith
88d5aa7fd0 Add support for random nonce generation to ring::aead. 2019-08-30 05:39:37 -10:00
Brian Smith
20582aa39a Improve labeling in Debug implementation for LessSafeKey. 2019-08-11 18:10:31 -10:00
Brian Smith
524c6af2dc Add seal_in_place_separate_tag and `seal_in_place_append_tag. 2019-07-23 10:25:56 -10:00
Brian Smith
845a0e8b8e Simplify bounds checking in open_within().
I'm not sure we actually need the full generality of `RangeBounds`.
Generalizing this to `RangeBounds` later should be a source-compatible
change if/when we find it useful to do so. Until then, avoid supporting
untested kinds of bounds.
2019-07-17 19:26:14 -10:00
Brian Smith
76f1f76c66 Rename open_in_place to open_overlapping; add new open_in_place. 2019-07-17 19:25:38 -10:00
Brian Smith
ce4953d846 Make aead::open_in_place easier to understand. 2019-07-17 19:25:38 -10:00
Brian Smith
185da62457 Make the aead::seal_in_place API easier to understand. 2019-07-17 19:25:38 -10:00
Brian Smith
8af770d0d3 Remove obsolete TODO in aead_test.rs.
The comment no longer applies since the API was changed to prevent this
type of failure using the type system.
2019-07-17 19:25:38 -10:00
Brian Smith
c23d537847 Restore the OpeningKey and SealingKey naming.
Experiments with the `Role` pattern indicate that it might not work as
well as initially hoped. Replace it with the pattern more common in Rust.
2019-07-13 14:50:42 -10:00
Brian Smith
38462247ac Add LessSafeKey to ring::aead. 2019-07-13 14:50:42 -10:00
Brian Smith
c24f737dfa Refactor AEAD tests in preparation for extending the AEAD API. 2019-07-13 14:50:42 -10:00
Brian Smith
7bc1661fe9 Simplify aead::Key tests. 2019-07-13 14:50:42 -10:00
Brian Smith
c3d13e8851 Refactor AEAD key management. 2019-07-07 16:47:48 -10:00
Brian Smith
f0d4d21e85 Use stable rustfmt. 2019-04-10 09:33:38 -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
abbb616b57 Implement Debug for OpeningKey and SealingKey. 2019-01-23 16:40:16 -10:00
Brian Smith
5a0b6b5dec Add type-safe Aad wrapper for AEAD operations.
Reduce the possibility of confusing the AAD parameter with the
ciphertext/plaintext parameter.
2018-12-29 14:37:21 -10:00
Brian Smith
c8b76df6e5 Use Nonce as the type of the nonce input in AEAD. 2018-12-14 11:39:34 -10:00
Brian Smith
e79ab7b532 Factor out invariant test in AEAD test. 2018-12-14 11:39:34 -10:00
Brian Smith
ce77943017 Add a TryFrom polyfill and use it for slice -> array conversions. 2018-12-10 08:56:33 -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
86f6e7722d Add basic tests for chacha20_poly1305_openssh. 2018-12-08 13:10:25 -10:00
Brian Smith
cb05b24123 cargo +nightly fmt.
This reformats tests/aead_tests.rs, which was accidentally omited in
the last reformatting.
2018-11-27 14:34:54 -10:00