1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//! X25519 private-key.

use crypto_box::SecretKey;

/// Message sender's private key
#[derive(Clone, Debug)]
pub struct SenderPrivateKey(SecretKey);

impl AsRef<SecretKey> for SenderPrivateKey {
    fn as_ref(&self) -> &SecretKey {
        &self.0
    }
}

impl From<SecretKey> for SenderPrivateKey {
    fn from(s: SecretKey) -> Self {
        Self(s)
    }
}

/// Message receiver's private key
#[derive(Clone, Debug)]
pub struct ReceiverPrivateKey(SecretKey);

impl AsRef<SecretKey> for ReceiverPrivateKey {
    fn as_ref(&self) -> &SecretKey {
        &self.0
    }
}

impl From<SecretKey> for ReceiverPrivateKey {
    fn from(s: SecretKey) -> Self {
        Self(s)
    }
}