@@ -105,7 +105,6 @@ impl Debug for Signature {
105105 }
106106}
107107
108- #[ async_trait]
109108pub trait Signer {
110109 type Error : std:: error:: Error + Send + Sync + ' static ;
111110
@@ -114,10 +113,9 @@ pub trait Signer {
114113
115114 /// Sign the supplied data with the secret key corresponding to
116115 /// [`Signer::public_key`]
117- async fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > ;
116+ fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > ;
118117}
119118
120- #[ async_trait]
121119impl < S > Signer for Arc < S >
122120where
123121 S : Signer + Send + Sync ,
@@ -128,12 +126,11 @@ where
128126 self . as_ref ( ) . public_key ( )
129127 }
130128
131- async fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > {
132- self . as_ref ( ) . sign ( data) . await
129+ fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > {
130+ self . as_ref ( ) . sign ( data)
133131 }
134132}
135133
136- #[ async_trait]
137134impl Signer for ed25519_zebra:: SigningKey {
138135 type Error = Infallible ;
139136
@@ -142,7 +139,7 @@ impl Signer for ed25519_zebra::SigningKey {
142139 PublicKey ( vk. into ( ) )
143140 }
144141
145- async fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > {
142+ fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > {
146143 let signature = self . sign ( data) ;
147144 Ok ( Signature ( signature. into ( ) ) )
148145 }
@@ -152,10 +149,10 @@ impl Signer for ed25519_zebra::SigningKey {
152149pub mod thrussh {
153150 use std:: convert:: { TryFrom as _, TryInto as _} ;
154151
152+ use agent;
155153 use byteorder:: { BigEndian , ByteOrder as _} ;
156- use lnk_cryptovec:: CryptoVec ;
157- use lnk_thrussh_agent as agent;
158- use lnk_thrussh_encoding:: { Encoding as _, Position , Reader as _} ;
154+ use cryptovec:: CryptoVec ;
155+ use encoding:: { Encoding as _, Position , Reader as _} ;
159156 use thiserror:: Error ;
160157
161158 use super :: * ;
@@ -165,7 +162,7 @@ pub mod thrussh {
165162 #[ error( "invalid signature was computed" ) ]
166163 Invalid ,
167164 #[ error( transparent) ]
168- Encoding ( #[ from] lnk_thrussh_encoding :: Error ) ,
165+ Encoding ( #[ from] encoding :: Error ) ,
169166 }
170167
171168 impl agent:: key:: Signature for Signature {
@@ -190,7 +187,7 @@ pub mod thrussh {
190187 #[ error( "the public key parsed was not 32 bits in length" ) ]
191188 Invalid ,
192189 #[ error( transparent) ]
193- Encoding ( #[ from] lnk_thrussh_encoding :: Error ) ,
190+ Encoding ( #[ from] encoding :: Error ) ,
194191 }
195192
196193 impl agent:: key:: Public for PublicKey {
@@ -227,7 +224,7 @@ pub mod thrussh {
227224 #[ derive( Debug , Error ) ]
228225 pub enum SigningKeyError {
229226 #[ error( transparent) ]
230- Encoding ( #[ from] lnk_thrussh_encoding :: Error ) ,
227+ Encoding ( #[ from] encoding :: Error ) ,
231228 #[ error( transparent) ]
232229 Ed25519 ( #[ from] ed25519_zebra:: Error ) ,
233230 }
@@ -299,7 +296,7 @@ mod tests {
299296 /// implementations must be byte-for-byte equal.
300297 ///
301298 /// All combinatorial pairs of `Signer` implementations must pass this.
302- async fn compat < S1 , S2 > ( signer1 : S1 , signer2 : S2 )
299+ fn compat < S1 , S2 > ( signer1 : S1 , signer2 : S2 )
303300 where
304301 S1 : Signer ,
305302 S2 : Signer ,
@@ -309,41 +306,39 @@ mod tests {
309306 {
310307 assert_eq ! ( signer1. public_key( ) , signer2. public_key( ) ) ;
311308 assert_eq ! (
312- signer1. sign( MESSAGE ) . await . unwrap( ) ,
313- signer2. sign( MESSAGE ) . await . unwrap( )
309+ signer1. sign( MESSAGE ) . unwrap( ) ,
310+ signer2. sign( MESSAGE ) . unwrap( )
314311 ) ;
315312 }
316313
317- #[ async_trait]
318314 impl Signer for sodiumoxide:: crypto:: sign:: ed25519:: SecretKey {
319315 type Error = Infallible ;
320316
321317 fn public_key ( & self ) -> PublicKey {
322318 PublicKey ( self . public_key ( ) . 0 )
323319 }
324320
325- async fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > {
321+ fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > {
326322 Ok ( Signature (
327323 sodiumoxide:: crypto:: sign:: ed25519:: sign_detached ( data, self ) . to_bytes ( ) ,
328324 ) )
329325 }
330326 }
331327
332- #[ async_trait]
333328 impl Signer for ed25519_dalek:: Keypair {
334329 type Error = Infallible ;
335330
336331 fn public_key ( & self ) -> PublicKey {
337332 PublicKey ( self . public . to_bytes ( ) )
338333 }
339334
340- async fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > {
335+ fn sign ( & self , data : & [ u8 ] ) -> Result < Signature , Self :: Error > {
341336 Ok ( Signature ( DalekSigner :: sign ( self , data) . to_bytes ( ) ) )
342337 }
343338 }
344339
345- #[ tokio :: test]
346- async fn compat_sodium_dalek ( ) {
340+ #[ test]
341+ fn compat_sodium_dalek ( ) {
347342 sodiumoxide:: init ( ) . unwrap ( ) ;
348343
349344 let ( _, sodium) = sodium:: gen_keypair ( ) ;
@@ -353,11 +348,11 @@ mod tests {
353348 ed25519_dalek:: Keypair { secret, public }
354349 } ;
355350
356- compat ( sodium, dalek) . await
351+ compat ( sodium, dalek)
357352 }
358353
359- #[ tokio :: test]
360- async fn compat_zebra_dalek ( ) {
354+ #[ test]
355+ fn compat_zebra_dalek ( ) {
361356 use rand:: rngs:: OsRng ;
362357
363358 let csprng = OsRng { } ;
@@ -369,6 +364,6 @@ mod tests {
369364 ed25519_dalek:: Keypair { secret, public }
370365 } ;
371366
372- compat ( zebra, dalek) . await
367+ compat ( zebra, dalek)
373368 }
374369}
0 commit comments