-
Notifications
You must be signed in to change notification settings - Fork 182
Description
In #260 it was pointed out that PaddingScheme isn't object safe.
I think the purpose of these traits is to provide runtime dynamism around key usages, which makes the lack of object safety a bit problematic.
Especially with #259 complementing the existing signature-related SigningKey/VerifyingKey types with nice monomorphic purpose-dedicated encryption-related counterparts, that would make for a nice split between those providing a performance-oriented, type-safe monomorphic API, and PaddingScheme/SignatureScheme could evolve to focus on runtime dynamism.
Making that work would involve quite a bit of refactoring, getting rid of the generic parameters on the methods and replacing them with dyn Trait, namely for the PrivateKey, PublicKey, and CryptoRngCore traits. This would in turn require finding some way to make the PrivateKey and PublicKey traits object safe. At that point, we might consider trying to recombine the four traits (PaddingScheme, SignatureScheme, PublicKey, PrivateKey) somehow.