Skip to content

Commit 54b5144

Browse files
committed
Have Decapsulator::encapsulator borrow
Adds a `Clone` bound to obtain an owned result
1 parent f992c56 commit 54b5144

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kem/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ pub trait Encapsulate: Kem + TryKeyInit + KeyExport {
6868
pub trait Decapsulator: Kem {
6969
/// Encapsulator which corresponds to this decapsulator.
7070
type Encapsulator: Encapsulate
71+
+ Clone
7172
+ Kem<CiphertextSize = Self::CiphertextSize, SharedSecretSize = Self::SharedSecretSize>;
7273

7374
/// Retrieve the encapsulator associated with this decapsulator.
74-
fn encapsulator(&self) -> Self::Encapsulator;
75+
fn encapsulator(&self) -> &Self::Encapsulator;
7576
}
7677

7778
/// Decapsulator for encapsulated keys, with an associated `Encapsulator` bounded by the

0 commit comments

Comments
 (0)