File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
/Cargo.lock
2
2
/target
3
+ .idea
Original file line number Diff line number Diff line change @@ -8,10 +8,11 @@ use core::cell::OnceCell;
8
8
use core:: cmp;
9
9
use core:: hash:: Hash ;
10
10
use core:: hash:: Hasher ;
11
- use ed25519_dalek:: Signer ;
11
+ use ed25519_dalek:: { Signer , SECRET_KEY_LENGTH } ;
12
12
use ed25519_dalek:: SigningKey ;
13
13
use ed25519_dalek:: Verifier ;
14
14
use ed25519_dalek:: VerifyingKey ;
15
+ use ed25519_dalek:: SecretKey ;
15
16
use rand_core:: CryptoRng ;
16
17
use rand_core:: RngCore ;
17
18
use x25519_dalek:: PublicKey ;
@@ -80,6 +81,15 @@ impl Secret {
80
81
}
81
82
}
82
83
84
+ #[ must_use]
85
+ pub fn from_secret_keys ( secret_key_1 : & SecretKey , secret_key_2 : & SecretKey ) -> Self {
86
+ Self {
87
+ signing_key : SigningKey :: from_bytes ( secret_key_1) ,
88
+ decryption_key : StaticSecret :: from ( * secret_key_2) ,
89
+ identity : OnceCell :: new ( ) ,
90
+ }
91
+ }
92
+
83
93
#[ inline]
84
94
#[ must_use]
85
95
pub fn signing_key ( & self ) -> & SigningKey {
You can’t perform that action at this time.
0 commit comments