@@ -31,7 +31,7 @@ pub struct Keypair(ed25519::Keypair);
3131impl Keypair {
3232 /// Generate a new Ed25519 keypair.
3333 pub fn generate ( ) -> Keypair {
34- Keypair ( ed25519:: Keypair :: generate :: < sha2 :: Sha512 , _ > ( & mut rand:: thread_rng ( ) ) )
34+ Keypair ( ed25519:: Keypair :: generate ( & mut rand:: thread_rng ( ) ) )
3535 }
3636
3737 /// Encode the keypair into a byte array by concatenating the bytes
@@ -51,7 +51,7 @@ impl Keypair {
5151
5252 /// Sign a message using the private key of this keypair.
5353 pub fn sign ( & self , msg : & [ u8 ] ) -> Vec < u8 > {
54- self . 0 . sign :: < sha2 :: Sha512 > ( msg) . to_bytes ( ) . to_vec ( )
54+ self . 0 . sign ( msg) . to_bytes ( ) . to_vec ( )
5555 }
5656
5757 /// Get the public key of this keypair.
@@ -88,7 +88,7 @@ impl From<Keypair> for SecretKey {
8888impl From < SecretKey > for Keypair {
8989 fn from ( sk : SecretKey ) -> Keypair {
9090 let secret = sk. 0 ;
91- let public = ed25519:: PublicKey :: from ( secret. expand :: < sha2 :: Sha512 > ( ) ) ;
91+ let public = ed25519:: PublicKey :: from ( & secret) ;
9292 Keypair ( ed25519:: Keypair { secret, public } )
9393 }
9494}
@@ -100,7 +100,7 @@ pub struct PublicKey(ed25519::PublicKey);
100100impl PublicKey {
101101 /// Verify the Ed25519 signature on a message using the public key.
102102 pub fn verify ( & self , msg : & [ u8 ] , sig : & [ u8 ] ) -> bool {
103- ed25519:: Signature :: from_bytes ( sig) . and_then ( |s| self . 0 . verify :: < sha2 :: Sha512 > ( msg, & s) ) . is_ok ( )
103+ ed25519:: Signature :: from_bytes ( sig) . and_then ( |s| self . 0 . verify ( msg, & s) ) . is_ok ( )
104104 }
105105
106106 /// Encode the public key into a byte array in compressed form, i.e.
0 commit comments