traits
traits copied to clipboard
Simplify KEM API
This is neat. So per our conversation in https://github.com/RustCrypto/traits/issues/1508, I simplified everything down to two traits which are highly generic. Some benefits:
- Way clearer what's going on
- No need to make our own
SharedSecrettype, or any type for that matter - Removed need for
stdfeature - Removed need for
generic_arrayat all (now we don't need to migrate to hybrid-array at this level) - You can still do authenticated encap/decap! All you need is to make you
Encapsulatestruct have an identity privkey, and yourDecapsulatestruct have an identity pubkey. The X3DH example intests/shows this isn't hard.
One small nit, because I know we've talked about it before: what's the now preferred way to do RNGs? It was between mut rng: impl CryptoRngCore or rng: &mut impl CryptoRngCore + ?Sized.
cc @bifurcation