summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-07-17 15:21:27 +0200
committerpennae <github@quasiparticle.net>2022-07-17 17:26:42 +0200
commit1ef9d67fb6979ea91812c4ea892f7ecc12b3170f (patch)
tree31e50439db01a88dc24a95692365823581ea87c7
parent2743fb077862f9228ca0b7d1b9056b4253cdcc70 (diff)
downloadminor-skulk-1ef9d67fb6979ea91812c4ea892f7ecc12b3170f.tar.gz
minor-skulk-1ef9d67fb6979ea91812c4ea892f7ecc12b3170f.tar.xz
minor-skulk-1ef9d67fb6979ea91812c4ea892f7ecc12b3170f.zip
remove Seal from crypto
the trait doesn't leave the module, so sealing doesn't do anything useful.
-rw-r--r--src/crypto.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/crypto.rs b/src/crypto.rs
index 2063c9b..58ab6d2 100644
--- a/src/crypto.rs
+++ b/src/crypto.rs
@@ -40,16 +40,7 @@ mod from_hkdf {
use hkdf::Hkdf;
use sha2::Sha256;
- // sealing lets us guarantee that SIZE is always correct,
- // which means that from_hkdf always receives correctly sized slices
- // and copies never fail
- mod private {
- pub trait Seal {}
- impl<const N: usize> Seal for [u8; N] {}
- impl<L: Seal, R: Seal> Seal for (L, R) {}
- }
-
- pub trait FromHkdf: private::Seal {
+ pub trait FromHkdf {
const SIZE: usize;
fn from_hkdf(bytes: &[u8]) -> Self;
}