1use crate::Result;
3
4pub trait PublicKey {
6 fn as_bytes(&self) -> &[u8];
7 fn from_bytes(bytes: &[u8]) -> Result<Self>
8 where
9 Self: Sized + Clone;
10}
11
12pub trait SecretKey {
14 fn as_bytes(&self) -> &[u8];
15 fn from_bytes(bytes: &[u8]) -> Result<Self>
16 where
17 Self: Sized + Clone;
18}
19
20pub trait Ciphertext {
22 fn as_bytes(&self) -> &[u8];
23 fn from_bytes(bytes: &[u8]) -> Result<Self>
24 where
25 Self: Sized + Clone + Copy;
26}
27
28pub trait SharedSecret {
30 fn as_bytes(&self) -> &[u8];
31 fn from_bytes(bytes: &[u8]) -> Result<Self>
32 where
33 Self: Sized + Clone + Copy;
34}