Age | Commit message (Collapse) | Author |
|
- ed25519-dalek requires rand:0.7 types, so make sure they are used,
and not the ones form rand:0.8.
|
|
- Adapt to the new API:
- Gen is now a struct, not a Trait, and replaces StdThreadGen.
- The rand re-export has been removed. As a consequence, we need
our own function to generate an arbitrary value from a range.
|
|
- If the round_up clampes the value to u32::MAX, the precision does
not apply.
- Closes #784.
|
|
- Replace manual implementations of Default where the derive(Default)
is identical.
- Suggested by clippy,
https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impl
|
|
|
|
- Rustc 1.57.0 complains that the returned Protected value is never
used.
let _ = Protected::from(Sy);
Does the trick while keeping the original intention.
|
|
- Clippy lint: clippy::identity_op.
|
|
|
|
- Found with clippy::redundant_static_lifetimes.
|
|
- Found with clippy::iter_nth_zero.
|
|
- It's clearer to cast the error with .into() insead of ?.
- Found by clippy::try_err.
|
|
- Found by clippy::needless_borrow.
|
|
- The RSA parameters have single character names, this is fine.
- Clippy lint: clippy::many_single_char_names.
|
|
- Found with clippy::useless_conversion.
|
|
- A non-standard byte-grouping can be quite confusing.
- Found with the help of
https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings
|
|
- Found by clippy::print_literal.
|
|
- Replace
let bar = std::mem::replace(&foo, Default::Default());
with
let bar = std::mem::take(&foo);
The new version seems a little clearer.
- Found by clippy:
https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default
|
|
- Found by clippy::clone_on_copy lint.
|
|
- Continuation of e6a335b93a10620bcb7cbfa32e232949758f0c99.
|
|
- The vec![] macro is more performant and often easier to read than
multiple push calls.
- Allow push to a Vec straight after creation in tests. Performance
is not that great of an issue in tests, and the fix would impact
legibility.
- Found by clippy::vec_init_then_push.
|
|
- Instead of creating a default struct and immediately afterwards
changing a field, use this type of initialization syntax:
Struct { field: value, ..Default::default() }.
- Suggested by clippy::field_reassign_with_default.
|
|
- Found by clippy::redundant_slicing.
|
|
- Improve clarity by replacing
match Some(0) {
Some(x) => Some(x + 1),
None => None,
};
with Some(0).map(|x| x + 1);
|
|
- Use range syntac instad of manual comparisons. This is arguably
better to read.
- Found by clippy::manual_range_contains.
|
|
- In CamelCase, acronyms count as one word. Apply this rule where
API and lalrpop are not impacted.
- Found by clippy::upper_case_acronyms.
|
|
- Replace .filter_map(|x| x) with .flatten(), which is easier to read.
- Found with clippy: filter_map_identity.
|
|
- Fixed with the help of clippy::needless_borrow.
|
|
- It's confusing that the variants of a Component are all Bundles,
however there are Components, Bundles and ComponentBundles in the
codebase, so the confusion stems from elsewhere.
- Found with clippy::enum_variant_names.
|
|
|
|
- Rust 1.56.0 is affected by CVE-2021-42574, which is addressed in
1.56.1.
|
|
|
|
|
|
|
|
KeyHandle::is_invalid
|
|
- Fixes #570.
|
|
- This is used by the Rust Crypto crates.
|
|
|
|
- Fixes #769.
|
|
|
|
|
|
- With this patch, Sequoia's armor encoding and decoding performance
roughly matches GnuPG's.
- Fixes #772.
|
|
|
|
|
|
- Instead of encrypting and emitting ciphertext block-wise, encrypt
all whole blocks at once and emit the resulting ciphertext. This
saves invocations of the cipher (which may traverse language
boundaries), and reduces the overhead later in the writer stack by
writing larger chunks.
|
|
- When we stream packet bodies, we hash their contents so that we
can compare them later on, even if we no longer have the data.
Previously, we used the fasted hash from the SHA2 family, either
SHA256 or SHA512 depending on the architecture.
- That, however, turned out to be a major performance problem. When
decrypting a non-compressed, binary file on amd64, we spent
roughly a third of the time just to compute the hash.
- Using the non-cryptographic hash function XXH3, we can greatly
improve the performance. On my system, it is 30x as fast as SHA3,
and reduces the overhead of computing the body hash considerably:
% time ./sq-sha512 decrypt --recipient-key juliet.key.pgp 3g-for-juliet.binary.pgp >/dev/null 2>&1
13.931 total
% time ./sq-xxh3 decrypt --recipient-key juliet.key.pgp 3g-for-juliet.binary.pgp >/dev/null 2>&1
9.264 total
- See #771.
|
|
- Previously, for a read of X bytes, we'd request X + buffer_size
from the underlying buffered reader, then satisfy the read
request, after which we'd request the next X + buffer_size bytes
for the next read. This requires the underlying reader to copy
buffer_size bytes for each read. In a typical scenario, we'd copy
25 megabytes (the default buffer size) for every 8 kilobytes
read (std::io::copy's default buffer size). This incurs a linear
cost with a very high factor.
- Improve this by requesting 2 * buffer_size, then satisfying the
reads from the first half of that buffer, only consuming the first
half once we have exhausted the first half. Then, we'd request
the next 2 * buffer_size, at which point the underlying buffered
reader has to copy the data to a new buffer.
- See #771.
|
|
|
|
- Previously, when the read exceeded the buffered data, we tried to
fill the buffer even if we reached the last chunk. Then, we would
allocate a new buffer and copy the data over, only to later
realize that we reached the last chunk and the current chunk is
exhausted.
|
|
- If the opportunity arises, i.e. we have a buffer but previous
reads exhausted it, we can drop the buffer and serve the requests
from the next buffered reader without copying them first.
|
|
- Previously, we spent a considerable amount of time callocing new
buffers.
|