Closed cosmicexplorer closed 1 year ago
These aren't pub
for a reason: if someone wants to use these operations, they should get them directly from the RustCrypto crates. These are pretty much just convenience wrappers because of how they're used within the protocol. (The hardcoded "first ten bytes as a MAC" is something that a generalized library probably wouldn't hardcode.)
I think you're right about EncryptionError, though. Someone has to check that these keys are the right length, but it can happen a level up. And then I think DecryptionError collapses down to a struct instead of a one-case enum (not that it matters so much for an implementation detail).
These are pretty much just convenience wrappers because of how they're used within the protocol.
Ok, so in light of this I've changed it to pub(crate) mod crypto;
in lib.rs
, removed the doctests, and re-focused this PR on just removing unnecessary Result
s by enforcing fixed-size slices where possible.
However, on top of that, I've also kept in:
cbc
and ctr
module organization,Rng::gen()
(vs the existing test cases which only check a single literal hex key).I can revert any of that as desired.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to inactivity.
Broken out from #287.
ctr
andcbc
submodules.pub const
sizes for array lengths.EncryptionError
and one case ofDecryptionError
.aes_256_*
andaes_256_ctr_hmac_*
for consistency.TODO