14
14
// You should have received a copy of the GNU General Public License
15
15
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
16
17
- use crate :: { Ed25519KeyPair , Generator , KeyPairTrait , SealKeyPair , X25519KeyPair , X25519Private , X25519Public } ;
17
+ use crate :: { Ed25519KeyPair , EncryptionKeyPair , Generator , KeyPairTrait , X25519KeyPair , X25519Private , X25519Public } ;
18
18
use never_type:: Never ;
19
19
use rand:: rngs:: OsRng ;
20
20
#[ cfg( test) ]
@@ -128,12 +128,12 @@ impl Generator<X25519KeyPair> for XorShiftRng {
128
128
}
129
129
}
130
130
131
- impl Generator < SealKeyPair > for Random {
131
+ impl Generator < EncryptionKeyPair > for Random {
132
132
type Error = :: std:: io:: Error ;
133
133
134
134
//FIXME: there is no distinction between the two generate functions
135
135
#[ cfg( not( test) ) ]
136
- fn generate ( & mut self ) -> Result < SealKeyPair , Self :: Error > {
136
+ fn generate ( & mut self ) -> Result < EncryptionKeyPair , Self :: Error > {
137
137
let mut rng = OsRng :: new ( ) ?;
138
138
match rng. generate ( ) {
139
139
Ok ( pair) => Ok ( pair) ,
@@ -142,7 +142,7 @@ impl Generator<SealKeyPair> for Random {
142
142
}
143
143
144
144
#[ cfg( test) ]
145
- fn generate ( & mut self ) -> Result < SealKeyPair , Self :: Error > {
145
+ fn generate ( & mut self ) -> Result < EncryptionKeyPair , Self :: Error > {
146
146
RNG . with ( |rng| {
147
147
match rng. borrow_mut ( ) . generate ( ) {
148
148
Ok ( pair) => Ok ( pair) ,
@@ -152,20 +152,20 @@ impl Generator<SealKeyPair> for Random {
152
152
}
153
153
}
154
154
155
- impl Generator < SealKeyPair > for OsRng {
155
+ impl Generator < EncryptionKeyPair > for OsRng {
156
156
type Error = Never ;
157
157
158
- fn generate ( & mut self ) -> Result < SealKeyPair , Self :: Error > {
158
+ fn generate ( & mut self ) -> Result < EncryptionKeyPair , Self :: Error > {
159
159
let ( publ, sec) = gen_curve25519xsalsa20poly1305 ( ) ;
160
- Ok ( SealKeyPair :: from_keypair ( sec. into ( ) , publ. into ( ) ) )
160
+ Ok ( EncryptionKeyPair :: from_keypair ( sec. into ( ) , publ. into ( ) ) )
161
161
}
162
162
}
163
163
164
- impl Generator < SealKeyPair > for XorShiftRng {
164
+ impl Generator < EncryptionKeyPair > for XorShiftRng {
165
165
type Error = Never ;
166
166
167
- fn generate ( & mut self ) -> Result < SealKeyPair , Self :: Error > {
167
+ fn generate ( & mut self ) -> Result < EncryptionKeyPair , Self :: Error > {
168
168
let ( publ, sec) = gen_curve25519xsalsa20poly1305 ( ) ;
169
- Ok ( SealKeyPair :: from_keypair ( sec. into ( ) , publ. into ( ) ) )
169
+ Ok ( EncryptionKeyPair :: from_keypair ( sec. into ( ) , publ. into ( ) ) )
170
170
}
171
171
}
0 commit comments