@@ -12,9 +12,10 @@ pub use crypto_common::{Generate, KeyInit, KeySizeUser, typenum::consts};
1212
1313use rand_core:: TryCryptoRng ;
1414
15- /// A value that can be encapsulated to. Often, this will just be a public key. However, it can
16- /// also be a bundle of public keys, or it can include a sender's private key for authenticated
17- /// encapsulation.
15+ /// Encapsulator for shared secrets.
16+ ///
17+ /// Often, this will just be a public key. However, it can also be a bundle of public keys, or it
18+ /// can include a sender's private key for authenticated encapsulation.
1819pub trait Encapsulate < EK , SS > {
1920 /// Encapsulation error
2021 type Error : core:: error:: Error ;
@@ -32,10 +33,13 @@ pub trait Encapsulate<EK, SS> {
3233 }
3334}
3435
35- /// A value that can be used to decapsulate an encapsulated key .
36+ /// Decapsulator for an encapsulated keys, with an associated encapsulator .
3637///
3738/// Often, this will just be a secret key. But, as with [`Encapsulate`], it can be a bundle
3839/// of secret keys, or it can include a sender's private key for authenticated encapsulation.
40+ ///
41+ /// When possible (i.e. for software / non-HSM implementations) types which impl this trait should
42+ /// also impl the [`Generate`] trait to support key generation.
3943pub trait Decapsulate < EK , SS > {
4044 /// Encapsulator which corresponds to this decapsulator.
4145 type Encapsulator : Encapsulate < EK , SS > ;
0 commit comments