Brian Smith
f0cad0ad07
Remove BitLength
, PublicModulus
, PublicExponent
from the public API.
...
Replace `rsa::PublicKey::{n,e}()` with an implementation of `From<&PublicKey>`
for `PublicKeyComponents`. This will fit better with the plans to do the same
for other public key cryptosystem types. This also allows us to remove
`BitLength` from the public API and also to remove some `Debug` implementations.
2021-09-29 13:01:25 -07:00
Brian Smith
1879c0555d
RSA: Flatten API by removing public
and keypair
submodules.
...
When looking at how this would generlaize to the other public key
cryptosystems (ECDSA, ED25519, etc.), I think having fewer submodules
involved makes more sense.
2021-09-29 13:01:25 -07:00
Brian Smith
f172986113
RSA: Replace RsaSubjectPublicKey
with rsa::public::Key
.
2021-09-27 13:09:01 -07:00
Brian Smith
fed775d2c3
RSA: Make rsa::public::Key
clonable.
2021-09-24 17:04:16 -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
4a3a17fd21
RSA: Split PKCS#8-specific logic out from general RSA private key construction logic.
...
Prepare for the introduction of a public API for constructing RSA key pairs from
components, and for the introduction of RSA encryption APIs.
2021-09-23 10:44:03 -07:00
Brian Smith
617b09baa6
RSA: Deprecate and replace RsaKeyPair::public_modulus_len
.
2021-09-23 10:43:13 -07:00
Brian Smith
8ac90f4c3e
RSA: Move test_signature_rsa_pkcs1_sign_output_buffer_len
to tests/.
...
It's only using the public API so it should be an integration test.
2021-09-22 13:55:57 -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
1ab2d161fc
Merge BoringSSL d4f877e: Reference the newer ChaCha20-Poly1305 RFC.
2021-08-17 18:59:16 -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
2accae1e7a
ECDSA: Add RNG as an input parameter to EcdsaKeyPair::from_pkcs8
.
...
Resolve an old TODO now that we can make breaking API changes.
2021-05-04 15:17:54 -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
9385c6d014
Use Self
more.
2021-03-22 16:11:07 -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
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
d93b954901
Remove definitions of deprecated Error::description()
/cause()
.
2021-02-04 17:07:41 -08:00
Brian Smith
27200d4596
Ed25519 malleability tests: Add control test case.
2020-12-17 20:55:22 -08:00
Brian Smith
01a2e429ae
Merge BoringSSL 3094902: Get closer to Ed25519 boundary conditions.
2020-12-17 20:55:22 -08:00
Brian Smith
a25271beb0
Ed25519 malleability test: Add control case.
2020-12-17 20:55:22 -08:00
Brian Smith
6e3c8a331e
Ed25519 Tests: Import Ed25519 malleability test case from BoringSSL.
2020-12-17 20:55:22 -08:00
Brian Smith
47dfb4814f
Ed25519 Tests: Refactor tests to prepare for more complete testing of invalid signatures.
2020-12-17 20:55:22 -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
1cfafdcab7
ECDSA tests: Tell clippy to allow an intetionally redundant clone.
2020-12-03 17:40:33 -08:00
Brian Smith
d57c8d56a2
Signature tests: Remove redundant clones found by Clippy.
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
a2fec64d10
AEAD tests: Use Vec::resize()
to make Clippy happy.
2020-12-03 17:40:33 -08:00
Brian Smith
4be97e91e2
Revert "Remove definitions of deprecated Error::description()
..."
...
This reverts commit f06811a150fcded1555911678bbca6dcb5440cda because it changed the
pulic API in a non-backward-compatible way.
2020-11-18 16:20:48 -08:00
Brian Smith
cb45bf0ddc
Constant-time tests: Take Clippy's op_ref
advice.
2020-11-11 16:46:41 -08:00
Brian Smith
8015140fa6
Constant-time tests: Replace clone with copy.
2020-11-11 16:46:41 -08:00
Brian Smith
524c37bace
ECDSA/ED25519 tests: Improve Copy/Clone tests based on Clippy's feedback.
2020-11-11 16:46:41 -08:00
Brian Smith
bd7f4ca82d
AEAD tests: Take Clippy's advice regarding op_ref
.
2020-11-11 16:46:41 -08:00
Brian Smith
aa7a962f9f
Constant-time tests: Remove useless clone.
2020-11-11 16:46:41 -08:00
Brian Smith
3de43630d9
ED25519 tests: Remove useless static lifetime annotation.
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
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
f06811a150
Remove definitions of deprecated Error::description()
and
...
`Error::cause()`.
2020-06-19 11:50:49 -05:00
Brian Smith
432670f135
Implement ECDSA nonce hardening to pretect against bad PRNG.
2020-05-29 21:43:35 -05:00